Stream Isolation

From Whonix
Jump to navigation Jump to search

Streamisolationme.jpg
short stream isolation summary all information below

Introduction[edit]

Essentials[edit]

If the internet is used normally, without Tor, a proxy or VPN, there is not really a widespread term for this. Could be coined "connecting over clearnet".

When using Tor without Whonix ™ such as when using the Tor Browser Bundle on a host operating system such as Windows or Debian, only the Tor Browser Bundle connect over Tor. All other applications are still using clearnet.

In case of Whonix ™: All traffic originating from Whonix-Workstation ™ and Whonix-Gateway ™ is routed over Tor. [1] [2] [3] [4] [5] [6] [7]

Transparent Proxy[edit]

This chapter explains what a Transparent Proxy is. It is required to know in order to understand the following chapters.

  • Transparent proxying means, simplified and unspecific to Whonix ™:

    An application can connect without additional configuration required.

  • Use Firefox on host operating system without Tor or any proxy/VPN without Whonix ™ involved: Not sure that should be called that "transparent proxying". Should probably not call it that way to avoid confusion. In that case probably the home router is doing "transparent proxying". A proxy that is transparent. It does stuff for the user/program without the user necessarily having to know anything about it.
  • Using Tor Browser on the host without Whonix ™ involved: This is an example for "no transparent proxying available". [8]
  • There are also other types of transparent proxies such as content filtering, virus scanning, and what not.
  • More complex specific to Whonix ™:

    An application can use TCP/DNS [UDP blocked] over Tor (user -> Tor -> destination) without additional configuration required.

Whonix ™ has feature transparent proxying enabled by default. transparent proxying is a feature that most users want. Not enabling transparent proxying by default would be confusing for most users.

In other words, Whonix-Gateway by default can be used as a Tor Transparent Proxy. Connections from Whonix-Workstation ™ to Whonix-Gateway are transparently proxied through Tor.

For example if using Telegram in Whonix ™: Uses transparent proxying because it is not pre-configured by default to use Tor proxy settings.

Identity Correlation through Tor Circuit Sharing[edit]

If the user installs custom applications and omits to explicitly take precaution against identity correlation through Tor circuit sharing, the user is risking that different activities, let's say web (Chromium or similar) or IRC (mIRC or similar) go through the same Tor circuit and Tor exit relay. Even though the user would still be anonymous, i.e. the Tor exit relay would still not know the user's real IP/location, the Tor exit relay and their internet service provider (ISP) can easily correlate those activities by different applications to the same pseudonym.

The following graphic illustrates the difference of using Tor SocksPort's compared to using Tor's TransPort. Using a dedicated Tor SocksPort's per application results in taking different routes through the Tor network per application. Not necessarily all Tor relays (first, second, third) get replaced by Tor. Sometimes just the first, sometimes just the second, sometimes just the third, and sometimes multiple Tor relays in the Tor circuit change.

Stream Isolation Graphic

Whonix ™ implements protection against identity correlation through Tor circuit sharing for preinstalled applications, however, for better privacy, the user is advised to understand a bit of the technical background. Since Tor version 0.2.3, different SocksPorts, DnsPorts, or TransPorts are routed through different Tor circuits, therefore preventing identity correlation.

Whonix ™ configures most applications that come preinstalled with Whonix ™ to use a different SocksPort, thus no identity correlation is at risk. Whonix ™ uses either socks proxy settings to direct various applications to different SocksPorts or uwt (more information below).

Any other traffic (i.e. custom installed applications, misc applications, such as nslookup, go through Tor's DnsPort, and/or TransPort (can be optionally disabled, see below).

List[edit]

Related:

Applications in Whonix ™ that are either prepared or fully pre-configured to prevent identity correlation through Tor circuit sharing:

By Settings[edit]

application pre-installed pre-configured stream isolation by method port comments
Tor Browser Yes Yes socks proxy settings 9150 [9] -
HexChat Yes Yes socks proxy settings 9101 General Safety Advice
Mozilla Thunderbird No Yes socks proxy settings 9102 -
Instant Messenger No No socks proxy settings port prepared, IP 10.152.152.10, port 9103 Chat
sdwdate Yes Yes socks proxy settings 9108 Dev/TimeSync
systemcheck Yes Yes socks proxy settings 9110 -
Bitcoin electrum Wallet (BTC) Yes No (TODO) socks proxy settings port prepared, IP 10.152.152.10, port 9111 -
Monero (XMR) Yes No (TODO) socks proxy settings - -
Tor Browser Downloader by Whonix ™ Yes Yes socks proxy settings 9115 -
KDE application wide proxy settings No Yes [10] socks proxy settings 9122 no KDE applications with network activity pre-installed -

By uwt wrapper[edit]

application pre-installed pre-configured stream isolation by method port comments
apt-get yes yes uwt wrapper - Update
aptitude yes yes uwt wrapper - -
gpg yes yes uwt wrapper - -
ssh yes yes uwt wrapper - -
git no yes uwt wrapper - -
wget yes yes uwt wrapper - -
curl yes yes uwt wrapper - -
scurl yes yes uwt wrapper - Uses curl, therefore same as curl.

none[edit]

application pre-installed pre-configured stream isolation by method port instructions
GNOME application wide proxy settings no no none no GNOME applications with network activity pre-installed -
systemcheck --leak-tests yes no [11] none See footnote. [11] -

Details[edit]

The required socks proxy settings are setup by various Whonix ™ configuration packages or uwt wrappers, which are set up on Whonix-Gateway ™ and on Whonix-Workstation ™. uwt is a wrapper around torsocks, which is also already installed to /usr/bin/uwt.

  • Example, each time you run a uwt wrapped application, i.e. simply type apt-get in console, the uwt wrapper /usr/bin/apt-get will run. It adds uwt before apt-get. For curiosity check nano /usr/bin/apt-get. Essentially, the uwt wrapper then runs /usr/bin/uwt /usr/bin/apt-get.anondist-orig. That is also the case for all other uwt wrapped applications.
  • If you ever want or must run a uwt wrapped application without uwt, do not run for example apt-get in console, do run apt-get.anondist-orig. Use cases could be if you want to connect to localhost. If you know what you are doing, you should also be able to deactivate any uwt wrappers you dislike, see #Deactivate_uwt_Stream_Isolation_Wrapper.
  • When running /usr/bin/apt-get.anondist-orig it directly goes through Tor's DnsPort and through Tor's TransPort and not through its own SocksPort.
  • uwt looks if the command contains the words localhost or 127.0.0.1, if that is the case, uwt will not be used. The command will be run without uwt. Thus, if a localhost connection is falsely detected it will leak, but only through Tor's DnsPort and through Tor's TransPort, which should be acceptable.

Isolate by destination address: Let's assume SSH goes over port 22 and you want to connect to different SSH servers and do not want an observer to be able to correlate that activity to the same pseudonym. If the SSH servers run on different IP's isolate by destination address might help.

Isolate by destination port: This doesn't seem to be useful for anything in Whonix ™, applications using different protocols (and therefore different ports) are already isolated through using different SocksPorts.

Isolate by destination port doesn't really achieve anything for web browsing: tor-talk Tor's stream isolation features defaults.

For more information about stream isolation refer to the Tor manual.

Different tabs and websites in Tor Browser are isolated by since Tor Browser version 4.5-alpha-1. [12]

Connections to different Tor Onion Services are automatically stream isolated. [13]

How to mitigate identity correlation[edit]

Basic Protection[edit]

If you install custom software on Whonix-Workstation ™, that uses the internet, and want to prevent identity correlation through Tor circuit sharing (which you should do), you have to manually configure them. This is not a Whonix ™ specific problem. [14] Read also Software installation on Whonix-Workstation ™.

A #list of applications which come pre-installed with Whonix ™ are pre-configured to prevent identity correlation through circuit sharing.

Traffic going through TransPort by default is systemcheck when manually testing the TransPort by using systemcheck --leak-tests. If that is of concern to you,

All custom installed application's TCP traffic is routed through Tor's TransPort and all their DNS requests through Tor's DnsPort. This means different activities or "identities" in different applications (say browser, IRC, email) end up being routed through the same Tor circuit, thus identity correlation is at risk. [15]

To protect against this, you have to set up configure applications to use a dedicated Tor SocksPort. Each custom installed application has to be directed to a dedicated Tor SocksPort, for directions how to do that use the Torify HOWTO. Generally, this can be done either by configuring the application's proxy settings or by using a proxifier (socksifier) such as torsocks.

Multiple Whonix-Workstation ™ are automatically stream isolated. [16]

What is better, configure the application's proxy settings or using a proxifier? There can be no generalized answer as this is highly application specific. The most comprehensive documentation of this is the Torify HOWTO. Also a web search could be performed on how to torify applications.

Applications inside Whonix ™ are already torified but by applying these instructions inside Whonix ™ the user would go one step further, i.e. add stream isolation.

Finding up to date instructions for torification is difficult because developing instructions for torification itself is a difficult process. Someone who understands networking needs to leak test if the torification instructions are actually working. Or if there is a leak which means that portion's of the applications's traffic ignore proxy settings and/or circumvent the proxifier and is actually making external connections without using Tor. Such leaks would be much less severe in Whonix ™. It would only result in identity correlation through Tor circuit sharing but not in a leak of the user's real IP address to the destination.

Asking for torification instructions for specific applications at Whonix ™ Free Support is probably futile unless it is a premium support request. The Whonix ™ is the wrong recipient for such support requests. One of the main reasons for the inception of the Whonix ™ was that finding, developing and applying torification instructions is so difficult and one never really knows if it is 100% free of leaks. Even seriously reviewed torification instructions for one application would only apply to the very version which was being reviewed. Not to future versions of the application.

The legacy approach of torification of arbitrary applications on the host seems to been largely given up. There are very few edits to the Torify HOWTO over the years. Nowadays some application developers are providing Tor-safe by default applications, i.e. applications designed for use with Tor in mind and not as an afterthought. Examples include Tor Browser and OnionShare. Also if users are asking how to torifiy specific applications and making sure these are leak free, users are probably told "use Whonix".

Additional comments regarding the Torify HOWTO:

  • Warnings about protocol related warnings you must honor. You are still better off with Whonix ™, as it offers best possible Protocol-Leak-Protection and Fingerprinting-Protection.
  • Whonix ™ setup provides protection against IP leaks through protocol leaks.
  • If you do not correctly torify either no connections will be possible or traffic will either continue going through Tor's TransPort unless you disable transparent torification.
  • If you redirect more than one application to the same SocksPort, identity correlation is at risk.
  • DNS related warnings still apply, though to a lesser extent - an attack could only make correlations but still couldn't figure out your IP. To prevent that see chapter better protection.
    • Do not use a local DNS resolver, as all DNS requests would be executed by the same Tor circuit.
  • Other leaks, such as applications not honoring the proxy settings / wrapper, ICMP or UDP leaks do not apply to Whonix ™.
  • The SafeSocks setting is for rejecting unsafe variants of socks that might cause DNS leaks. The Whonix ™ design model mitigates DNS leaks by redirecting all requests to Tor's DnsPort. Enabling this setting would give marginal benefit in this situation but would complicate debugging.

On Whonix-Gateway ™ there are already a lot custom socks ports prepared for use with custom installed applications [17]:

  • Without IsolateDestAddr and without IsolateDestPort: SocksPort 9153 to 9159
  • With IsolateDestAddr, but without IsolateDestPort: SocksPort 9160 to 9169
  • Without IsolateDestAddr, but with IsolateDestPort: SocksPort: 9170 to 9179
  • With IsolateDestAddr and with IsolateDestPort: SocksPort: 9180 to 9189
  • If those are not enough, you can add your own.

What are IsolateDestAddr and IsolateDestPort? You can learn about them in the Tor manual. See also tor-talk mailing list: Tor's stream isolation features defaults. Usually, unless you know better, you are better off not using IsolateDestAddr or IsolateDestPort.

Generic instructions for configuring custom installed applications for stream isolation for less than 7 custom applications

  1. Install custom application.
  2. Configure application to use a dedicated Tor SocksPort according to Torify HOWTO by either configuring the application's proxy settings or by using a proxifier such as torsocks.
  3. Start custom application.

Generic instructions for configuring custom installed applications for stream isolation using proxifier (socksifier) torsocks

  1. Install custom application.
  2. Open a terminal.

If you are using Qubes-Whonix ™, complete the following steps.

Qubes App Launcher (blue/grey "Q")Whonix-Workstation ™ App Qube (commonly named anon-whonix)Xfce Terminal

If you are using a graphical Whonix ™ with XFCE, run.

Start MenuXfce Terminal

3. Start custom application from command line by prepending torsocks.

torsocks application-name

Using this method, there is no need to specify any proxy IP address, port number, protocol. [18]

Generic instructions for configuring custom installed applications for stream isolation for less than 7 custom applications using the application's proxy settings

  1. Install custom application.
  2. Configure application to use a dedicated Tor SocksPort according to Torify HOWTO by either configuring the application's proxy settings.
  3. protocol: socks 5
  4. Non-Qubes-Whonix proxy IP: 10.152.152.10
  5. port: 9153 (use a different port according to list above if using multiple custom installed applications)
  6. Start custom application.

Better generic instructions for this cannot be provided since this is application specific as mentioned above.

Better Protection[edit]

For best protection against identity correlation:

  • Read the advice above and on Whonix-Gateway ™.
  • Deactivate KDE / GNOME - application wide proxy settings because those proxy settings are not application specific, but rather force all KDE / GNOME applications through the same SocksPort. There no KDE / GNOME applications which use the internet preinstalled by default. However, deactivating those KDE / GNOME wide proxy settings gives finer control over stream isolation.
  • Disable transparent proxying as documented below.

Best Protection[edit]

Best stream isolation is only possible if you honor the advice above and only use one application per session and always revert to a fresh image or Multiple Whonix-Workstation ™. [16]

Disable Transparent Proxying[edit]

To deactivate transparent proxying apply the following instructions.

Following these steps will disable the Whonix-Gateway ™ transparent proxying feature and transform Whonix-Gateway ™ into an IsolatingProxy.

Note: The following instructions should be applied in Whonix-Gateway (Qubes-Whonix ™: In App Qubes sys-whonix).

1. Modify Whonix-Gateway ™ User Firewall Settings.

Note: If no changes have yet been made to Whonix ™ Firewall Settings, then the Whonix ™ User Firewall Settings File /usr/local/etc/whonix_firewall.d/50_user.conf appears empty (because it does not exist). This is expected.

If using Qubes-Whonix ™, complete these steps.
In Whonix-Gateway ™ App Qube. Make sure folder /usr/local/etc/whonix_firewall.d exists.

sudo mkdir -p /usr/local/etc/whonix_firewall.d

Qubes App Launcher (blue/grey "Q")Whonix-Gateway ™ App Qube (commonly called sys-whonix)Whonix ™ User Firewall Settings

If using a graphical Whonix-Gateway ™, complete these steps.

Start MenuApplicationsSettingsUser Firewall Settings

If using a terminal-only Whonix-Gateway ™, complete these steps.

In Whonix-Gateway ™, open the whonix_firewall configuration file in an editor.

sudoedit /usr/local/etc/whonix_firewall.d/50_user.conf

For more help, press on Expand on the right.

Note: This is for informational purposes only! Do not edit /etc/whonix_firewall.d/30_whonix_gateway_default.conf.

Note: The Whonix ™ Global Firewall Settings File /etc/whonix_firewall.d/30_whonix_gateway_default.conf contains default settings and explanatory comments about their purpose. By default, the file is opened read-only and is not meant to be directly edited. Below, it is recommended to open the file without root rights. The file contains an explanatory comment on how to change firewall settings.

## Please use "/etc/whonix_firewall.d/50_user.conf" for your custom configuration,
## which will override the defaults found here. When {{project_name_long}} is updated, this
## file may be overwritten.

See also Whonix modular flexible .d style configuration folders.

To view the file, follow these instructions.

If using Qubes-Whonix ™, complete these steps.

Qubes App Launcher (blue/grey "Q")Template: whonix-gw-16Whonix Global Firewall Settings

If using a graphical Whonix-Gateway ™, complete these steps.

Start MenuApplicationsSettingsGlobal Firewall Settings

If using a terminal-only Whonix-Gateway ™, complete these steps.

In Whonix-Gateway ™, open the whonix_firewall configuration file in an editor.

nano /etc/whonix_firewall.d/30_whonix_gateway_default.conf

2. Add.

WORKSTATION_TRANSPARENT_TCP=0 WORKSTATION_TRANSPARENT_DNS=0

3. Save.

4. Reload Whonix-Gateway ™ Firewall.

If you are using Qubes-Whonix ™, complete the following steps.

Qubes App Launcher (blue/grey "Q")Whonix-Gateway ™ ProxyVM (commonly named sys-whonix)Reload Whonix ™ Firewall

If you are using a graphical Whonix-Gateway ™, complete the following steps.

Start MenuApplicationsSystemReload Whonix ™ Firewall

If you are using a terminal-only Whonix-Gateway ™, run.

sudo whonix_firewall

[19]

5. Done.

Deactivating transparent proxying is complete.

This will disable transparent proxying. All applications not configured to use a SocksPort by socks proxy settings or forced to use a SocksPort by a socksifier will not be able to establish connections. This is the only way to ensure that different SocksPorts are used and also that DNS is remotely resolved through that SocksPort.

6. Test.

Optional.

IsolateSOCKSAuth[edit]

See Tor manual IsolateSOCKSAuth.

Don’t share circuits with streams for which different SOCKS authentication was provided. [...]

Deactivate Stream Isolation[edit]

Easy[edit]

How to disable stream isolation. Most easy and common methods only. For more options, see below.

Deactivate uwt Stream Isolation Wrapper[edit]

OPTIONAL. Usually not required. Only for special setups and people who know what they are doing.

Temporary[edit]

anondist-orig Method[edit]

Append .anondist-orig to the command you want to run. For example, instead of using.

curl 38.229.72.22

Use.

curl.anondist-orig 38.229.72.22

Environment Variable Method[edit]

Use the UWT_DEV_PASSTHROUGH environment variable. [20]

Example. Set the UWT_DEV_PASSTHROUGH environment variable. This will disable using torsocks for all following invocations.

export UWT_DEV_PASSTHROUGH="1"
curl 38.229.72.22

When running as user and using sudo, do not forget sudo parameter -E which stands for preserve environment.

sudo -E apt update

Permanently[edit]

Introduction[edit]

You can enable/disable all uwt stream isolation wrappers globally or enable/disable specific stream isolation wrappers, see uwt /etc/uwt.d/30_uwt_default.conf configuration file.

deactivate all uwt wrappers permanently[edit]

The following instructions permanently deactivate all uwt wrappers and remove stream isolation for uwt-wrapped applications system-wide. Consequently, all uwt-wrapped applications revert to the default system networking configuration.

For more granular control of uwt wrapper deactivation, see: Deactivate uwt Stream Isolation Wrapper.

1. Platform specific notice:

2. Open file /etc/uwt.d/50_user.conf in an editor with administrative (root) write permissions.

This box uses sudoedit for better security. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /etc/uwt.d/50_user.conf

3. Add.

uwtwrapper_global="0"

4. Save and exit.

5. Done.

Deactivate Misc Proxy Settings[edit]

On the Stream Isolation page, there is a list of applications that are pre-configured to use socks proxy settings via application configuration files. To disable this the Whonix ™ system default must be removed from the application's settings.

TODO: document and expand.

Remove proxy settings for APT repository files.

1. Platform specific notice:

2. If you previously onionized any repositories, that has to be undone; see Onionizing Repositories.

3. Remove any mention of tor+ in file /etc/apt/sources.list (if it was previously configured; that file is empty by default in Whonix ™ / Kicksecure) or any file in folder /etc/apt/sources.list.d.

4. Open file /etc/apt/sources.list /etc/apt/sources.list.d/* in an editor with administrative (root) write permissions.

This box uses sudoedit for better security. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /etc/apt/sources.list /etc/apt/sources.list.d/*

5. Remove any mention of tor+.

6. Done.

The process of removing proxy settings from APT repository files is now complete.

Remove proxy settings for Tor Browser Downloader by Whonix ™.

1. Platform specific notice:

2. Open file /etc/torbrowser.d/50_user.conf in an editor with administrative (root) write permissions.

This box uses sudoedit for better security. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /etc/torbrowser.d/50_user.conf

3. Paste. [23] [24]

TB_NO_TOR_CON_CHECK=1 CURL_PROXY="--fail"

4. Save and exit.

5. Done.

Proxy settings have been removed from Tor Browser Downloader by Whonix ™.

For some applications, this is impossible:

These applications can only talk to Tor Onion Services directly and cannot be configured to use the system default. Therefore you can only deactivate sdwdate and/or not use applications like OnionShare and Ricochet IM.

Tor Browser Remove Proxy Settings[edit]

If you would like to remove proxy settings from Tor Browser, see below.

Introduction

This configuration results in Tor Browser no longer using proxy settings. With no proxy set, Tor Browser uses the (VM) system's default networking. This is identical to any other application inside Whonix-Workstation ™ that has not been explicitly configured to use Tor via socks proxy settings or a socksifier. This setting is also called transparent torification. [25] [26]

Note: This action will break both Stream Isolation for Tor Browser and Tor Browser's tab isolation by socks user name. This worsens the web fingerprint and leads to pseudonymous (not anonymous) connections. To mitigate these risks, consider using More than one Tor Browser in Whonix ™, or preferably Multiple Whonix-Workstation ™.

To enable transparent torification (no proxy setting), set the TOR_TRANSPROXY=1 environment variable. There are several methods, but the simplest is the /etc/environment Method.

Note: Choose only one method to enable transparent torification.

For other methods with finer granulated settings, please press on Expand on the right.

Command Line Method

1. Platform specific notice:

2. Navigate to the Tor Browser folder.

cd ~/tor-browser_en-US

3. Every time Tor Browser is started, run the following command to set the TOR_TRANSPROXY=1 environment variable.

TOR_TRANSPROXY=1 ./start-tor-browser.desktop

4. Done.

start-tor-browser Method

This only applies to a single instance of the Tor Browser folder that is configured. This method may not persist when Tor Browser is updated.

1. Platform specific notice:

2. Find and open start-tor-browser in the Tor Browser folder with an editor.

This is most likely found in ~/tor-browser_en-US/Browser/start-tor-browser below #!/usr/bin/env bash.

3. Set.

export TOR_TRANSPROXY=1

4. Done.

start-tor-browser Method configuration has been completed.

/etc/environment Method

This will apply to the whole environment, including any possible custom locations of Tor Browser installation folders. [27]

1. Platform specific notice.

2. Open file /etc/environment in an editor with administrative (root) write permissions.

This box uses sudoedit for better security. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /etc/environment

3. Add the following line.

TOR_TRANSPROXY=1 ## newline at the end

4. Save and exit.

5. Reboot.

Reboot is required to make changes to configuration file /etc/environment take effect.

6. Done.

/etc/environment method configuration has been completed.

Tor Browser Settings Changes

This step is required since Tor Browser 10. [28]

1. Platform specific notice.

2. Tor Browser → URL bar → Type: about:config → Press Enter key. → search for and modify

3. network.dns.disabled → set to false

4. extensions.torbutton.launch_warning → set to false

Undo

Reverting this change is undocumented. Simply unsetting that environment variable will not work due to Tor Browser limitations. The easiest way to undo this setting is to install a fresh instance of Tor Browser (please contribute to these instructions)!

Ignore Tor Button's Open Network Settings

Whonix ™ has disabled the Open Network Settings... menu option in Tor Button. Read the footnote for further information. [29]

Nested Execution[edit]

uwt version 4.0-1 and above protects form endless nested execution which could likely lead to a locked up session by aborting after 10 times an uwt wrapped application calling another uwt wrapped application. In that case, you would see the following error message.

uwtwrapper uwt wrapper ERROR: More than uwtwrapper_counter 10 nested executions (uwtwrapper_max: 10).

This is most likely happening due to two symlinks pointing to each other resulting in endless execution. However, should there be any cases (none could be foreseen at development time) where this is legitimate, feel free to change the setting responsible for aborting execution. Please also consider reporting your use case in Whonix ™ forums so perhaps a better fix for this can be found.

Open file /etc/uwt.d/50_user.conf in an editor with administrative (root) write permissions.

This box uses sudoedit for better security. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

sudoedit /etc/uwt.d/50_user.conf

Set uwtwrapper_max to a value more suitable for you.

uwtwrapper_max=100

Alternatively you could completely disable the nested execution protection.

nested_protection() { true }

Save and exit.

Done.

Development[edit]

Information[edit]

See also the Tor manual on SocksPort, HTTPTunnelPort, TransPort and DnsPort.

SocksPort[edit]

A SocksPort is a listen port by Tor which accepts traffic using the socks protocol.

Using a SocksPort is possible by using either:

Traffic on separate SocksPorts is stream isolated by Tor default.

HTTPTunnelPort[edit]

A HTTPTunnelPort is a listen port by Tor which accepts traffic using the HTTP CONNECT method.

This is a new feature of Tor.

Traffic on separate HTTPTunnelPorts is stream isolated by Tor default.

Forum discussion:
https://forums.whonix.org/t/tor-can-now-serve-as-http-proxy

TransPort[edit]

TransPort is a feature where Tor accepts raw traffic on a listen port if redirected there using iptables. See also TransparentProxy.

When using Transparent Proxying (default in Whonix ™) (see this page for Transparent Proxying for more information), all applications that do not use a SocksPort or HTTPTunnelPort will fall back to be using Tor's TransPort for TCP. I.e. using system default networking. This is also called transparent proxying.

There is no stream isolation for TransPort connections unless originating from a separate Whonix-Workstation ™. [16]

DnsPort[edit]

Similar to above but for DNS. All applications that do not use a SocksPort or HTTPTunnelPort will fall back to be using Tor's DnsPort for DNS.

torsocks[edit]

All uwt wrapped applications will be stream isolated by torsocks /etc/tor/torsocks.conf setting IsolatePID 1.

To test this, run multiple times the following command.

scurl https://check.torproject.org | grep IP

Tests[edit]

1. Applications which internally use curl.

sudo update-command-not-found
sudo update-flashplugin-nonfree --install --verbose

2. Applications which is uwt wrapped itself and internally uses ssh.

git push origin master

3. Enigmail.

Debugging / List of all uwt wrappers[edit]

sudo dpkg-divert --list
ls -la /usr/bin/ssh

Deactivating an uwt wrapper[edit]

Example:

sudo unlink /usr/bin/ssh
sudo dpkg-divert --rename --remove /usr/bin/ssh

Check if Transparent DNS is disabled[edit]

Note: The following test should be performend in Whonix-Workstation ™ (Qubes-Whonix ™: App Qube anon-whonix).

Test.

nslookup check.torproject.org ; echo $?

Expected output.

;; connection timed out; no servers could be reached

1

If it shows something else, such as a resolved IP, the Transparent DNS is enabled.

Check if Transparent TCP is disabled[edit]

Note: The following test should be performend in Whonix-Workstation ™ (Qubes-Whonix ™: App Qube anon-whonix).

Test.

UWT_DEV_PASSTHROUGH=1 curl 116.202.120.181 ; echo $?

Expected output.

curl: (7) couldn't connect to host
7

If it shows something else, such as the html source code, then Transparent TCP is enabled.

Check if Transparent Proxying is disabled[edit]

Note: The following test should be performend in Whonix-Workstation ™ (Qubes-Whonix ™: App Qube anon-whonix).

Test.

UWT_DEV_PASSTHROUGH=1 curl https://check.torproject.org/ ; echo $?

Expected output.

curl: (6) Couldn't resolve host 'check.torproject.org'
6

If it shows something else, such as the html source code, then Transparent Proxying is enabled.

Check if an Application is properly using Stream Isolation[edit]

  • Same as leak testing as if Whonix ™ is not involved.
  • Also... A weaker test... The transparent proxying disablement test.

Disable transparent proxying of DNS and TCP as per #Better Protection.

Check that worked as per:

That is because it doesn't work without transparent proxying (system default networking), meaning application unable to use network normally, then there is a certain socks leak, meaning certainly some traffic which requires system default networking. In case of:

  • clearnet operating systems: a clearnet leak
  • Whonix ™: a stream isolation violation

This is only weak test since an application could very likely try socks first and if socks fails, fall back to system default networking. Therefore, normal leak testing is required.

Add new uwt wrapper[edit]

Emulate this commit.

Sources[edit]

Stream Isolation Graphic has been contributed by: Cuan Knaggs – graphic and web design revlover print media – web design – web development – cms – e-commerce

References[edit]

  1. Since Whonix ™ version 0.2.1 Whonix-Gateway ™ traffic is also routed over Tor. In this way, use of Whonix ™ is hidden from persons or systems observing the network.
  2. To preserve the anonymity of a user's Whonix-Workstation ™ activities, it is not necessary to torify Whonix-Gateway ™ own traffic.
  3. For reader interest: If DNS settings on Whonix-Gateway ™ are changed in /etc/resolv.conf, this only affects Whonix-Gateway ™ own DNS requests issued by applications using the system's default DNS resolver. By default, no applications issuing network traffic on Whonix-Gateway ™ use the system's default DNS resolver. All applications installed by default on Whonix-Gateway ™ that issue network traffic (apt, systemcheck, sdwdate) are explicitly configured, or forced by uwt wrappers, to use their own Tor SocksPort (see Stream Isolation).
  4. Whonix-Workstation ™ default applications are configured to use separate Tor SocksPorts (see Stream Isolation), thereby not using the system's default DNS resolver. Any applications in Whonix-Workstation ™ that are not configured for stream isolation - for example nslookup - will use the default DNS server configured in Whonix-Workstation ™ (via /etc/network/interfaces), which is the Whonix-Gateway ™. Those DNS requests are redirected to Tor's DnsPort by Whonix-Gateway ™ firewall. Whonix-Gateway ™ /etc/resolv.conf does not affect Whonix-Workstation ™ DNS requests.
  5. Traffic generated by the Tor process itself which runs by Debian default under user debian-tor originating from Whonix-Gateway ™ can use the internet normally. This is because user debian-tor is exempted in Whonix-Gateway ™ Firewall, allowed to use the "normal" internet.
  6. The Tor software (as of 0.4.5.6) (and no changed were announced at time of writing) almost exclusively uses TCP traffic. See also Tor wiki page, chapter UDP. For DNS, see next footnote.
  7. Tor does not require, use functional (system) DNS for most functionality. IP addresses of Tor directory authorities are hardcoded in the Tor software as per Tor upstream default. Exceptions include:
    • proxy settings using proxies with host names rather than IP addresses
    • the Tor pluggable transport meek lite to resolve domains used in setting url=, front= to IP addresses.
  8. Tails used to have transparent proxying (could use any application without configuration). Nowadays Tails has no transparent proxying. (Most) Custom installed applications (example: Mozilla Firefox) won't connect without manual configuration in Tails.
  9. Whonix-Workstation ™ 127.0.0.1:9150 gets redirected to 10.152.152.10:9150 by anon-ws-disable-stacked-tor. Changing proxy settings in Tor Browser has proven to be unreliable. At some point Tor Button may change its internals and therefore break something again. Keeping the default settings and not requiring any changes in Tor Browser seems like the best way to support compatibility in long run and also is simplest in case update-torbrowser breaks and manually updating Tor Browser is required again in future.
  10. 11.0 11.1 systemcheck --leak-tests runs only on user request and never by its own by chance. Tests two things, a Tor SocksPort and Tor's TransPort. SocksPort test uses SOCKS_PORT_SYSTEMCHECK 9110. Stream isolating the transparent proxying, Tor TransPort leak test is impossible. The whole point of the leak test is to check if connections not configured to use a Tor SocksPort will be torified or not.
  11. https://gitlab.torproject.org/legacy/trac/-/issues/3455
  12. https://lists.torproject.org/pipermail/tor-talk/2012-September/025432.html
  13. If you used to use only one SocksPort with the common torification methods, the same thing happened.
  14. What about UDP? See Tor#UDP.
  15. 16.0 16.1 16.2 Multiple Whonix-Workstation ™ using different internal IP's are automatically separated by Tor (IsolateClientAddr is Tor's default).
  16. Tor configuration file /etc/torrc.d/70_workstation.conf %includes file /usr/share/tor/tor-service-defaults-torrc.anondist.
  17. This is because torsocks configuration file /etc/tor/torsocks.conf.anondist is preconfigured with setting IsolatePID 1.
    # Set Torsocks to use an automatically generated SOCKS5 username/password based
    # on the process ID and current time, that makes the connections to Tor use a
    # different circuit from other existing streams in Tor on a per-process basis.
    # If set, the SOCKS5Username and SOCKS5Password options must not be set.
    # (Default: 0)
    IsolatePID 1
    
  18. Although not strictly required, you could alternatively/additionally deactivate Tor TransPort and DnsPort. Add to /usr/local/etc/torrc.d/50_user.conf. Open file /usr/local/etc/torrc.d/50_user.conf in a text editor of your choice with sudoedit.

    If you are using Qubes-Whonix ™, complete the following steps.

    Qubes App Launcher (blue/grey "Q")Whonix-Gateway ™ ProxyVM (commonly named sys-whonix)Tor User Config (Torrc)

    If you are using a graphical Whonix-Gateway ™, complete the following steps.

    Start MenuApplicationsSettings/usr/local/etc/torrc.d/50_user.conf

    If you are using a terminal-only Whonix-Gateway ™, complete the following steps.

    sudoedit /usr/local/etc/torrc.d/50_user.conf

    Add.

    TransPort 0 DnsPort 0

    Save.

    And then Reload Tor.

    After changing Tor configuration, Tor must be reloaded for changes to take effect.

    Note: If Tor does not connect after completing all these steps, then a user mistake is the most likely explanation. Recheck /usr/local/etc/torrc.d/50_user.conf and repeat the steps outlined in the sections above. If Tor then connects successfully, all the necessary changes have been made.

    If you are using Qubes-Whonix ™, complete the following steps.

    Qubes App Launcher (blue/grey "Q")Whonix-Gateway ™ ProxyVM (commonly named 'sys-whonix')Reload Tor

    If you are using a graphical Whonix-Gateway ™, complete the following steps.

    Start MenuApplicationsSettingsReload Tor

    If you are using a terminal-only Whonix-Gateway ™, click HERE for instructions.

    Complete the following steps.

    Reload Tor.

    sudo service tor@default reload

    Check Tor's daemon status.

    sudo service tor@default status

    It should include a a message saying.

    Active: active (running) since ...
    

    In case of issues, try the following debugging steps.

    Check Tor's config.

    sudo -u debian-tor tor --verify-config

    The output should be similar to the following.

    Sep 17 17:40:41.416 [notice] Read configuration file "/usr/local/etc/torrc.d/50_user.conf".
    Configuration was valid
  19. https://github.com/Whonix/uwt/blob/master/usr/bin/uwt#L49
  20. Qubes-Whonix ™ users note: Or alternatively in App Qube.

    1. Create folder /usr/local/etc/uwt.d.

    sudo mkdir -p /usr/local/etc/uwt.d

    2. Open file /usr/local/etc/uwt.d/50_user.conf in an editor with administrative (root) write permissions.

    This box uses sudoedit for better security. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

    sudoedit /usr/local/etc/uwt.d/50_user.conf

  21. Qubes-Whonix ™ users note: In App Qube (whonix-ws-16) could also use file /usr/local/etc/torbrowser.d/50_user.conf instead.

    1. Create folder /usr/local/etc/torbrowser.d.

    mkdir -p /usr/local/etc/torbrowser.d

    2. Open file /usr/local/etc/torbrowser.d/50_user.conf in an editor with administrative (root) write permissions.

    This box uses sudoedit for better security. This is an example and other tools can also achieve the same goal. If this example does not work for you or if you are not using Whonix ™, please refer to this link.

    sudoedit /usr/local/etc/torbrowser.d/50_user.conf

  22. TB_NO_TOR_CON_CHECK=1 needs to be set because there is no filtered Tor ControlPort access when Whonix ™ tunnel firewall is enabled, which would break tb-updater's Tor connectivity check.
  23. By tb-updater default, if unset, variable CURL_PROXY will be dynamically set to a Tor SocksPort on Whonix-Gateway ™. For example to CURL_PROXY="--proxy socks5h://user:password@10.137.6.1:9115".
    By utilizing a curl parameter we are using anyhow -- CURL_PROXY="--fail" -- the environment variable can be disabled even if it is technically still set. This will result in downloading via the system's default networking.
  24. This term was coined in context of a Tor Transparent Proxy (.onion). It acts as a simple gateway that routes all connections through Tor, but does not provide Stream Isolation.
  25. If these settings are changed, Tor Button would previously show a red sign and state "Tor Disabled" when a mouse was hovered over it.
  26. Unless this environment variable is manually unset before starting Tor Browser.
  27. The regular Tor Browser Bundle from The Tor Project (without Whonix ™) allows networking settings to changed inside Tor via the Open Network Settings menu option. It has the same effect as editing Tor's config file torrc. In Whonix ™, the environment variable export TOR_NO_DISPLAY_NETWORK_SETTINGS=1 has been set to disable the Tor BrowserOpen Network Settings... menu item. It is not useful and confusing to have in the Whonix-Workstation ™ because:
    • In Whonix ™, there is only limited access to Tor's control port (see Dev/CPFP for more information).
    • For security reasons, Tor must be manually configured in /usr/local/etc/torrc.d/50_user.conf on Whonix-Gateway ™, and not from Whonix-Workstation ™ (see VPN/Tunnel support for more information).