Friday 4 October 2013

I'm not hiding from the Feds ... I promise!

... otherwise known as "Setting up PuTTY for use with Tor".

Sometimes, just sometimes, you do have something to hide, and in my case right now it's my IP address. There are times when you just don't want your home IP address being logged on a server somewhere, for someone not so very nice to find. This is the case for me as I am setting up a honeypot, and in case of the worst happening (my instance gets p0wned) I don't want my home IP address littered throughout the logs. So, to get around this I am connecting with PuTTY using a Tor proxy to anonymise my IP address. So before any of you start to think up your witty "Tor isn't really anonymous" comments for the sections below .. let me stop you .. I am not using Tor to completely anonymise my actions, but so that the IP address logged on my honeypot system is not my own .. for my own (paranoid) protection. For more information on Tor and internet privacy, you can see their website.


Using the Tor bundle
A quick and dirty way to use and get Tor up and running quickly is to get yourself the Tor browser bundle package. This package comes complete with standalone versions of Tor, Vidalia and Firefox portable. This is the easiest and the recommended way to get started with using Tor if you are new to it, and if, like me you aren't planning on using the browser all the time, you can make a few quick configuration changes to get started.
To start up Tor you can either choose to open the browser with "Start Tor Browser.exe" or start Validia directly. If you choose to start Validia directly, ensure to set the location of tor.exe in the settings otherwise it will not start.

Vidalia Control Panel

Configuring PuTTY
So that was pretty easy, now all that is needed is to set up PuTTY to use the local Tor proxy to make the connection and test. In the PuTTY configuration, head to Connection > proxy and select "SOCKS 5", set the Proxy hostname to "127.0.0.1", set the Port to "9050" and check Yes to "Do DNS name lookup at proxy end" and you are done.
PuTTY Proxy configuration
If you get the immediate error "Connection is refused" then check the port that the Tor proxy is bound to in the Message Log of Vidalia, and update your configuration in PuTTY. My suggestion is to save the profile as you go along, and now you should now be ready to connect 'anonymised'.
Generating the ppk private key
Except if you are connecting to a service such as EC2 that requires a certificate for authentication. Natively PuTTY doesn't handle the pem file format produced when you create your key pair on EC2. Amazon kindly provides the instructions here to make the conversion so I wont go over them in detail, but in summary, grab PuTTYgen, load your pem file and save it as a ppk file.

Now add the certificate to your PuTTY session profile in Connection > Session > Auth.

Now with everything in place, make your connection and check your hostname to ensure connection with Tor has succeeded.