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 -2
View File
@@ -1,11 +1,14 @@
# Remote code oxidation (RCO)
# Remote Code Oxidation (RCO)
[![RCO for Linux targets](https://github.com/kmanc/remote_code_oxidation/actions/workflows/linux.yml/badge.svg)](https://github.com/kmanc/remote_code_oxidation/actions/workflows/linux.yml)
[![RCO for Windows targets](https://github.com/kmanc/remote_code_oxidation/actions/workflows/windows.yml/badge.svg)](https://github.com/kmanc/remote_code_oxidation/actions/workflows/windows.yml)
![language](https://img.shields.io/github/languages/top/kmanc/remote_code_oxidation?style=plastic&color=orange)
![license](https://img.shields.io/github/license/kmanc/remote_code_oxidation?style=plastic&color=blueviolet)
A collection of offensive security tools written in Rust. More details to come
Remote Code Oxidation is a collection of offensive security tools written in Rust. My main goal for the project is to enable offensive security professionals and practitioners to prepare the tools needed for an engagement with as little overhead as possible.
RCO tools can be compiled on either Linux or Windows systems to provide its users flexibility in their attack infrastructure. Similarly the tools work against either Linux or Windows targets to suit the needs of the task at hand.
## Tools list
[![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)
@@ -20,6 +23,7 @@ Clone the repo
git clone https://github.com/kmanc/remote_code_oxidation.git
```
### From Linux host for Linux target
Install Rust
@@ -37,6 +41,7 @@ Build!
cargo build [-p package_name] [--release]
```
### From Linux host for Windows target
Install Rust
@@ -54,3 +59,10 @@ Build!
```commandline
cargo build --target x86_64-pc-windows-gnu [-p package_name] [--release]
```
### From Windows host for Linux target
####Todo
### From Windows host for Windows target
####Todo
+18 -17
View File
@@ -1,25 +1,26 @@
# RCO: Process Migration
## 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%2Fprocess_migration.json)](https://github.com/kmanc/remote_code_oxidation/tree/master/process_migration)
Linux target | Windows target
:-------------------------:|:-------------------------:
![](https://user-images.githubusercontent.com/14863147/151044951-5ee5b376-9f62-4e2e-a773-8c3b7a7d580e.gif) | ![](https://user-images.githubusercontent.com/14863147/151059013-b053e9de-d75c-4470-97a7-a109c7f2ef55.gif)
RCO's process migration is a technique used to hide malicious code running on a victim machine. It has the added benefit
of making it less likely the the malicious code is accidentally closed by a user on a victim machine by moving the payload
to a process that is unlikely to be terminated.
## How it works
RCO's Windows process migration works by obtaining a handle to the target process and writing [shellcode](https://en.wikipedia.org/wiki/Shellcode) to it. Then it
spawns a remote thread within the process whose starting point is the newly written shellcode. RCO's Linux process migration works slightly differently; it temporarily pauses the target process, then writes the shellcode over the [instruction pointer](https://datacadamia.com/computer/instruction/instruction_pointer) for that process. This will likely cause issues with the process.
Windows process migration works by obtaining a handle to the target process and writing [shellcode](https://en.wikipedia.org/wiki/Shellcode) to it. A remote thread is then created; the starting point of this thread is the newly written shellcode.
Linux process migration works slightly differently. After temporarily pausing the target process, RCO writes shellcode over the process's [instruction pointer](https://datacadamia.com/computer/instruction/instruction_pointer). This can cause issues (the most likely of which is crashing) for the target process.
## Using it
1. Generate shellcode for the desired end result (for example, use [msfvenom](https://book.hacktricks.xyz/shells/shells/msfvenom) to generate a reverse TCP
1. [Not shown in GIF] Generate shellcode for the desired end result (for example, use [msfvenom](https://book.hacktricks.xyz/shells/shells/msfvenom) to generate a reverse TCP
shell shellcode for the target operating system)
2. Open [the config file](https://github.com/kmanc/remote_code_oxidation/blob/master/rco_config/src/lib.rs)
2. [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 shellcode to the shellcode generated in step 1
3. Compile the executable
3. [Not shown in GIF] Compile the executable
#### Build for Linux target
```commandline
@@ -30,13 +31,13 @@ and change the shellcode to the shellcode generated in step 1
```commandline
cargo build --target x86_64-pc-windows-gnu -p process_migration --release
```
4. Execute the payload on the victim machine
5. Return to the listener and enter desired commands for the victim machine to run
4. Start a netcat listener on the attacking machine on the same port you configured the shellcode to connect to in step 1
```commandline
nc -nlvp 4444
```
5. Execute the payload on the victim machine
6. Return to the listener and enter desired commands for the victim machine to run
![process_migration_linux](https://user-images.githubusercontent.com/14863147/151044951-5ee5b376-9f62-4e2e-a773-8c3b7a7d580e.gif)
![process_migration_windows](https://user-images.githubusercontent.com/14863147/151059013-b053e9de-d75c-4470-97a7-a109c7f2ef55.gif)
## Detection rates
+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