Navigating anonimized on the web with Tor and Privoxy on a Kali Linux 20

Andre Godinho
5 min readOct 29, 2020

Would you like to navigate online without having your real IP logged? Do you want some privacy while browsing the internet? Then this article may help you on any Linux.

So, what will we be talking about? A quick glossary:

Kali — Kali Linux is a Debian-derived Linux distribution designed for digital forensics and penetration testing. Kali Linux has over 600 preinstalled penetration-testing programs, including Armitage (a graphical cyber attack management tool), Nmap (a port scanner), Wireshark (a packet analyzer), John the Ripper (a password cracker), Aircrack-ng (a software suite for penetration-testing wireless LANs), Burp suite and OWASP ZAP web application security scanners.
It was developed by Mati Aharoni and Devon Kearns of Offensive Security.
Virtual Machine — In computing, a virtual machine (VM) is an emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hardware, software, or a combination.
Tor — Tor is a free and open-source software for enabling anonymous communication. Tor directs Internet traffic through a free, worldwide, volunteer overlay network consisting of more than seven thousand relays to conceal a user’s location and usage from anyone conducting network surveillance or traffic analysis. Using Tor makes it more difficult to trace Internet activity to the user: this includes “visits to Web sites, online posts, instant messages, and other communication forms”. Tor’s intended use is to protect the personal privacy of its users, as well as their freedom and ability to conduct confidential communication by keeping their Internet activities unmonitored.
Privoxy — Privoxy is a free non-caching web proxy with filtering capabilities for enhancing privacy, manipulating cookies and modifying web page data and HTTP headers before the page is rendered by the browser. Privoxy is a “privacy enhancing proxy”, filtering web pages and removing advertisements. Privoxy can be customized by users, for both stand-alone systems and multi-user networks. Privoxy can be chained to other proxies and is frequently used in combination with Squid among others and can be used to bypass Internet censorship.

And what do I need? Requirements:

Kali — I’ll be using Kali. Any version is fine, but try to stick to recent and newer versions.
Download Link: https://www.kali.org/downloads/
Virtualbox — I use VirtualBox, but like I usually say in my articles, you can use any alternative you want, like VMWare.
Download Link: https://www.virtualbox.org/wiki/Downloads

Step 1: Downloading and installing Tor and Privoxy

For you to be at this step, I’m sure you’ve already got your VirtualBox running a Kali virtual machine (or any Linux Distro, but for this, I prefer Kali). I also hope you’ve got the habit of updating your fresh machines. If you don’t, just run sudo apt-get update and then sudo apt-get upgrade.
So anyways, here’s our first step which is downloading Tor and Privoxy, as well as installing it. Just run the following command:

sudo apt-get install tor privoxy

Step 2: Configuring Privoxy

Next up, we just need to configure our Privoxy, so just access the configuration file by writing:

sudo nano /etc/privoxy/config

Welcome to the privoxy configuration file, now we need to make our forward-sock use our localhost on a specific port(127.0.0.1:9050). You can write it anywhere that’s not commented, usually this command has a specific section, but it doesn’t really matter, just write at the end of the file:

forward-socks5 / 127.0.0.1:9050 .

Step 3: Starting Tor and Privoxy services

With our privoxy set up, just start the services by running the following commands:

sudo service tor start
sudo service privoxy start

Step 4: Configuring Firefox to use our new proxy

Now with everything running, we gotta make our Firefox (or any browser you’d like, but these come with Firefox) use our privoxy settings. So just open up your browser (Firefox in this case) and look for the Preferences:

Now, we gotta look for the Proxy settings. It’ll be in the Network Settings somewhere, so I recommend just writing proxy in the search bar:

Insert your localhost IP (127.0.0.1) into the HTTP Proxy section and the Socks Host section. Then write the port 8118 into the HTTP Proxy section, and 9050 into the port section of the Socks Host and set it to SOCKS v5.

Note: If you run into issues in this step, try putting 8181 as the HTTP Proxy Port. For some reason, this can sometimes be an issue (hence why I have it as 8118, because 8181 didn’t work for me).

Step 5: Final confirmation and how to check if it’s working

Now, everything should be running properly. Open up https://check.torproject.org and the page should look like the following image along with a random IP:

And you’re all set! Congratulations! Everything is running properly if it looks like the previous image. Have fun being relatively anonimized on the web!

Sources:

--

--

Andre Godinho

Nerd at all things IT. Studies Cybersecurity but soon Computer Engineering. Loves dogs with a passion