Nariod / RustPacker

Template-based shellcode packer written in Rust, with indirect syscall support. Made with <3 for pentesters.
GNU General Public License v3.0
237 stars 23 forks source link
packer pentesting rust



Rustpacker

But, does it bypass Windows Defender ?

Yes! Here with the common metasploit calc exec payload on a Windows 11 host, using the ntCRT template and AES. Last test on 21/12/2023.

Windows Defender bypass

Summary

Quick start

Podman/Docker setup

Consider using Podman instead of Docker for security reasons. From any internet-connected OS with either Podman or Docker installed:

For regular use, you can set an alias:

Full documentation

Create shellcode

RustPacker is compatible with any raw shellcode.

Metasploit / MSFvenom

You can generate raw MSF shellcode using msfvenom's raw format. Ex:

Sliver

You can generate raw Sliver shellcode using Sliver's "--format shellcode". Ex:

Install Rustpacker

Podman/Docker setup

Consider using Podman instead of Docker for security reasons. From any internet-connected OS with either Podman or Docker installed:

For regular use, you can set an alias:

Manual install on Kali

Install dependencies:

Install Rust:

Run RustPacker:

Use Rustpacker

For now, you can choose from the following templates:

All the templates are compatible with either XOR or AES encryption, and can generate an EXE or a DLL file. Templates that inject in remote processes are compatible with the -t option to target the process of your choice.

Usage examples

If you want to pack your Sliver shellcode using the ntCRT template with AES encryption, target notepad.exe, and retrieve an EXE file:

If you want to pack your Msfvenom shellcode using the ntAPC template with XOR encryption, and retrieve a DLL file:

If you want to specify a custom output directory and filename for the resulting binary:

Deprecated templates

These templates are no longer available with RustPacker, but can be found in RustPacker/templates/OLD/:

Are you a Rust developer?

If you have some experience with Rust, you're more than welcome to help ! You can help by:

Todo

Credits

Legal disclaimer

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.