Safe file sharing with OnionShare

Share and Share Alike

In order to make the file on my laptop public, I would need to forward traffic from my broadband router to the correct port (TCP port 9050) on my laptop and then fine tune my local firewall to allow inbound access. Instead, I'll use a local Tor Browser installation to simulate the user experience from outside my local network.

The main benefits of using Tor Browser are two-fold. First, the Internet provider that you use (and indeed anybody eavesdropping on the local network) will have DNS lookups hidden from them, along with the traffic you send and receive.

Second, any person or business running an online service will not see your Internet provider's IP Address and will instead just see a connection from the Tor network. That means you should be completely anonymous, unless you identify yourself to an online service by logging in.

Tor Browser also does an excellent job of circumventing eavesdropping technology and prevents what is known as fingerprinting. Having a standard browser configuration across all users means that your online ID is far less identifiable. You might be surprised what using other browsers will reveal about you: hardware architecture, browser version, configurations, and other details that could potentially be useful to an attacker.

Tor Browser also deletes all browsing history automatically. Cookies are dropped too after each session and deleted after the browser is closed or the New Identity functionality is requested.

Accessing the Link

See the box entitled "Tor Browser Launcher" for some notes on Tor Browser launcher. Once my configuration is up and running, I can use it to visit that lengthy .onion URL I created for file-sharing. You'll need to enter the private key (Figure 6).

Tor Browser Launcher

The Tor Browser launcher is intended to make Tor Browser easier to install and use on Linux systems. I had mixed results with installing via the Tor Browser launcher. I couldn't find a friendly mirror to download the package (I could have gone to the Tor website but wanted to see if I could install it through an apt package).

Instead, I opted to install it as a Flatpak. If you don't have Flatpak installed on your system, you'll need to install it before you can try this approach. Once you're set up for Flatpak, install the Tor Browser launcher with:

$ flatpak install flathub com.github.micahflee.torbrowser-launcher -y

The process took about 10 minutes for me. Once the installation is complete, you can use the Super keyboard key to search for the installed Tor Browser package. You might see two purple Tor icons – just click the one that doesn't mention the launcher, and you should see a quick installation following a much more rapid download.

After you start Tor Browser, you should navigate to the menu on the far right side at the top, scroll down, and click Help. From there, click About Tor Browser, which should install any updates automatically.

This installation route for the Tor Browser used quite a lot of disk space, but Tor Browser is such an excellent addition to your online security that the space is well worth it.

Figure 6: I need a private key to see the shared file.

After I enter the private key, I see that onions.txt is waiting for download (Figure 7).

Figure 7: I have uber-secure access to the shared files.

Success! I can now use OnionShare to fire up a local web server and share files with the highest levels of anonymity.

More, More, More

Hosting a website with OnionShare is similar to file sharing. As you can see in Figure 8, the first step is to add a file. Listing 1 shows a simple HTML file I created called index.html.

Listing 1

Simple HTML File

<HTML>
<BODY>
<CENTER><H1>Secret Website</H1></CENTER>
</BODY>
</HTML>
Figure 8: Adding a file to host.

Figure 9 shows some of the options available for hosting web pages in OnionShare. Advanced settings include the ability to schedule the website availability for specific times of the day.

Figure 9: Web-hosting options.

Clicking the big, green Start sharing button brings you to the view you see in Figure 10, which, you will notice, is very similar to Figure 4.

Figure 10: A familiar-looking sharing screen, this time for website hosting.

The secret key is the same format as before, and when I visit the specified URL and paste the key into Tor Browser, I get the HTML page defined in Listing 1 (Figure 11).

Figure 11: The HTML file from Listing 1 after pasting the secret key into the Tor Browser.

OnionShare also provides an option for anonymous chat. Figure 12 shows the chat service running in my Tor Browser.

Figure 12: The chat functionality looks impressive.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Anonymous File Sharing with OnionShare

    OnionShare lets you share files without revealing IP addresses or domain names. The latest version also allows uploads.

  • Mofo Linux

    Mofo Linux enables secure digital communications, even in places where it is politically or ideologically unwelcome.

  • Subgraph OS

    Kid-tested and Snowden approved – is Subgraph, the privacy-oriented OS, now ready for humans?

  • This Month's DVD

    Parrot OS 4.11 and Fedora Workstation 35

  • MOFO Linux

    Controls, surveillance, and censorship are increasing rapidly on the Internet. MOFO Linux lets you anonymize your communication on the web with an easy-to-use live system.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News