Archive

Posts Tagged ‘ssh’

Bypass a firewall Part II – Secure Tunnel through the firewall

05:40 PM No comments
*WOW* – the resonse to my last article is overwhelming! The article is just a week old, but my mailbox is already full of emails asking me, if there is a way to use SOCKS over a secure connection like SSH.
To prevent my mailbox from several hundrets of further emails: YES THERE IS A WAY!

Building a SOCKS Proxy over SSH

All you need to realize a SOCKS5 tunnel over SSH is an openSSH on your “SOCKS-Server” and the already used “Proxifier”, as well as PuTTY on Windows-based systems.

First of all, you need to build up the secure tunnel (type the command into your OS X console):

ssh -2 -N -D 8080 user@<ip of your SOCKS5-Host>

for example:

ssh -2 -N -D 8080 myuser@192.168.1.11

On Windows, the configuration of PuTTY is the following:

Add the Hostname (for example: 192.168.1.11 – you need to add your SSH/SOCKS-Server IP there) under Tab “Sessions”
Then go to Tab “Tunnels” and enter Source Port 8080
Select “Dynamic” from the Destination Port
Click Open to buildup the tunnel

Now start the Proxifier and add the following Setting:

Proxifier Setting for SSH SOCKS tunnel

I find it usefull (but it is not neccessary) to add a rule to the Proxification Rules:

Proxification Rules for ssh tunnel

That’s all: openSSH has an integrated SOCKS-Proxy. Proxifier sends all traffic through the SSH-Tunnel (which is encrypted) and the SOCKS-proxy in openSSH on the other side sends the traffic to the destination hosts and returns incomming traffic to you.

Post to Twitter Tweet This Post