aboutsummaryrefslogtreecommitdiff
path: root/readme.md
blob: 7c266c038f5a59a72402a3df553830ad4891787e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# 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.

## Building static socat

In the `socat` directory there's a `build.sh` that can be used to build
a statically linked socat binary.

There's a script `genclient-embed.sh` which can then be used to generate a
client script that has socat embedded.

## 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`