Schlagwort-Archive: socks

Tunneling HTTP/DNS through SSH – Part 2 – Windows

As a follow-up to my previous post (Tunneling HTTP/DNS through SSH) I will show you how can create a SOCKS proxy with Putty for Windows.

1. You must create a session, enter your hostname or IP address with port and give it a name like „forwarding“:

Create a Profile / Session
Create a Profile / Session

2.  To speed up your tunnel establishment you can enable auto-login for your username, e.g. „root“. This only eliminate username prompt and you must always enter your password.

Enable Auto-Login
Enable Auto-Login

3. Enable compression for your tunnel 😉

Enable compression
Enable compression

4. Then you must add your local source port „D8080“ for Port 8080.

Set local port
Set local port

5. Save your session again and open it!

Save your Session
Save your Session

6. After you entered your password you should see an open port on your host (german windows edition):

Check your local port
Check your local port

7. Thats it!  Now you can change your SOCKS proxy settings to locahost:8080, as described in my previous post.

Tunneling HTTP/DNS through SSH (SOCKS 5)

Tunneling HTTP with SOCKS over SSH

If you stay in a hostel, in China 😉 or any other location where you don’t trust your inet connection, you could use an easy way to secure your traffic. Like me, I use a SSH tunnel to one of my servers. You can open a local port and tunnel your traffic through a SOCKS 5 proxy to your SSH server. Here is an example:

ssh -D 8080 -f -C -q -N username@yourserver

This open the localport 8080 with an encrypted (-C) tunnel (-D 8080 and -N) running in background (-f) without any logs (-q). Now you can add in Firefox or Chrome under the proxy settings SOCKS 5 proxy to localhost:8080.

Tunneling DNS over SOCKS 5

In order to activate DNS tunneling in Firefox, you must change a option in the configuration file. Howto:

1. Open about:config as URL
2. Change network.proxy.socks_remote_dns to TRUE

Tunneling any other network connection through SOCKS

I use the tool tsocks to tunnel other traffic like from apt-get or wget through SOCKS. You only have to edit the /etc/tsocks.conf and add your localhost:8080.  You can use it like this:

tsocks apt-get update

Simple and easy 😉