Anonymous surfing with Privoxy and Tor

Good Day my dear Linux Yogi’s,

in today’s illustration I am going to show you how you can set up a Proxy-chain to surf more anonymous in the Internet. I said more anonymous because I don’t believe that there is a  100% solution to totally stay anonymous on the Internet. If you read this article and believe that we can add even more security and anonymity to this solution please feel free and comment on this blog post or use the contact form to suggest addition to this blog.

So Privoxy is a Proxy Server that will remove advertisements and Tor is a Proxy Server that routes you anonymously through the Tor network to the Internet.

Open up a Terminal windows and elevate your console.

sudo -s

enter your password and now we are root. Before we install anything lets make sure we are up to date with our current system installation. You should always make sure before you install something new that you are on the latest update. Enter the following lines:

apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get autoremove

now that we are updates lets install the Privoxy and tor package to our system.

apt-get install privoxy tor

after the installation is finished we need to make a few adjustments to our Privoxy configuration file. Lets open up /etc/privoxy/config with you desired editor and uncomment the lines that start with forward-socks and forward  and match them like the following lines:

forward-socks4a    /    127.0.0.1:9050    .
forward-socks4     /    127.0.0.1:9050    .
forward-socks5t    /    127.0.0.1:9050    .
forward-socks5     /    127.0.0.1:9050    .

forward    192.168.*.*/  .
forward    10.*.*.*/     .
forward    127.*.*.*/    .

So what we are doing here is to loop through all our requests to the Tor proxy which by default is listening to port 9050 and also exclude requests that go to 192.168.*.*, 10.*.*.* and 127.*.*.* from going through the Tor Proxy since to does not route those network addresses.

The Privoxy Proxy Server is by default listening on port 8118 which we will use to configure our proxy setting on our local system. This current configuration only allows the local machine to use this proxy which probably is good for most of use but if you plan on using this proxy chain on your network for others to use we need to make another change in this Privoxy configuration file. Look for section 4.1 in the Privoxy configuration file and you should see the following line:

listen-address  localhost:8118

lets adjust this line to the servers static IP address like this:

listen-address  192.168.10.22:8118

this now allows the server to listen on his static IP address for request on port 8118 and before it was only listening on its own loopback ethernet adapter.

Ok next we should make a couple of changes in  Firefox is you use Firefox. Start up your Firefox browser and in the URL field enter:

about:config
about:config
about:config

now enter the following into the search field:

media.peerconnection.enabled
media.peerconnection.enabled
media.peerconnection.enabled

and then below in the preferences field do a double click on this option in order to change it from false to the value true. Next go back to the search field and enter:

network.proxy.socks_remote_dns
network.proxy.socks_remote_dns
network.proxy.socks_remote_dns

and again double click it to change the value from false to true. That is it can close the browser for now. The last thing we need to do is the tell our system about the proxy server.

Click on the Gear icon

 

 

to go to System Settings.

System Settings
System Settings

Now in the system settings window click on the Network Icon and you see the following.

Network settings
Network settings

Next click on the Network Proxy option

Proxy Settings
Proxy Settings

Click on the the Method drop down list and select Manual and fill out the field like it is showing in the screenshot unless you are on a remote machine in your network then you need to change 127.0.0.1 to the IP address of your Proxy Server that we just set up. Now you can close this and your system is using your proxy chain. All browsers are set by default to use system settings for the proxy configuration.

The last thing we should do it to verify that our proxy is actually working and the we use the Tor network. Open up your browser and go to the following URL:

https://check.torproject.org

and if everything is working the way it should you should see something similar like the following.

going through Tor Proxy
going through Tor Proxy

and if it is not going through the Tor proxy it shows you something similar to the following.

Not going through Tor Proxy
Not going through Tor Proxy

Ok my fellow Linux Yogi’s this concludes this illustration. I hope you enjoyed this article. Please subscribe to this blog to support my work and consider to register to the forum to spark some conversation regarding issues you may encounter on your journey during the Linux universe.

Until next time, Namaste my friends! 😉