Using Tor Browser and TorBox together

Wouldn’t it great to combine the use of Tor Browser and TorBox? Tor Browser prevents fingerprinting,  isolates each website, clears any cookies, and browsing history. However, TorBox routes not only your Web traffic but all your data through the Tor network. It also mitigates a possible weak point of the Tor Browser. If an application from the Internet manages to break out of the browser’s containment, IP leakage is still prevented by the TorBox (see, e.g., Tor Browser Deanonymization With SMB). This combination works fine, but since the Tor Browser launches its own Tor instance on the client device, we have a “Tor over Tor” scenario. This means that Tor Box sends Tor browser’s data packages over the Tor network to a Tor entry guard, where they are retransmitted through the Tor network. Such a data package would not only pass through three Tor hops but six. While we believe this has no negative impact on security and anonymity, it would be more beneficial, at least for speed and efficiency, if the Tor Browser didn’t launch another Tor instance on the client machine. In this article, we’ll show you how to achieve this.

Basics for all operating systems

The three fundamental steps to use Tor Browser without an own Tor instance on the client machine is for all operating systems the same:

  1. Download the latest version of the Tor Browser and install it — preferably without changing the standard settings regarding the installation location.
  2. Next, environment variables must be temporarily set to tell the Tor Browser not to load a Tor instance.
  3. Make a backup of the file prefs.js and put the file user.js in the profile directory to ensure that the correct variables are passed to the Tor Browser so that the browser is usable even if there is no own Tor instance available. The variables tell the Tor Browser that it should use the TorBox Socks5 as a proxy. The variables in the user.js will be integrated into prefs.js. This means that you need to backup prefs.js if you changed something with “about:config”, which you want to have restored.
  4. Start the Tor Browsers.

To restore the original behavior of the Tor Browser with its own Tor instance, do the following:

  1. Close the Tor Browser.
  2. Delete the files user.js and prefs.js, which will be regenerated automatically with the next start of the Tor Browser. If you changed something with “about:config”, which you want to have restored, then you have to copy back your old prefs.js.
  3. Regarding the environment variables: no action is necessary because we changed them solely temporary.
  4. Start the Tor Browsers.

What’s in the user.js?

user_pref("extensions.torbutton.use_privoxy", false);
user_pref("extensions.torbutton.settings_method", "custom");
user_pref("extensions.torbutton.socks_host", "192.168.42.1");
user_pref("extensions.torbutton.socks_port", 9050);
user_pref("network.proxy.socks", "192.168.42.1");
user_pref("network.proxy.socks_port", 9050);
user_pref("extensions.torbutton.custom.socks_host", "192.168.42.1");
user_pref("extensions.torbutton.custom.socks_port", 9050);
user_pref("extensions.torlauncher.control_host", "192.168.42.1");
user_pref("extensions.torlauncher.control_port", 9051);
Implementation with macOS

Manually: Tor Browser with TorBox

  1. Download the latest version of the Tor Browser and install it — the default installation directory of the Tor Browser is the application folder; the default profile-directory is somewhere in “~/Library/Application\ Support/TorBrowser-Data/Browser/” and have the extension .default
  2. Open a terminal (in the folder Applications / Utilities the program “Terminal”) and execute the following commands:
    export TOR_NO_DISPLAY_NETWORK_SETTINGS=1
    export TOR_SKIP_CONTROLPORTTEST=1
    export TOR_SKIP_LAUNCH=1
    
    We continue to work in that terminal. Don’t close it yet!
  3. In the same terminal, copy user.js into the profile directory:
    # This gives the name of your profile directory (for example: i4u3pkk9.default -- you have to replace that string with your own):
    grep "^Path" ~/Library/Application\ Support/TorBrowser-Data/Browser/profiles.ini | cut -c6-   
    
    # Backup of prefs.js:
    cp ~/Library/Application\ Support/TorBrowser-Data/Browser/i4u3pkk9.default/prefs.js /Library/Application\ Support/TorBrowser-Data/Browser/i4u3pkk9.default/prefs.bak
    
    # Place the user.js in the profile directory:
    curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user.js --output ~/Library/Application\ Support/TorBrowser-Data/Browser/i4u3pkk9.default/user.js
    
  4. In the same terminal, start the Tor Browser:
    /Applications/Tor\ Browser.app/Contents/MacOS/firefox
    

Manually: Restore – Tor Browser without TorBox

  1. Close the Tor Browser
  2. Open a terminal (it is in Applications / Utilities) and execute the following commands:
    # This restores your old prefs.js (don't forget to replace "i4u3pkk9.default" by your own):
    cp ~/Library/Application\ Support/TorBrowser-Data/Browser/i4u3pkk9.default/prefs.bak /Library/Application\ Support/TorBrowser-Data/Browser/i4u3pkk9.default/prefs.js  
    
    # Delete user.js:
    rm ~/Library/Application\ Support/TorBrowser-Data/Browser/i4u3pkk9.default/user.js
    
  3. Close the terminal — this will delete the environmental variables.
  4. Start the Tor Browser

Using a shell script
We have created a shell script, which makes the process described above much easier:

  1. Download the shell script “start_tor_browser_on_macos.sh” from this link (right-click the link and press “save as” or something similar).
  2. Open a terminal, go to the directory where you downloaded the shell script and write the following command to make it executable:
     chmod u+x start_tor_browser_on_macos.sh 
  3. Right-click the file “start_tor_browser_on_macos.sh” and chose “Open with…”, “Other…” and switch from “Recommended applications” to “All applications”
  4. Then chose the program “Terminal” in the folder “utilities” and activate “Always open with”.
  5. Press open, and an error message appears that the program cannot be started because it is not signed. Press ok.
  6. Again right-click the file “start_tor_browser_on_macos.sh” click on “Open”. The warning message appears again, but this time with an “Open”-Button. Click on that button.
  7. Now the Tor Browser starts without its own Tor instance. If you want to restore the original behavior of the Tor Browser with its own Tor instance, you have first to close the Tor Browser, and after that, press a key in the still open script window.
  8. From now on, you have only to double-click the file “start_tor_browser_on_macos.sh” and it starts immediately.
Tor Browser is running under macOS without its own Tor instance on a TorBox client device. It was started by the script “start_tor_browser_on_macos.sh”.
Implementation with Linux

Manually: Tor Browser with TorBox

  1. Download the latest version of the Tor Browser and unpack it. The default installation directory is the “tor-browser_xx-XX” directory where you unpacked the .tar.xz file (e.g., ~/Desktop/tor-browser_en-US/); the default profile-directory is in the default installation directory under “Browser/TorBrowser/Data/Browser/profile.default/”.
  2. Open a terminal, go to the default installation directory and execute the following commands:
    export TOR_NO_DISPLAY_NETWORK_SETTINGS=1
    export TOR_SKIP_CONTROLPORTTEST=1
    export TOR_SKIP_LAUNCH=1
    
    We continue to work in that terminal. Don’t close it yet!
  3. In the same terminal, copy user.js into the default profile-directory:
    # Backup of prefs.js: 
    cp Browser/TorBrowser/Data/Browser/profile.default/prefs.js Browser/TorBrowser/Data/Browser/profile.default/prefs.bak 
    
    # Place the user.js in the profile directory: 
    curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user.js --output Browser/TorBrowser/Data/Browser/profile.default/user.js
    
  4. In the same terminal, start the Tor Browser:
    ./Browser/start-tor-browser --detach
    

Manually: Restore – Tor Browser without TorBox

  1. Close the Tor Browser
  2. Open a terminal, go to the default installation directory and execute the following commands:
    # This restores your old prefs.js: 
    cp Browser/TorBrowser/Data/Browser/profile.default/prefs.bak Browser/TorBrowser/Data/Browser/profile.default/prefs.js 
    
    # Delete user.js:
    rm Browser/TorBrowser/Data/Browser/profile.default/user.js 
    
  3. Close the terminal — this will delete the environmental variables.
  4. Start the Tor Browser

Using a shell script
We have created a shell script, which makes the process described above much easier:

  1. Download the shell script “start_tor_browser_on_linux.sh” from this link (right-click the link and press “save as” or something similar) and put it into the default installation directory (e.g., ~/Desktop/tor-browser_en-US/).
  2. Open a terminal, go to the default installation directory, make “start_tor_browser_on_linux.sh” executable and start it:
    chmod u+x start_tor_browser_on_linux.sh 
    ./start_tor_browser_on_linux.sh
    
  3. Now the Tor Browser starts without its own Tor instance. If you want to restore the original behavior of the Tor Browser with its own Tor instance, you have first to close the Tor Browser, and after that, press a key in the still open script window.
Implementation with Windows 10 (2018 or newer)

Manually: Tor Browser with TorBox

  1. Download the latest version of the Tor Browser and install it. The default installation directory is the folder “Tor Browser” on the Desktop (e.g., ~\Desktop\Tor Browser\); the default profile-directory is in the default installation directory under “Browser\TorBrowser\Data\Browser\profile.default\”.
  2. Open a terminal, go to the default installation directory and execute the following commands:
    set TOR_NO_DISPLAY_NETWORK_SETTINGS=1
    set TOR_SKIP_CONTROLPORTTEST=1
    set TOR_SKIP_LAUNCH=1
    
    We continue to work in that terminal. Don’t close it yet!
  3. In the same terminal, copy user.js into the default profile-directory:
    # Backup of prefs.js:
    copy Browser\TorBrowser\Data\Browser\profile.default\prefs.js Browser\TorBrowser\Data\Browser\profile.default\prefs.bak
    
    # Place the user.js in the profile directory:
    curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user.js --output Browser\TorBrowser\Data\Browser\profile.default\user.js
    
  4. In the same terminal, start the Tor Browser:
    "Start Tor Browser.lnk" --detach
    

Manually: Restore – Tor Browser without TorBox

  1. Close the Tor Browser
  2. Open a terminal, go to the default installation directory and execute the following commands:
    # This restores your old prefs.js:
    copy Browser\TorBrowser\Data\Browser\profile.default\prefs.bak Browser\TorBrowser\Data\Browser\profile.default\prefs.js
    
    # Delete user.js:
    del Browser\TorBrowser\Data\Browser\profile.default\user.js
    
  3. Close the terminal — this will delete the environmental variables.
  4. Start the Tor Browser

Using a batch file
We have created a batch file, which makes the process described above much easier:

  1. Download the batch file “start_tor_browser_on_windows.bat” from this link (right-click the link and press “save as” or something similar) and put it into the default installation directory (e.g., ~\Desktop\Tor Browser\).
  2. Open a terminal, go to the default installation directory, and execute “start_tor_browser_on_windows.bat”.
  3. Now the Tor Browser starts without its own Tor instance. If you want to restore the original behavior of the Tor Browser with its own Tor instance, you have first to close the Tor Browser, and after that, press a key in the still open script window.
It doesn’t work, and I’m lost 😟

Don’t give up! Contact us and describe in detail what you already tried — we will try to help you.