Documentation (#22)

* Update README.md

* Update README.md

* Update README.md

* badges to sub-readmes

* main readme polishing

* formatting

* feasts feedback incorporated
This commit is contained in:
kmanc
2022-01-27 18:09:34 -08:00
committed by GitHub
parent 14bf59fa01
commit 1d084e598d
3 changed files with 46 additions and 41 deletions
+14 -22
View File
@@ -1,29 +1,22 @@
# RCO: TCP Reverse Shell
## What it is
[![Custom badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fkmanc%2Fremote_code_oxidation%2Fmaster%2F.custom_shields%2Ftcp_reverse_shell.json)](https://github.com/kmanc/remote_code_oxidation/tree/master/tcp_reverse_shell)
Linux target | Windows target
:-------------------------:|:-------------------------:
![](https://user-images.githubusercontent.com/14863147/151044738-72dbec76-73b1-47c5-831a-2e995673b559.gif) | ![](https://user-images.githubusercontent.com/14863147/151058869-8e5e9f6e-3f7b-4a98-ab65-2ac5017a4e76.gif)
RCO's TCP reverse shell is a no-frills [reverse shell](https://www.hackingtutorials.org/networking/hacking-netcat-part-2-bind-reverse-shells/). This means it allows you to run Terminal (Linux)
or Command Prompt (Windows) commands _on the victim machine_ from the attacking machine. Getting a remote shell on a
victim machine usually allows much more control over the victim than other attacks.
## How it works
Both RCO's Linux and Windows TCP reverse shells work by establishing a [TCP session](https://www.scottklement.com/rpg/socktut/overview.html) from the victim machine
to the attacking machine. Then a Terminal (Linux) or Command Prompt (Windows) process is spun up with its [standard input](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)),
[standard output](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)), and [standard error](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) all assigned to the TCP session. This means that
input commands and output results are read from and written to (respectively) a TCP stream.
The reverse shells for both Linux and Windows work by establishing a [Transmission Control Protocol (TCP) session](https://www.scottklement.com/rpg/socktut/overview.html) from the victim machine to the attacking machine. Then a Terminal (Linux) or Command Prompt (Windows) process then starts with its [standard input](https://en.wikipedia.org/wiki/Standard_streams#Standard_input_(stdin)), [standard output](https://en.wikipedia.org/wiki/Standard_streams#Standard_output_(stdout)), and [standard error](https://en.wikipedia.org/wiki/Standard_streams#Standard_error_(stderr)) all assigned to the TCP session. This means that input commands and output results are read from and written to (respectively) the TCP stream.
## Using it
1. Start a listener on the attacking machine
```commandline
nc -nlvp 4444
```
2. Open [the config file](https://github.com/kmanc/remote_code_oxidation/blob/master/rco_config/src/lib.rs)
and change the IP address and port to match your attacking machine and listener, respectively
3. Compile the executable
1. [Not shown in GIF] Open [the config file](https://github.com/kmanc/remote_code_oxidation/blob/master/rco_config/src/lib.rs)
and change the IP address and port to match the IP address of your attacking machine and the port you will use for a listener respectively
2. [Not shown in GIF] Compile the executable
#### For Linux targets
```commandline
@@ -34,14 +27,13 @@ and change the IP address and port to match your attacking machine and listener,
```commandline
cargo build --target x86_64-pc-windows-gnu -p tcp_reverse_shell --release
```
3. Start a netcat listener on the attacking machine on the same port you configured in step 1
```commandline
nc -nlvp 4444
```
4. Execute the payload on the victim machine
5. Return to the listener and enter desired commands for the victim machine to run
![tcp_reverse_shell_linux](https://user-images.githubusercontent.com/14863147/151044738-72dbec76-73b1-47c5-831a-2e995673b559.gif)
![tcp_reverse_shell_windows](https://user-images.githubusercontent.com/14863147/151058869-8e5e9f6e-3f7b-4a98-ab65-2ac5017a4e76.gif)
## Detection rates