aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlib/spawn7
-rw-r--r--readme.md51
2 files changed, 54 insertions, 4 deletions
diff --git a/lib/spawn b/lib/spawn
index 07c27d8..1d19aa4 100755
--- a/lib/spawn
+++ b/lib/spawn
@@ -5,13 +5,12 @@ SOCKDIR=$(mktemp -d)
SOCKF=${SOCKDIR}/usock
# Start tmux, if needed
-if ! tmux ls | grep -q rshell; then
- tmux new -s rshell -d
+if ! tmux ls | grep -q rshsh; then
+ tmux new -s rshsh -d
fi
# Create window
-# Let's just see it works
-tmux new-window -t rshell "socat UNIX-LISTEN:${SOCKF},umask=0077 STDIO"
+tmux new-window -t rshsh "socat UNIX-LISTEN:${SOCKF},umask=0077 file:\$(tty),raw,echo=0"
# Wait for socket
while test ! -e ${SOCKF} ; do sleep 1 ; done
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..7312a11
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,51 @@
+# rshsh A set of reverse shell shell scripts
+
+`rshsh` is an acronym Reverse Shell SHell scripts
+
+A little bit of messing around with `socat`, and scraping Google for some
+examples and I've put together a set of small scripts that will setup a server
+that will accept multiple clients and toss them into their own `tmux` windows
+
+It also generates client scripts that verify the server with the embedded
+TLS certificate, so it's a secure reverse shell haha.
+
+
+## Setup
+
+It's pretty simple, clone the repository to a server with a public IP.
+
+Open up `vars` and adjust the relevant variables. Ones of interest are likely
+to be `port` and `hostname` which are used to specify the local port to listen
+on as well as the hostname the client will connect to respectively.
+
+Then run `./server.sh` I recommend running it under `tmux` or `runsvdir` so
+the server is persistently running in the background. Neither `tmux` or
+`runsvdir` are covered in depth here.
+
+From There you can generate the client script with:
+
+```
+$ ./genclient.sh > /tmp/client.sh
+```
+
+And you can `scp` it off to your other boxes or whatever. Even copy and
+paste works.
+
+
+## Attaching to a connected reverse shell
+
+Should be as simple as:
+````
+tmux att -t rshsh
+```
+
+From the user account that the server is running under. Each connection
+will be placed in their own `tmux` windows.
+
+
+## Other configuration options
+
+### Disabling auto re-connect
+
+If for some reason you don't want to have the reverse shells attempt to
+re-connect every 5 seconds after a disconnect set `loop=0` in `vars`