offensive-tools/evasion/shellcode-fluctuation/SKILL.md
C++ shellcode fluctuation technique that encrypts injected shellcode between C2 sleep intervals to evade EDR memory scans. Use when implants are being detected by memory-scanning EDR products during sleep.
npx skillsauth add aeondave/malskill shellcode-fluctuationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
C++ in-memory evasion — XOR-encrypts shellcode in RX pages during C2 sleep to defeat memory scanners.
# Clone and build with MSVC
git clone https://github.com/mgeeky/ShellcodeFluctuation
# Open in Visual Studio, build Release x64
# Or MinGW
x86_64-w64-mingw32-g++ -O2 -o fluctuator.exe main.cpp -lntdll
[Shellcode in memory]
Awake: → Decrypt → Execute → Sleep
Asleep: → Encrypt (XOR) → change PROT to RW → Scanner sees garbage
Wake: → change PROT to RX → Decrypt → Resume
#define SHELLCODE_FLUCTUATE true
#define XOR_KEY 0xdeadbeef
#define SLEEP_INTERVAL_MS 5000
Integrate into Cobalt Strike BOF loader:
FluctuateShellcode() wrapper before Sleep()Combine with indirect syscalls:
// Replace VirtualProtect with direct NtProtectVirtualMemory
// via syscall stub to avoid API hooks
| File | When to load |
|------|--------------|
| references/ | Hook evasion and memory protection patterns |
development
Auth/lab ref: Unicorn Engine CPU-only emulation for shellcode, decryptors, custom VM handlers, instruction tracing, memory hooks, and register-level experiments.
development
Auth/lab ref: Renode board and SoC simulation for MCU/RTOS firmware, UART/GPIO/peripheral modeling, GDB remote debugging, REPL platforms, and RESC scripts.
development
Auth/lab ref: Qiling OS-layer binary emulation for PE/ELF/Mach-O/UEFI/shellcode with rootfs, syscall/API hooks, filesystem mapping, and runtime patching.
databases
Auth/lab ref: QEMU user-mode and full-system emulation for cross-arch binaries, firmware, kernels, disks, serial consoles, networking, and GDB stubs.