Pivoting

Setting up proxychains with metasploit

  1. Use use post/multi/manage/autoroute module in Metasploit (make sure meterpreter is backgrounded) to create routing of the traffic through the session ID of the compromised machine

  2. In the autoroute module, set SESSION, SUBNET (The subnet your machine cant see but the other machine can), and NETMASK then run the module

  3. After the module completes, use auxiliary/server/socks4a module to create a proxy server in Metasploit

  4. Set SRVHOST (your IP) and SRVPORT (any port number) then run the module

  5. After the socks4a server started, open the terminal and edit /etc/proxychains.conf by adding a line socks4 127.0.0.1 <portnumber>

  6. Now you can run any command in the terminal through the meterpreter session by adding proxychains word in front of the command, e.g., proxychains nmap -A -T4 <ip>

References

The best overview of double pivoting I have read
A great resource ^

Last updated

Was this helpful?