
Shhhloader ist ein Shellcode-Loader in Arbeit. Er nimmt rohen Shellcode als Eingabe und kompiliert einen C++-Stub, der eine Reihe verschiedener Dinge tut, um AV/EDR zu umgehen. Der enthaltene Python-Builder funktioniert auf jedem Linux-System, auf dem Mingw-w64 installiert ist.
1/25/24 EDIT: Shhhloader unterstützt jetzt PoolParty Variante 7! Es wurde auch eine Option hinzugefügt, die PoolParty mit Module Stomping kombiniert, um zu verhindern, dass der ausgeführte Shellcode im ungebackten Speicher bleibt. Siehe unten ein Video, das diese neue Injektionsmethode gegen Defender ATP demonstriert:
┳┻|
┻┳|
┳┻|
┻┳|
┳┻| _
┻┳| •.•) - Shhhhh, AV might hear us!
┳┻|⊂ノ
┻┳|
usage: Shhhloader.py [-h] [-p explorer.exe] [-m QueueUserAPC] [-u] [-w] [-nr] [-ns] [-l] [-v] [-sc GetSyscallStub] [-d] [-dp apphelp.dll] [-s domain]
[-sa testlab.local] [-o a.exe] [-pp explorer.exe] [-ppv] [-np] [-cp] [-td ntdll.dll] [-ef NtClose]
file
ICYGUIDER'S CUSTOM SYSCALL SHELLCODE LOADER
positional arguments:
file File containing raw shellcode
options:
-h, --help show this help message and exit
-p explorer.exe, --process explorer.exe
Process to inject into (Default: explorer.exe)
-m QueueUserAPC, --method QueueUserAPC
Method for shellcode execution (Options: PoolPartyModuleStomping, PoolParty, ThreadlessInject, ModuleStomping, QueueUserAPC,
ProcessHollow, EnumDisplayMonitors, RemoteThreadContext, RemoteThreadSuspended, CurrentThread) (Default: QueueUserAPC)
-u, --unhook Unhook NTDLL in current process
-w, --word-encode Save shellcode in stub as array of English words
-nr, --no-randomize Disable syscall name randomization
-ns, --no-sandbox Disable sandbox checks
-l, --llvm-obfuscator
Use Obfuscator-LLVM to compile stub
-v, --verbose Enable debugging messages upon execution
-sc GetSyscallStub, --syscall GetSyscallStub
Syscall execution method (Options: SysWhispers2, SysWhispers3, GetSyscallStub, None) (Default: GetSyscallStub)
-d, --dll Generate a DLL instead of EXE
-dp apphelp.dll, --dll-proxy apphelp.dll
Create Proxy DLL using supplied legitimate DLL (File must exist in current dir)
-s domain, --sandbox domain
Sandbox evasion technique (Options: sleep, domain, hostname, username, dll) (Default: sleep)
-sa testlab.local, --sandbox-arg testlab.local
Argument for sandbox evasion technique (Ex: WIN10CO-DESKTOP, testlab.local)
-o a.exe, --outfile a.exe
Name of compiled file
PPID Spoofing:
-pp explorer.exe, --ppid explorer.exe
Parent process to use for PPID Spoofing (Default: explorer.exe)
-ppv, --ppid-priv Enable spoofing for privileged parent process (Disabled by default)
-np, --no-ppid-spoof Disable PPID spoofing
ThreadlessInject:
-cp, --create-process
Create process instead of injecting into existing one
-td ntdll.dll, --target-dll ntdll.dll
Target DLL containing export function to overwrite
-ef NtClose, --export-function NtClose
Export function to overwrite
Funktionen:
Siehe unten ein PoC-Video der ThreadlessInject-Methode, die verwendet wird, um einen Havoc-Beacon in IE zu injizieren, ohne Alarme auszulösen, und mit minimalen Ereignissen in Microsoft Defender for Endpoint (MDE) EDR (Aufgenommen am 4/3/2023):
Siehe unten ein Video, das die Module Stomping-Injektionstechnik demonstriert, die über DLL-Proxying ausgeführt wird (Aufgenommen am 8/9/2022):
Shhhloader wurde auch in das Havoc C2 Framework über ein Modul von @jakobfriedl integriert. Siehe unten ein Video, das das Modul demonstriert:
Bekannte Probleme/Hinweise:
-p verwenden, um den Namen eines Prozesses anzugeben, von dem Sie wissen oder vermuten, dass er auf dem Zielsystem bereits läuft.-cp bereitgestellt wird. Ich hoffe, bald einen Weg zu finden, dies auch mit angehaltenen Prozessen zum Laufen zu bringen.Geplante Aktualisierungen:
OPTIONAL: Um die Obfuscator-LLVM-Flag zu verwenden, müssen Sie diese auf Ihrem System installiert haben zusammen mit wclang. Ich fand das etwas mühsam, aber mit ein wenig Ausdauer sollte es machbar sein. Hier eine Schritt-für-Schritt-Anleitung, die ich verwendet habe, um den llvm-13.x-Branch von OLLVM auf meinem Kali Linux zu installieren:
# Clone and Run CMake
git clone -b llvm-13.x https://github.com/heroims/obfuscator.git
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_NEW_PASS_MANAGER=OFF ../obfuscator/llvm/
# Configure CMake and Compile OLLVM
export clang_build_dir=$(cd ../; pwd)/obfuscator/clang
sed -i 's/LLVM_TOOL_CLANG_BUILD:BOOL=OFF/LLVM_TOOL_CLANG_BUILD:BOOL=ON/g' CMakeCache.txt
sed -i "s|LLVM_EXTERNAL_CLANG_SOURCE_DIR:PATH=|LLVM_EXTERNAL_CLANG_SOURCE_DIR:PATH=$clang_build_dir|g" CMakeCache.txt
make -j7
# ONCE COMPILED, BACKUP ORIGINAL CLANG BINARIES
mv /usr/bin/clang /usr/bin/clang13.0.1
mv /usr/bin/clang++ /usr/bin/clang++13.0.1
# Then in OLLVM build/bin dir, copy the newly build clang bins
cp bin/clang /usr/bin/clang
cp bin/clang++ /usr/bin/clang++
# Then install wclang
cd ..
git clone https://github.com/tpoechtrager/wclang.git
cd wclang/
cmake -DCMAKE_INSTALL_PREFIX=_prefix_ .
make
make install
export wclang_path=$(pwd)/_prefix_/bin
echo "export PATH=$wclang_path:$PATH" >> ~/.bashrc
export PATH=$wclang_path:$PATH
# Then backup original lib files
cp -R /lib/llvm-13/lib/clang/13.0.1/include/ /lib/llvm-13/lib/clang/13.0.1/include_backup/
# Finally in the OLLVM build/bin/lib/clang/13.0.1/ dir, copy the include folder
cd ../build/lib/clang/13.0.1/
cp -R include/ /lib/llvm-13/lib/clang/13.0.1/
Es gibt wahrscheinlich einen besseren Weg, aber das hat bei mir funktioniert. Wenn Sie Probleme haben, versuchen Sie es weiter und stellen Sie sicher, dass Sie x86_64-w64-mingw32-clang++ -v ausführen können und die Ausgabe entweder „Obfuscator-LLVM“ oder „heroims“ enthält. Leider habe ich keine Zeit, Einzelpersonen zu helfen, die möglicherweise mehr Unterstützung benötigen, aber Sie können dieses Issue in meinem Nimcrypt2-Repo lesen, wo ein paar Benutzer herausgefunden haben, wie es auf ihren Systemen funktioniert.
Grüße & Danksagung: