I'm using plink on my win' machine to create a SSH tunnel through my backtrack5 machine (it's based on ubuntu).
what I'm trying to do is to port forward every tcp packet that is sent to the SSH server on the listening port (11111) back to
my local windows machine (on 80 - IIS\HTTP).
from the windows machine I run plink -
plink.exe -v -N -R 11111:localhost:80 email@example.com -P 22 -pw password
I've edit the sshd_config on the SSH server and added "GatewayPorts yes" so I'll be able to bind the port to all interfaces.
after I run the plink this is what I get in my SSH server -
root@bt:~# netstat -anp | grep 11111
tcp 0 0 0.0.0.0:11111 0.0.0.0:* LISTEN 25710/3
when I try to connect to the listening port from my browser (http://10.0.0.8:11111
) I get "Bad Request - Invalid Hostname" (HTTP Error 400. The request hostname is invalid.).
when I browse to http://localhost
I get the IIS homepage.
what can I do to debug it?
BTW - on another machine (centos) I couldn't bind ports to 0.0.0.0, when I add "GatewayPorts yes" to the sshd_config it listens on ::::
ort (and it isn't accepting any connections from outside the machine), nothing I done made it listen on all interfaces, just 127.0.0.1 or "::::".