Using Tor Browser and TorBox together

IPMORTANT 🚨: Since version 12 the Tor Browser has a reliable auto-connection feature, which automatically activates bridges when used from a client behind the TorBox. This solution works very well and is very secure. 🔐 ✔︎ Therefore the points mentioned below are not necessary anymore, but not removed because of informational purposes.

• • •

In late 2021, tor relays started to block tor over tor traffic because it can harm the Tor network. This situation is logged accordingly in the tor log file on the TorBox:

Not attempting connection to [scrubbed]:80 because the network would reject it. Are you trying to send Tor traffic over Tor? This traffic can be harmful to the Tor network. If you really need it, try using a bridge as a workaround.

There are three possibilities to deal with that situation:

  • Using bridges in the Tor Browser: This will not prevent a “tor over tor” scenario but hide the fact that you already use tor from the tor network.

  • Using the Mullvad browser instead of the Tor Browser: The Mullvad Browser is built on the same principles and with similar safety levels as the Tor Browser, but without an integrated tor client (see also the TorProject announced). In short: the Mullvad Browser is Tor Browser without the Tor Network. With this combination, you route all client network traffic through tor without having a “tor over tor” situation and use a safe Browser.

    Important: You can only access .onion addresses with Mullvad browser if the browser is configured to use the SOCKS5 of TorBox (see image on the right): Under about:preferences, scroll down to the bottom and click under “Network Settings” on “Settings…”, choose “Manual proxy configuration”, and under “SOCKS Host” enter following IP: 192.168.42.1 / Port: 9050 (wlan) or IP: 192.168.43.1 / Port: 9050 (cable). Toggle on “Proxy DNS when using SOCKS v5”. For more information, see here.

  • Prevent the start of Tor Browser’s tor client and use TorBox’s SOCKS5 functionality. This possibility is explained in more detail below.
    IPMORTANT 🚨: Since version 12 of the Tor Browser and the availability of the Mullvad Browser this is not anymore a recommended solution!

• • •

Basics for all operating systems

The 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. Depending on whether the client is connected to the TorBox wirelessly via the TorBox AP or with a cable, the user.js or user_cable.js file must be used, which must be unnamed to user.js.
  4. 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.
  5. 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);

What’s in the user_cable.js (has to be renamed as user.js before used)?

user_pref("extensions.torbutton.use_privoxy", false);
user_pref("extensions.torbutton.settings_method", "custom");
user_pref("extensions.torbutton.socks_host", "192.168.43.1");
user_pref("extensions.torbutton.socks_port", 9050);
user_pref("network.proxy.socks", "192.168.43.1");
user_pref("network.proxy.socks_port", 9050);
user_pref("extensions.torbutton.custom.socks_host", "192.168.43.1");
user_pref("extensions.torbutton.custom.socks_port", 9050);
user_pref("extensions.torlauncher.control_host", "192.168.43.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!

  1. 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
# For clients connected to the TorBox wirelessly via the TorBox AP:
curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user.js --output ~/Library/Application\ Support/TorBrowser-Data/Browser/i4u3pkk9.default/user.js
# For clients connected to the TorBox with a cable:
curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user_cable.js --output ~/Library/Application\ Support/TorBrowser-Data/Browser/i4u3pkk9.default/user.js

  1. 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

  1. Close the terminal — this will delete the environmental variables.
  2. 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” for clients connected to the TorBox wirelessly or “start_tor_browser_on_macos_cable.sh” for clients connected to the TorBox with a cable (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

or

chmod u+x start_tor_browser_on_macos_cable.sh

  1. Right-click the file “start_tor_browser_on_macos.sh” or “start_tor_browser_on_macos_cable.sh” and chose “Open with…”, “Other…” and switch from “Recommended applications” to “All applications”.
  2. Then chose the program “Terminal” in the folder “utilities” and activate “Always open with”.
  3. Press open, and an error message appears that the program cannot be started because it is not signed. Press ok.
  4. Again right-click the file “start_tor_browser_on_macos.sh” or “start_tor_browser_on_macos_cable.sh” click on “Open”. The warning message appears again, but this time with an “Open”-Button. Click on that button.
  5. 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.
  6. From now on, you have only to double-click the file “start_tor_browser_on_macos.sh” or “start_tor_browser_on_macos_cable.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”.
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!

  1. 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
# For clients connected to the TorBox wirelessly via the TorBox AP:
curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user.js --output Browser/TorBrowser/Data/Browser/profile.default/user.js
# For clients connected to the TorBox with a cable:
curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user_cable.js --output Browser/TorBrowser/Data/Browser/profile.default/user.js

  1. 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

  1. Close the terminal — this will delete the environmental variables.
  2. 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” for clients connected to the TorBox wirelessly or “start_tor_browser_on_linux_cable.sh” for clients connected to the TorBox with a cable (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” or “start_tor_browser_on_linux.sh_cable.sh” executable and start it:
chmod u+x start_tor_browser_on_linux.sh
./start_tor_browser_on_linux.sh

or

chmod u+x start_tor_browser_on_linux_cable.sh
./start_tor_browser_on_linux_cable.sh
  1. 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:
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!

  1. 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
# For clients connected to the TorBox wirelessly via the TorBox AP:
curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user.js --output Browser\TorBrowser\Data\Browser\profile.default\user.js
# For clients connected to the TorBox with a cable:
curl https://raw.githubusercontent.com/radio24/TorBox/master/install/user_cable.js --output Browser\TorBrowser\Data\Browser\profile.default\user.js

  1. 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

  1. Close the terminal — this will delete the environmental variables.
  2. 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” for clients connected to the TorBox wirelessly or “start_tor_browser_on_windows_cable.bat” for clients connected to the TorBox with a cable (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” or “start_tor_browser_on_windows_cable.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.