Pivoting
LigoloNG
https://github.com/Nicocha30/ligolo-ng
Single pivot
Attack host:
add route to new subnet Target: Attack host: select session add listenerslistener_add --addr 0.0.0.0:8080 --to 127.0.0.1:80
listener_add --addr 0.0.0.0:8081 --to 127.0.0.1:81
listener_add --addr 0.0.0.0:8082 --to 127.0.0.1:82
listener_add --addr 0.0.0.0:8083 --to 127.0.0.1:83
listener_add --addr 0.0.0.0:8084 --to 127.0.0.1:84
Double Pivot
Attack host:
sudo ip tuntap add user kali mode tun double ; sudo ip link set double up
sudo ip tuntap add user kali mode tun ligolo ; sudo ip link set ligolo up
listener_add --addr 0.0.0.0:8080 --to 127.0.0.1:80
listener_add --addr 0.0.0.0:8081 --to 127.0.0.1:81
listener_add --addr 0.0.0.0:8082 --to 127.0.0.1:82
listener_add --addr 0.0.0.0:8083 --to 127.0.0.1:83
listener_add --addr 0.0.0.0:8084 --to 127.0.0.1:84
listener_add --addr 0.0.0.0:5050 --to 127.0.0.1:50
listener_add --addr 0.0.0.0:5051 --to 127.0.0.1:51
listener_add --addr 0.0.0.0:5052 --to 127.0.0.1:52
listener_add --addr 0.0.0.0:5053 --to 127.0.0.1:53
listener_add --addr 0.0.0.0:5054 --to 127.0.0.1:54
proxychains (with SOCKS tunnel)
Start with dynamic SSH port forward
Check proxychains configuration Ensure its configured to route over the local forward prependproxychains
or proxychains4
to any command to tunnel the traffic
we can only perform a full TCP connect scan over proxychains. The reason for this is that proxychains cannot understand partial packets. If you send partial packets like half connect scans, it will return incorrect results
sshuttle
https://github.com/sshuttle/sshuttle
specify the option -r
to connect to the remote machine with a username and password. Then we need to include the network or IP we want to route through
iptables
to redirect all traffic to the 172.16.5.0/23 network through the pivot host.
We can now use any tool directly without using proxychains.