
Shhhloader는 작업 중인 셸코드 로더입니다. 원시 셸코드를 입력으로 받아 AV/EDR을 우회하기 위해 다양한 작업을 수행하는 C++ 스텁을 컴파일합니다. 포함된 Python 빌더는 Mingw-w64가 설치된 모든 Linux 시스템에서 작동합니다.
1/25/24 업데이트: Shhhloader는 이제 PoolParty 변종 7을 지원합니다! 또한 실행된 셸코드가 백업되지 않은 메모리에 상주하지 않도록 PoolParty와 Module Stomping을 결합하는 옵션이 추가되었습니다. 아래에서 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 Framework에 통합되었습니다. 아래에서 모듈을 보여주는 동영상을 확인하세요:
알려진 문제/참고사항:
-p 플래그를 사용하여 대상 시스템에서 이미 실행 중이라고 알거나 의심되는 프로세스의 이름을 제공해야 합니다.계획된 업데이트:
선택 사항: 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 저장소의 이 이슈를 참고하세요. 몇몇 사용자가 자신의 시스템에서 이를 해결한 방법을 공유했습니다.
감사 및 크레딧: