
Shhhloaderは開発中のシェルコードローダーです。生のシェルコードを入力として受け取り、AV/EDRを回避するためのさまざまな処理を行うC++スタブをコンパイルします。含まれているPythonビルダーは、Mingw-w64がインストールされている任意のLinuxシステムで動作します。
2024年1月25日編集: ShhhloaderはPoolParty variant 7をサポートするようになりました!また、Module StompingとPoolPartyを組み合わせて、実行されたシェルコードがバックされていないメモリに存在しないようにするオプションが追加されました。以下のビデオで、Defender ATPに対するこの新しいインジェクション手法のデモをご覧ください:
┳┻|
┻┳|
┳┻|
┻┳|
┳┻| _
┻┳| •.•) - 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
機能:
以下は、ThreadlessInjectメソッドを使用してHavocビーコンをIEに注入し、Microsoft Defender for Endpoint (MDE) EDRでアラートやイベントを最小限に抑えながら実行したPoCビデオです(2023年4月3日録画):
以下は、DLLプロキシを介して実行されるModule Stompingインジェクション手法のデモビデオです(2022年8月9日録画):
Shhhloaderは、@jakobfriedlによるモジュールを介してHavoc C2フレームワークにも統合されています。以下はそのモジュールのデモビデオです:
既知の問題/注意事項:
-pフラグを使用して、ターゲットシステムで既に実行されていることが分かっている、または推測されるプロセスの名前を指定する必要があります。-cpオプションが指定されている場合、これは自動的に行われます。いずれは一時停止されたプロセスでも動作する方法を見つけたいと考えています。今後のアップデート予定:
オプション: Obfuscator-LLVMフラグを使用するには、システムにwclangと一緒にインストールされている必要があります。これは少し面倒かもしれませんが、忍耐強く取り組めばできるはずです。以下は、Kali LinuxシステムにOLLVMのllvm-13.xブランチをインストールするために使用した手順です:
# 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/
おそらくこれより良い方法もありますが、これは私にとってうまくいった方法です。問題がある場合は、粘り強く試し続け、x86_64-w64-mingw32-clang++ -vを実行したときに出力に"Obfuscator-LLVM"または"heroims"が含まれていることを確認してください。残念ながら、より多くのサポートを必要とする個人を支援する時間はありませんが、私のNimcrypt2リポジトリのこのイシューを読んでみてください。そこでは、数人のユーザーが自分のシステムでそれを行う方法を理解しています。
謝辞とクレジット: