3

I have a computer with windows 7 under a firewall which can only initiate connections to other computers. It has a proxy server on it (port 9000) and I want to forward it to another machine (192.168.1.1) using netcat.

Suggestions/ideas as to how to do it? My plan was to use something like

1) On the remote machine: nc -l -p 80 -e 'nc -l -p 9000'

2) On the firewalled computer: nc 127.0.0.1 9000 -e 'nc 192.168.1.1 80'

The problem is: it doesnt work. I would love to use putty's ssh2 port forwarding, but it is completely broken and the bug is there since 2003. I doubt it will ever be fixed.

1

TCP tunnel (port forwarding) using Netcat

Here is how to establish a tunnel using netcat to a given host and port.

netcat -L 127.0.0.1:22 -p 8080 -vvv

Listen on port 8080 of the server, and when somebody tries to connect, establish a link with 127.0.0.1:22 (i.e.: SSH server).

netcat -L google.fr:80 -p 25000 -vvv

Listen on port 25000 of the server, and when somebody tries to connect, connect him to Google web server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.