All Projects → cdong1012 → Crab-Runner

cdong1012 / Crab-Runner

Licence: MIT License
Shellcode runner in Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Crab-Runner

FuckAV
python写的一款免杀工具(shellcode加载器)BypassAV,国内杀软全过(windows denfend)2021-9-13
Stars: ✭ 254 (+1054.55%)
Mutual labels:  shellcode-loader
DInjector
Collection of shellcode injection techniques packed in a D/Invoke weaponized DLL
Stars: ✭ 497 (+2159.09%)
Mutual labels:  shellcode-loader
HellgateLoader CSharp
Load shellcode via HELLGATE, Rewrite hellgate with .net framework for learning purpose.
Stars: ✭ 73 (+231.82%)
Mutual labels:  shellcode-loader
shellcode-loader
Shellcode Loader Engine for Windows
Stars: ✭ 24 (+9.09%)
Mutual labels:  shellcode-loader
NewNtdllBypassInlineHook CSharp
Load a fresh new copy of ntdll.dll via file mapping to bypass API inline hook.
Stars: ✭ 35 (+59.09%)
Mutual labels:  shellcode-loader

CrabRunner

A shellcode runner written in Rust

Motivation

During Flare-On 7, I came across a lot of challenges where shellcode analysis was crucial, and I solved them using shellcode runners that I found online.

Up until that point, I never really thought much about how these programs were implemented. In the course of my internship interview with FireEye, I was asked about how I would implement my own runner to solve the challenges, and that had inspired me to write one in my favorite language now!

Screenshots

Usage

Running with Command Prompt

.\crab_runner.exe <shellcode file>

Params

Specifying the offset for the shellcode to start. Note: offset can be in both hex and decimal form

.\crab_runner.exe <shellcode file> --offset 0x10
.\crab_runner.exe <shellcode file> --offset 16

Dumping shellcode to another file to capture self-modification. Note: see Shellcode Dumping

.\crab_runner.exe <shellcode file> --dump

Print the version of the program

.\crab_runner.exe --version

Print help for all command-line options:

.\crab_runner.exe
.\crab_runner.exe --help

Features

Normal run

During a normal run, the shellcode is read from the file and written to a buffer allocated by VirtualAlloc.

Then, the program creates a thread in the suspended state with the entry point equals to the base of the buffer added by the offset (if provided).

Dump and run

When the param "--dump" is given, the program will copy the content of the given file into a new file. The name of this new file will be the name of the original file appended with _dump.out.

This new file will be mapped into memory, and its base address will be the entry point for the suspended thread.

When the shellcode runs, if there is any self-modification, the changes should be capture in this file we dump.

For example, if the shellcode unpacks itself, this dumped file will contain the unpacked version after the first run.

Attaching a debugger

Before resuming the thread, make sure to attach a debugger through the following steps:

1. Open your favorite debugger
2. Attach your debugger to the given thread
3. Go to the given entry point and place a breakpoint (Important!!)
4. Hit "Run"
5. Enter anything to begin in your command prompt
6. Hit "Run" until you hit this breakpoint!

For developers

Clone the source locally:

$ git clone https://github.com/cdong1012/Crab-Runner

Build project

$ cargo build --release

Run project

$ cargo run

Acknowledgement

OALabs - BlobRunner

adamkramer - jmp2it

Omar Sardar and Michael Bailey - Inspired me to write my own shellcode runner in our interview!

License

MIT © Chuong Dong

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].