Actions

Stream Isolation

From Whonix


Streamisolationme.jpg
short stream isolation summary all information below

Introduction[edit]

If you install custom applications and do not explicitly take precaution against identity correlation through Tor circuit sharing, you risk that different activities, let's say Web (Chromium or similar) or IRC (mIRC or similar) go through the same Tor circuit and exit relay. Even though you would still be anonymous, i.e. the Tor exit relay would still not know your real IP/location, they can easily correlate those activities issued 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 dedicated Tor SocksPort's per application results in taking different routes through the Tor network per application. Not necessarily all nodes (first, second, third) get replaced by Tor. Sometimes just the first, sometimes just the second, sometimes just the third, and sometimes multiple nodes change.

Stream Isolation Graphic

Whonix ™ implements protection against identity correlation through Tor circuit sharing for preinstalled applications, however, for better privacy, you are still advised to understand a bit of the technical background. Since Tor version 0.2.3, different Socks,- Dns-, or TransPorts go through different Tor circuits, therefore preventing identity correlation. Whonix ™ configures most applications that come preinstalled with Whonix ™ to use different SocksPort, thus no identity correlation is at risk. Whonix ™ uses either socks proxy settings to direct various applications to different SocksPorts or uwt [archive] (more information below).

Any other traffic (i.e. custom installed applications, misc applications, such as nslookup, go through Tor's Dns-, 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 [1] -
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 [archive]) 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 [2] 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 [3] none See footnote. [3] -

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 [archive] 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 [archive].

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. [4]

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

Footnotes[edit]

  1. Whonix-Workstation ™ 127.0.0.1:9150 gets redirected to 10.152.152.10:9150 by anon-ws-disable-stacked-tor [archive]. 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.
  2. 3.0 3.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.
  3. https://gitlab.torproject.org/legacy/trac/-/issues/3455 [archive]
  4. https://lists.torproject.org/pipermail/tor-talk/2012-September/025432.html [archive]

How to mitigate identity correlation[edit]

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 specific to Whonix ™:

Application can connect without additional configuration required.

More complex specific to Whonix ™:

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

Using Tor Browser on the host without Whonix ™ involved is an example for "no transparent proxying available". [1]

Use Telegram in Whonix ™: uses transparent proxying.

Use Firefox on host without Tor: Not sure we should call 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.

There are also other types of transparent proxies such as content filtering, virus scanning, and what not.

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

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. [2] 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 testing the TransPort. If that is of concern to you, it can be disabled in systemcheck, see prevent polluting TransPort.

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 circuit, thus identity correlation is at risk. [3]

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 [archive]. 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. [4]

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 professional 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 [archive].
  • 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 [archive] 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.
  • 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 [5]:

  • 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 [archive]. See also tor-talk mailing list: Tor's stream isolation features defaults [archive]. 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 [archive] 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. [6]

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 [archive] 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 ™. [4]

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 [archive].

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}} 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

[7]

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 [archive] 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. [8]

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.

Open file /etc/uwt.d/50_user.conf in an editor with root rights.

This box uses sudoedit for better security [archive]. 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

Add.

uwtwrapper_global="0"

Save and exit.

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. If you previously onionized any repositories, that has to be undone; see Onionizing Repositories.

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

3. Open file /etc/apt/sources.list /etc/apt/sources.list.d/* in an editor with root rights.

This box uses sudoedit for better security [archive]. 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/*

4. Remove any mention of tor+.

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

Remove proxy settings for Tor Browser Downloader by Whonix ™.

Open file /etc/torbrowser.d/50_user.conf in an editor with root rights.

This box uses sudoedit for better security [archive]. 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

Paste. [9] [10]

TB_NO_TOR_CON_CHECK=1
CURL_PROXY="--fail"

Save.

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. [11] [12]

Note: This action will break both Stream Isolation for Tor Browser and Tor Browser's tab isolation by socks user name [archive]. 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

Navigate to the Tor Browser folder.

cd ~/tor-browser_en-US

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

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.

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.

Set.

export TOR_TRANSPROXY=1

/etc/environment Method

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

Open file /etc/environment in an editor with root rights.

This box uses sudoedit for better security [archive]. 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

Add the following line.

TOR_TRANSPROXY=1
## newline at the end

Save and reboot.

Tor Browser Settings Changes

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

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

2. network.dns.disabled → set to false

3. 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. [15]

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 root rights.

This box uses sudoedit for better security [archive]. 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 [archive] on SocksPort, HTTPTunnelPort, TransPort and DnsPort.

SocksPort[edit]

A SocksPort is a listen port by Tor which accepts traffic using the socks [archive] 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 [archive].

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 [archive]

TransPort[edit]

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

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 ™. [4]

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 [archive] /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 [archive].

Sources[edit]

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

References[edit]

  1. 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.
  2. If you used to use only one SocksPort with the common torification methods [archive], the same thing happened [archive].
  3. What about UDP? See Tor#UDP.
  4. 4.0 4.1 4.2 Multiple Whonix-Workstation ™ using different internal IP's are automatically separated by Tor (IsolateClientAddr is Tor's default).
  5. Tor configuration file /etc/torrc.d/70_workstation.conf %includes file /usr/share/tor/tor-service-defaults-torrc.anondist.
  6. This is because torsocks configuration file /etc/tor/torsocks.conf.anondist [archive] 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
    
  7. Although not strictly required, you could alternatively/additionally deactivate Tor TransPort and DnsPort. Add to /usr/local/etc/torrc.d/50_user.conf. Open /usr/local/etc/torrc.d/50_user.conf.

    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.

    sudo nano /usr/local/etc/torrc.d/50_user.conf

    Add.

    TransPort 0
    DnsPort 0

    Save.

    And then Reload Tor.

    After editing /usr/local/etc/torrc.d/50_user.conf, 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
  8. https://github.com/Whonix/uwt/blob/master/usr/bin/uwt#L49 [archive]
  9. 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.
  10. 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.
  11. This term was coined in context of a Tor Transparent Proxy [archive] (.onion [archive]). It acts as a simple gateway that routes all connections through Tor, but does not provide Stream Isolation.
  12. If these settings are changed, Tor Button would previously show a red sign and state "Tor Disabled" when a mouse was hovered over it.
  13. Unless this environment variable is manually unset before starting Tor Browser.
  14. 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 [archive] 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).


Fosshost is sponsors Kicksecure ™ stage server 100px
Fosshost About Advertisements

Search engines: YaCy | Qwant | ecosia | MetaGer | peekier | Whonix ™ Wiki


Follow: 1024px-Telegram 2019 Logo.svg.png Iconfinder Apple Mail 2697658.png Twitter.png Facebook.png Rss.png Reddit.jpg 200px-Mastodon Logotype (Simple).svg.png

Support: Discourse logo.png

Donate: Donate Bank Wire Paypal Bitcoin accepted here Monero accepted here Contribute

Whonix donate bitcoin.png Monero donate Whonix.png United Federation of Planets 1000px.png

Twitter-share-button.png Facebook-share-button.png Telegram-share.png link=mailto:?subject=Stream Isolation&body=./Stream_Isolation link=https://reddit.com/submit?url=./Stream_Isolation&title=Stream Isolation link=https://news.ycombinator.com/submitlink?u=./Stream_Isolation&t=Stream Isolation link=https://mastodon.technology/share?message=Stream Isolation%20./Stream_Isolation&t=Stream Isolation

Follow us on Twitter.png Twitter / Facebook.png Facebook.

https link onion link Priority Support | Investors | Professional Support

Whonix | © ENCRYPTED SUPPORT LP | Heckert gnu.big.png Freedom Software / Osi standard logo 0.png Open Source (Why?)

The personal opinions of moderators or contributors to the Whonix ™ project do not represent the project as a whole.

By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent.