Firewall Tunneling Using SSH and Putty

September 17, 2015 | Views: 13603

Begin Learning Cyber Security for FREE Now!

FREE REGISTRATIONAlready a Member Login Here

SSH (Secure Shell) is a protocol that allows two devices exchange data with each other security in an encrypted format, hence protecting the data being transmitted. It usually uses Port 22 for all communications. For example, if you were to connect to a remote server, then there’s no guarantee that your username and password would be transmitted in secure encrypted format.

This is where SSH comes in. It protects your sensitive information like your username and password by encrypting it and securely and transmitting it on the Internet.

Putty is a free, open source client that allow users to establish connection using SSH , Telnet and other network protocols with remote systems. It can be downloaded free for coast from http://www.putty.org. Putty is also available as a portable application that you can run from your USB pendrive. The portable version can be download from this address http://www.portableapps.com.

Let’s assume that you’re connected to the Internet and are behind the firewall of your college or company that doesn’t allow you to make outgoing connections to remote port 80 ( HTTP or websites) of a particular website (i.e. Facebook). However, you really want to connect to Facebook.

What do you need to do? Just because the Firewall has blocked access to remote port 22, it doesn’t mean that it would have also blocked outgoing connection to remote port 22 (SSH). This means that you may able to use Putty to create a SSH tunnel connection tunneling through the firewall (outgoing remote port 22) to a remote server to which you have access and then use that remote SSH to connect to the blocked Remote System.

This can be done in 3 steps:

STEP 1: You need to either set up your own SSH server with unblocked Internet access or register an account on a SSH server that has unblocked access to the Internet. This SSH server can be in any part of the world.

STEP 2: Use Putty to create an encrypted SSH connection to the remote SSH server. (Outgoing Port 22, encrypted communication will be allowed by most locals firewalls ). Putty opens a local port that you can now connect to in order to access the remote SSH server.

STEP 3: Once you have connected to the remote SSH server that has unblocked access to the Internet, you can then use it to access all your favorite blocked websites on the Internet.


Now that we know the broad steps that are involved in SSH tunneling, let’s get down to the specifics. Let’s assume that your firewall has blocked outgoing connections to remote port 25 and 80 and you want to use Putty and SSH to bypass this blocking mechanism and access the remote systems.

This can be done in 4 steps:

STEP 1: Download Putty and click on Session. In the Hostname field, enter the IP address of the SSH server that you want to connect to. In the Port field: 22.

STEP 2: Click on Connection >SSH>Tunnels and enter the IP addresses and port numbers of the Remote blocked Systems you wish to tunnel to. For example, I entered 110 in the source port field & 192.168.1.110:110 in the Destination field then clicked on Add. Repeat this for all blocked systems and ports you which to tunnel to.

STEP 3: Based on this configuration, now the local port 80 on your system will connect to Port 80 on your system will connect to port 80 on 192.168.0.1 (using SSH connection to SSH server) and the local port 25 will connect to port 25 192.168.0.22 (using SSH connection to SSH server) and so on. It’s as simple as that.

STEP 4: Now click on the OPEN button and you will be prompted to enter SSH server username and password. You would have received it when you created on account on the remote SSH server. Putty now starts to listen to Port 80 and port 110 on the local system. Now in order to access the port 80 on 192.168.0.1, you need to start your browser or any other tool and simply type localhost : 80 or localhost : 110 and press enter.

Now, your SSH tunneling is done.

 

My Regards,

Jeff Hega

Share with Friends
FacebookTwitterLinkedInEmail
Use Cybytes and
Tip the Author!
Join
Share with Friends
FacebookTwitterLinkedInEmail
Ready to share your knowledge and expertise?
7 Comments
  1. Its not a bad idea, but a thought or too especially in the areas of browsers, VPN, DNS, and WebRTC leakage. If this setup is run is it truly full tunnel to the SSH server; can I still have problems with WebRTC for example in most major browsers? Can this be tested through ipleak.net after establishing a connection?

  2. any tip on how to let remote desktop on server2008 work exactly like server2003?

Page 2 of 2«12
Comment on This

You must be logged in to post a comment.

Our Revolution

We believe Cyber Security training should be free, for everyone, FOREVER. Everyone, everywhere, deserves the OPPORTUNITY to learn, begin and grow a career in this fascinating field. Therefore, Cybrary is a free community where people, companies and training come together to give everyone the ability to collaborate in an open source way that is revolutionizing the cyber security educational experience.

Support Cybrary

Donate Here to Get This Month's Donor Badge

 

We recommend always using caution when following any link

Are you sure you want to continue?

Continue
Cancel