PickerPacker
Building Custom Execution Chains with Rust
What is this ???
PickerPacker is a extremely modular rust-based packer that allows you to mix and match various attack techniques ranging from execution types to different injections and AV/EDR evasion methods to essentially create your own payload execution chain.
While PickerPacker is specifically made for red-teaming in mind, it can be used for benign software packing too! Just you know... don't use the evasion features for that.
β β β β β β β β β β β β β β β β β β β’β£β£β£β£β£β£β β β β β β β β β β β β β β β β β β β β β
β β β β β β β β β β β β β β β β’β£ β‘Άβ Ώβ Ώβ Ώβ β’€β£β£β ⣩β‘β β ¦β£β β β β β β β β β β β β β β β β β
β β β β β β β β β β β β β β£ β β β β β β β β β β β β β β β β β β£§β β β β β β β β β β β β β β β β
β β β β β β β β β β β β β’°β β β β β β β β β β β β β β β β β β β β‘β β β β β β β β β β β β β β β
β β β β β β β β β β β β β‘Ύβ β β β β β β β β β β β β β β β β β β β’»β‘β β β β β β β β β β β β β β
β β β β β β β β β β β β β‘β β β β β β β β β β β β β β β β β β β β β£§β β β β β β β β β β β β β β
β β£β£€β£€β£β‘β β β β β β β‘β β β β β β β β β β β β β β β β β β β β β Έβ‘β β β β β’β£€β €β €β €β’€β£β β
β’°β β β β β β β ²β’€β£β β β‘β β β β β β β β β β β β β β β β β β β β β β’Ήβ‘β’β‘΄β β β β β β β β β’³β‘
β’Έβ‘β β β β β β β β β β’¦β£§β£β£β£β β β β β β β β β β β β β β β β£β£β£€β‘΄β β β β β β β β β β β β β‘·
β β’³β‘β β β β β β β β β β β β »β’β£β β β β ²β Άβ Άβ Άβ Άβ β β β β β β β β β β β β β β β β β β β β£Έβ
β β β β’Άβ£β β β β β β β β β β β β β β ²β’€β£β‘β β β β β β β β β β β β β β β β β β β β β β β’β‘Όβ β
β β β β β β β ’β’β£β β β β β β β β β β β β β β β ¦β’β£β β β β β β β β β β β β β β β β’β£ β ΄β β β β
β β β β β β β β β β β β β β β €β €β €β €β €β €β €β €β €β €β €β €β €β €β£€β£€β €β €β €β €β €β €β β β β β β β β β β β β β β β β β β
βββββββ βββ ββββββββββ ββββββββββββββββββ
ββββββββββββββββββββββ ββββββββββββββββββββ
ββββββββββββββ βββββββ ββββββ ββββββββ
βββββββ ββββββ βββββββ ββββββ ββββββββ
βββ ββββββββββββββ ββββββββββββββ βββ
βββ βββ ββββββββββ ββββββββββββββ βββ
βββββββ ββββββ ββββββββββ ββββββββββββββββββ
βββββββββββββββββββββββββββ ββββββββββββββββββββ
βββββββββββββββββββ βββββββ ββββββ ββββββββ
βββββββ βββββββββββ βββββββ ββββββ ββββββββ
βββ βββ ββββββββββββββ ββββββββββββββ βββ
βββ βββ βββ ββββββββββ ββββββββββββββ βββ
β§ο½₯οΎ:*β§ο½₯οΎ:* Rust-Powered Customizable Packer *:ο½₯οΎβ§*:ο½₯οΎβ§
Created by: Swayam Tejas Padhy (@Leek0gg)
GitHub: https://github.com/Swayampadhy/PickerPackerWhy is this ??
I was looking into various packers and how they work for a research paper of mine while I realized that no packers existed which provided granular modularity in the execution of the payload i.e. letting the user pick and choose whatever they wanted for the execution chain .
While projects such as RustPacker, ProtectMyTooling exist, they are based on templates i.e. they have multiple options of execution chain sets but aren't granularly selective.
This led me to design PickerPacker which is granularly selective to the point that you can pick and choose each step of the payload's execution chain; creating unique and custom chains execution chains for yourself.
Now being the devil's advocate, being extremely granular is also not a good thing. For example: PickerPacker has 5 different ETW patching methods. Enabling them all at the same time is frankly stupid and just leads to more detection surface. Due to this, I have put some minor restrictions in the execution chain creation. But I will try to keep this as minimal as required.
I decided to develop this packer in rust because.... why not? I anyway wanted to learn rust and what's the best way to do that - Do a very complex rust project of course!! Who reads books Pffft (kidding).
On a sidenote, Rust is quickly becoming my favorite. While it can never replace C for me, it definitely is better than C++ or other languages that I have worked with in the past.
How to use this ??
PickerPacker is production-ready. So you can use it for your engagements if you want. I have tested the packer against various anti-malware solutions and the only ones to detect it are BkavPro (W64.AIDetectMalware) and Elastic (Medium confidence). Below is a virus total detection result of the final packed payload.

The packer was also able to evade Elastic's agent in full detect and prevent mode. I was not able to test it against other EDRs as I don't have access to them (I am still a college student lol).
While PickerPacker is production-ready, this doesn't mean that it is finished yet. I am planning to add a lot more features in upcoming releases. Stay tuned to the GitHub repo for that.
How PickerPacker Works ??
PickerPacker has two main parts to it -
The packer binary- This does the packing of the payloadThe template folder- This folder contains the source files for the final packed binary. Any changes to the behavior of the final packed binary is to be done here.
While designing this packer, I had the option of embedding the packer template into the packer binary or keep it separate. While embedding it inside the packer allows for easier distribution (everything is contained in a huge binary), adding more features to the packer and maintaining it becomes exponentially difficult as everything breaks even if I change one simple variable. Thus I decided to keep it separate. This can of course be changed in future releases if people want it.

As seen in the above flowchart, PickerPacker takes in the selected features to compile as input from the user, analyzes them, prepares template files accordingly and finally compiles the final packed executable accordingly. See below expandable for more details.
The template folder contains the source code that is selectively compiled during final packer compilation. You can check out the template code here.
Which parts of the template code are compiled is dictated by a neat rust feature named - Rust Features. Rust features ensures that only the features that are selected during compilation are the ones that are included in the final compilation. Almost every code in the template folder is feature-gated except some bare essential code. This allows for compile-time modularity.

Which features to be included in each compilation is dictated by the packer. The packer creates a cargo sub-process, takes in the desired feature inputs from the user, pushes appropriate compile flags to the sub-process and runs the cargo compile command. This results in the compilation of a packed executable with your unique desired execution chain features.
So How to use it ??
Basic Command Structure
Command-Line Options
--input <FILE>
Required. Path to shellcode file
--input calc.bin
--execution <METHOD>
Execution technique (default: default)
--execution fiber
--injection <METHOD>
Injection method (default: default)
--injection modulestomping
--checks <CHECKS>
Comma-separated check methods
--checks dbgprocesslist,vmcpu
--evasion <EVASION>
Comma-separated evasion techniques
--evasion amsisimple,etwwinapi
--encrypt <METHOD>
Encryption algorithm (tinyaes or ctaes)
--encrypt tinyaes
--key <HEX>
AES key (64 hex chars / 32 bytes)
--key ABC123...
--iv <HEX>
AES IV (32 hex chars / 16 bytes)
--iv DEF456...
Usage Examples
1οΈβ£ Basic Execution
2οΈβ£ With Execution Method
3οΈβ£ With Injection Method
4οΈβ£ With Anti-Debug Checks
5οΈβ£ With Evasion Techniques
6οΈβ£ With Encryption
7οΈβ£ Kitchen Sink (All Features)
Running the Packed Executable
Credits & Acknowledgments
rtecCyberSec/Packer_Development - Primary inspiration for this project
janoglezcampos/rust_syscalls - Indirect syscall implementation
This project incorporates techniques and code snippets from:
Maldev Academy - Malware development educational resources
Whitecat18/Rust-for-Malware-Development - Rust malware development examples
joaoviictorti/RustRedOps - Offensive Rust techniques
If you want to contribute to this project, see CONTRIBUTING.md.
Last updated