Using Tor and Privoxy on Kali / Debian / Backtrack Linux

To Anonymize Internet Surfing or Open Blocked Websites

Table of Contents

Background

The powers-that-be recently blocked websites like HackThisSite on the network that I use, categorizing them as “Hacking”. While their intentions might be good, I like to visit CTF websites for solving challenges. Besides, a simple keyword-based block on URLs containing the term “hacking” is pretty archaic.

I decided to try a proxy website (which is not always reliable since admins will block access to proxies as well). As I suspected, it was blocked under ‘Proxy Avoidance’.

Setting up TOR and Privoxy

Set up the onion router to get around this. First, you need to install it on your box using the following command: apt-get install tor privoxy. This will install 2 separate packages ‘Tor’ and ‘Privoxy’. Tor will host a proxy server on your machine on port 9050 of type ‘Socks5’. Privoxy will host a proxy service on your machine on port 8118 of type ‘HTTP’.

Next, install the GUI for tor called ‘vidalia’: apt-get install vidalia polipo. Now, edit the Privoxy configuration file: vi /etc/privoxy/config. Add this line at the bottom of this file: forward-socks4a / localhost:9050. Save and close the file. This will tell privoxy to forward Socks traffic to the Service running on port 9050 on your localhost (this service is Tor)

Time to fire up Tor and privoxy services:

/etc/init.d/tor start
/etc/init.d/privoxy start 

Next, go to Application -> Internet -> Vidalia

Check that it says ‘connected to tor network’

You can click on ‘view the network’ to see all the relays that you are passing through.

Next, the browser can be set up to use the onion routing:

Proxy IP - '127.0.0.1'
Proxy port - 9050
Type - Socks5

Note: If you are using the FireFox or Iceweasel browser, you can use the ‘AutoProxy’ add-on to set this up. Also, in this specific example, we haven’t routed any traffic through Privoxy but that can be configured as needed within the browser.

Result

Reload the website that was blocked earlier, if everything is setup correctly, you should now be tunneled through the onion router and have access to the website.

Rejoice, for all your browsing is now anonymous since you are connected through the onion router!

Pranshu Bajpai
Pranshu Bajpai
Principal Security Architect

Pranshu Bajpai, PhD, is a principle security architect..