Thursday, April 22, 2010

SSH Tunneling

Using a machine as a pivot/proxy, we need to make an unrouteable remote machine's service routeable. Following example tunnels port 445.

My IP: 192.168.10.88
Machine 1: 192.168.11.72 //We have access to this machine. Has route to machine 2
Machine 2: 10.2.2.50 //Unrouteable from my local machine

On Machine 1, create the tunnel to map remote TCP port 445 to my machine's local TCP port 445.
$ssh -l [local_username] -R [local_port]:[remote_ip]:[remote_port] [local_ip]
$ssh -l liuser -R 445:10.2.2.50:445 192.168.10.88

Confirm with netstat -nat for listening port.

Commonly used for exploiting unrouteable services.

No comments:

Post a Comment