A Quick Overview of Tor

What is Tor? Tor (short for The Onion Router) is a free, BSD-licensed piece of software that enables anonymous communications on the internet, based on the second generation of "onion routing" network protocols: using them makes it much harder to track a user's activity online.


What is Tor?

Tor (short for The Onion Router) is free, BSD-licensed software that enables anonymous communications on the internet, based on the second generation of “onion routing” network protocols: using them makes it much harder to track a user’s activity online. Its purpose is to protect users’ privacy, their freedom, and their ability to hold confidential conversations without being monitored or intercepted.

The Tor Project is an organization that has worked for years to increase anonymity online. It lets its users browse the internet anonymously and protects their identity when they need to access their email or other accounts.

Tor was invented by the “United States Naval Research Laboratory” in the early 2000s, and was released to the public in 2004. The Tor Project started working on it right away to improve the user experience. In 2012, a new free and open-source version of Tor was released.

How does it work?

The principle behind the Tor network is fairly simple: a user who wants to connect to Google (using Tor) establishes an encrypted connection to an “input node” (called a Guard); this node forwards the traffic to a series of internal nodes (called relays), chosen at random when the connection is first set up, and finally the last node (called the Exit node) establishes the final connection with Google.
This process is completely transparent to the user, who — aside from the potential latency caused by routing through a circuit with multiple relays — won’t notice any difference.

In a normal scenario, the user connects directly to the server of the requested service — Google, Facebook, and so on — which therefore knows the exact identity (i.e. the IP address) of the user browsing. When the connection travels through the Tor network, the data passes through several relay nodes, as we just saw, with the goal not only of protecting the user’s identity but also of making sure no outside observer can infer the user’s final destination.

Installing Tor on Ubuntu

In this article we’ll install Tor (CLI) on an Ubuntu system. Tor Browser (more info at torproject.org) is a modified version of Firefox with Tor built right into the browser, but we won’t cover that here.

sudo apt install tor

This command installs Tor on the system along with a couple of dependencies. Once installed, it will start as a daemon on port 9050; you can check the status of the Tor service with:

sudo systemctl status tor

Now that Tor is installed on our system, we’re ready to work.

Using Tor as a proxy

Now we’ll set Tor up as a proxy, first in the browser and then at the system level. These two setups differ a bit: the first configures Tor just for the browser, meaning any connection outside the browser will pass through directly without Tor, while the second works at the system level, so even programs like our terminal will go through Tor.

Configuring Tor in Firefox

To configure Tor in Firefox we need to install Foxyproxy, since it lets us manage proxying much more easily. Open Foxyproxy and add a new proxy by filling in the fields:

Once you’ve saved the profile you’ll find it in the Foxyproxy menu — just click it and your browser will start running through the Tor network!

Configuring Tor as a system proxy (Ubuntu)

Go to Settings > Network and find “Proxy“. Click the gear icon, set it to “Manual“, then enter the Tor port under “SOCKS Host”.

To verify it, open a terminal and try running a couple of curl or wget commands to check your IP address. You can also try wget against “check.torproject.org” — try it without Tor first and you’ll see your real IP.

Disclaimer: be careful, this won’t protect you as well as you might think!

You can run Tor at any level of the system — this is just the fastest method (and not the most secure one). If you’re after a better setup, try adjusting your connections from the terminal instead.

Checking your Tor connectivity

To make sure you’re working through the Tor network, check your IP address using any service, such as whatismyip.com. As mentioned, the Tor Project offers a dedicated service to check Tor connectivity on their website: https://check.torproject.org/.


Conclusions

In this article we quickly covered the history of Tor and how it’s used, how it works with guards, relays and exit nodes, and how to install and use it on a Linux system, both as a browser and as a system-wide proxy.

N.B. Your connection is anonymous, not end-to-end encrypted! Keep that in mind. Tor wraps your traffic in encrypted layers while carrying it through the Tor network. Use a VPN together with the Tor network to increase your anonymity online.

Stay safe!