{{Header}} {{#seo: |description=Using a Tor Controller with {{project_name_long}}. Onion Circuits. Nyx. View or change your Tor circuits. Monitor Tor and inspect logs. |image=onioncircuits.png }} {{Title| title=Control and Monitor Tor }} [[File:onioncircuits.png|onioncircuits - View Tor Circuits|thumb]] {{intro| Using a Tor Controller with {{project_name_short}}. Onion Circuits. Nyx. View or change your Tor circuits. Monitor Tor and inspect logs. }} [[File:0brand_Arm_Controller-1.png|Nyx Tor Controller|thumb]] = Introduction = [[#Nyx|nyx]] is the primary Tor Controller option that comes pre-installed in {{project_name_short}}. Note: [[#Vidalia|Vidalia]] has been deprecated and is no longer packaged in Debian. {{Anchor|Arm}} = Nyx = {{mbox | type = notice | image = [[File:Ambox_notice.png|40px|alt=Info]] | text = The [https://packages.debian.org/{{Stable project version based on Debian codename}}/nyx nyx] Tor controller is a later version of the arm package, so the functionality and appearance are very similar. The [https://nyx.torproject.org/ Tor Project nyx homepage] states: "Nyx is a command-line monitor for Tor. With this you can get detailed real-time information about your relay such as bandwidth usage, connections, logs, and much more." }} == Nyx Usage == Nyx is recommended and is already pre-installed in {{project_name_gateway_long}}. Since [[#Vidalia|Vidalia]] is [[#Vidalia_recommended_against|recommended against]]. {{Start_Arm}} To receive a new circuit, press:
n
To exit nyx, press:
q
q
== Nyx FAQ == {| class="wikitable" style="background-color: #fff;text-align: left" ! '''Message / Question''' ! '''Response''' |- | {{Code2|arm vs nyx?}} | The software was previously called arm, but the new name is nyx. https://tor.stackexchange.com/tags/nyx/info |- | {{Code2|Should any of the following nyx messages concern me?}} | No; see below for reasons why. See also: [[Malware and Firmware Trojans#Valid_Compromise_Indicators_versus_Invalid_Compromise_Indicators|Indicators of Compromise]] and [[Reporting_Bugs#Support_Request_Policy|Support Request Policy]] ([[Reporting_Bugs#Policy_Rationale|rationale]]). |- | {{Code2|Am I compromised? Does nyx report leaks?}} | Nyx is conceptually not a tool to discover serious issues such as a possible compromise or leaks. Nyx works on a different level -- it is a Tor Controller. Nyx talks to Tor using Tor's ControlPort and is an interface to show what Tor thinks. Neither Tor nor nyx implement anything like virus detection, compromise detection, leak detection and so on. Nyx messages are generally interesting and useful, but there is rarely any cause for concern. For leak testing, see [[Dev/Leak_Tests|leak tests]]. |- | {{Code2|Nyx sometimes shows my public IP address and other times the internal 10.0.2.15 and 127.0.0.1 IPs. Is it normal or dangerous?}} https://forums.whonix.org/t/strange-nyx-behavior/9514 | This is a normal nyx feature. {{project_name_short}} uses a Tor control port filter proxy ([[Onion-grater|onion-grater]]) that prevents abuse of the ControlPort, including blocking dangerous commands like GETINFO address. When the real IP address appears, it is only local and nobody else can see it. |- | {{Code2|Tor is preventing system utilities like netstat and lsof from working. This means that nyx can't provide you with connection information. You can change this by adding 'DisableDebuggerAttachment 0' to your torrc and restarting tor. For more information see... https://gitlab.torproject.org/legacy/trac/-/issues/3313}} | If you want to learn about the technical details, read https://gitlab.torproject.org/legacy/trac/-/issues/3313. |- | DisableDebuggerAttachment even when running as root. | This [https://gitlab.torproject.org/legacy/trac/-/issues/7709 bug] in nyx has been resolved. |- | {{Code2|man page (GENERAL OPTIONS and COMMAND-LINE OPTIONS)}} | This [https://gitlab.torproject.org/legacy/trac/-/issues/9679 bug] in nyx has been resolved. |- | {{Code2|[WARN] Socks version 71 not recognized. (Tor is not an http proxy.)}} | This is caused by the [https://www.kicksecure.com/wiki/Systemcheck systemcheck] function {{Code2|check_tor_socks_port_reachability}}. It checks if a Tor SocksPort is reachable by trying to fetch it using curl. {{CodeSelect|code= {{Curl_Plain}} 10.152.152.10:9100 }} It will not report anything if it works, but will complain if it fails. |- | {{Code2|[WARN] Socks version 71 not recognized. (This port is not an HTTP proxy; did you want to use HTTPTunnelPort?)}} | This occurs for similar reasons to the entry above. |- | {{Code2|[WARN] Rejecting request for anonymous connection to private address [scrubbed] on a TransPort or NATDPort. Possible loop in your NAT rules?}} | This happens for example if you run "curl 192.168.0.15". The reason is when you type "curl" in {{project_name_short}}, by default you are not directly using curl, but a uwt-wrapped ([[Stream_Isolation|stream-isolated]]) curl instead. It does not try to directly connect to 192.168.0.15, but rather to connect to 192.168.0.15 through Tor, leading to this Tor message. It really means an operation was attempted that will not work in that way. In this instance, deactivate the curl stream isolation wrapper or use the non-wrapped version - see [[Stream_Isolation|Stream Isolation]]. |- | {{Code2|[NOTICE] You configured a non-loopback address '10.152.152.10:9179' for SocksPort. This allows everybody on your local network to use your machine as a proxy. Make sure this is what you wanted. [1 duplicate hidden]}} (Or another port number or DnsPort or TransPort.) | Tor really listens on that IP/port. It is {{project_name_gateway_short}} network interface and is only available to {{project_name_workstation_long}}. This restriction is enforced by an internal network with {{project_name_workstation_long}}(s) and because {{project_name_gateway_short}} is firewalled; see ''{{W_Firewall}}'' or the {{project_name_short}} source code for more information. |- | {{Code2|[NOTICE] New control connection opened. [2 duplicates hidden]}} (Or more duplicates.) | This is caused by [https://www.kicksecure.com/wiki/Systemcheck systemcheck]'s Tor Bootstrap Status Test, which uses Tor's ControlPort or [[Dev/onion-grater|CPFP]]. |- | {{Code2|[NOTICE][NYX_WARN] The torrc differ from what tor's using. You can issue a sighup to reload the torrc values by pressing x. Configuration value is missing from the torrc: RunAsDaemon}} | Nyx usability bug. https://gitlab.torproject.org/legacy/trac/-/issues/16459 The issue was closed as 'not a bug' several years ago. |- | {{Code2|"192.168.0.1 UNKNOWN 1 / Guard" in circuit information}} | This indicates that you are connecting to the Tor network with a [[Bridges|Tor Bridge]]. If you are directly connecting to the public Tor network without a Tor Bridge, the real IP and Nickname of the Guard should be visible instead. https://forums.whonix.org/t/how-to-check-if-i-configured-bridges-correctly-and-the-bridges-are-working-properly/4371/5 |- |} == Nyx Autostart == Optional. '''1.''' Platform specific notice: * Non-Qubes-Whonix: No special notice. * Qubes-Whonix: Inside Template. '''2.''' Symlink start menu entry to autostart. {{CodeSelect|code= sudo ln -s /usr/share/applications/gateway-nyx.desktop /etc/xdg/autostart/gateway-nyx.desktop }} '''3.''' Done. Nyx should now autostart after the next reboot. = Onion Circuits =
Onion Circuits is a GTK+ application to display Tor circuits and streams. It allows the user to inspect the circuits the locally running Tor daemon has built, along with some metadata for each node.
https://packages.debian.org/{{Stable project version based on Debian codename}}/onioncircuits [https://packages.debian.org/{{Stable project version based on Debian codename}}/onioncircuits Onion Circuits] is installed by default, but is not a full Tor controller; only Tor circuits are shown. It can be launched from the start menu. = New Identity and Tor Circuits = The behavior of "New Identity" in the context of Tor Browser and nyx is often misunderstood. First of all, there are various ways to issue a "New Identity" (this list is not exhaustive): * [[Tor_Browser#New_Identity_Function|Tor Browser New Identity Function]] * [[#Nyx|nyx]] * [[#tor-ctrl|tor-ctrl]] * [[#netcat|netcat]] In all cases, the "New Identity" function sends the protocol command SIGNAL newnym to [[Tor]]'s ControlPort. [[Tor Browser]]'s new identity function additionally clears the browser state, closes tabs and obtains a fresh Tor circuit for future requests. https://blog.torproject.org/torbutton-141-released Other Tor controllers such as nyx run only SIGNAL newnym. {{mbox | image = [[File:Ambox_warning_pn.svg.png|40px]] | text = '''Warning:''' The New Identity feature will ''likely'' create a new circuit with a different Tor exit relay and [[Data_Collection_Techniques#IP_Address|IP Address]], but this is not guaranteed. }} The impact of "signal newnym" on Tor circuit lifetimes is often misunderstood. "signal newnym" uses a fresh circuit for ''new'' connections. Sometimes Tor only replaces the middle relay while using the same Tor exit relay. This is by design and the Tor default. Further, "signal newnym" does not interfere with long-lived connections like an file downloads, website downloads, SSH or IRC connections. Interested readers can verify the effect of "signal newnym" as follows: # Open https://check.torproject.org in Tor Browser. # Issue "signal newnym" using [[#Nyx|nyx]]. # Reload https://check.torproject.org. # In some cases it will still show the same IP address, probably because the browser did not close the connection to https://check.torproject.org in the first place. Now repeat this experiment with a small modification which should result in a new Tor exit IP address: # Open https://check.torproject.org in Tor Browser. # Issue "signal newnym" using [[#Nyx|nyx]]. # Close Tor Browser, then restart it. # Open https://check.torproject.org again and a new Tor exit relay IP address is (likely) visible. New identity is not an IP selection or cycling feature. It is a circuit changer. Not an IP changer. Tor replaces your real external IP address with a Tor IP but it does not easily let users pick any specific IP. Tor chooses the IP. Whonix does not influence that. [[unspecific|This is unspecific to Whonix.]] Forcing an IP change might be possible. This is discouraged as per [[Tor#Tor_Routing_Algorithm|Tor Routing Algorithm]]. By changing Tor configuration, selection of specific IPs might be possible. This is [[unsupported]] and the user would need to [[Tor#Edit_Tor_Configuration|edit the Tor configuration]]. Which settings specifically, the user would need to research as per [[Self Support First Policy]], not by asking in Whonix forums. == tor-ctrl == [https://github.com/Kicksecure/tor-ctrl tor-ctrl] is installed by default. For example, to get a new circuit, run. {{CodeSelect|code= tor-ctrl signal NEWNYM }} The output should show:
250 OK
Repeat this command every time a new circuit is desired. See also: {{CodeSelect|code= man tor-ctrl }} = Alternatives = {{mbox | type = notice | image = [[File:Ambox_notice.png|40px|alt=Info]] | text = Advanced users only. }} == Talking to the real Tor Controller == To talk to the real Tor Controller, you should run the commands on the {{project_name_gateway_short}}, as the {{project_name_workstation_short}}, the connection goes through the [https://www.whonix.org/wiki/Onion-grater onion-grater controller proxy] and some commands might be filtered. On {{project_name_gateway_short}}. {{Code2|test}} is the example password being used. Feel free to use a different/stronger one.
tor --hash-password test
Will show something like this:
16:1CEAF6E6A08E0CF460AFD71772461C5F56BD9738FA8824B882FCA4A785
{{Open /usr/local/etc/torrc.d/50_user.conf}}
HashedControlPassword 16:1CEAF6E6A08E0CF460AFD71772461C5F56BD9738FA8824B882FCA4A785
{{Reload_Tor}}
sudo service tor reload
Connect to Tor's Controller:
sudo -n -u debian-tor socat - UNIX-CONNECT:/var/run/tor/control
Authenticate:
authenticate "test"
Should reply the following if successful:
250 OK
Test your commands. For example, start logging stream events:
setevents stream
Will do nothing after this, but when you start using Tor (i.e. by running Tor Browser, APT or so), it will show the stream events similar to the example below:
650 STREAM 211 NEW 0 pop.riseup.net:995 SOURCE_ADDR=10.152.152.11:47036 PURPOSE=USER
...
{{project_name_short}} has a wrapper called tor-ctrl to communicate directly with tor's controller. By using it, you don't have to worry about authentication method, or which program to use to connect to the socket, or which program to use to convert the cookie to base32. As the intent of this section is to teach how to communicate without external programs, this is mentioned at last. If you wish to accomplish the same as above, you can do so with tor-ctrl -w setevents stream. == netcat == netcat is no longer required. [[#tor-ctrl|tor-ctrl]] is recommended instead. netcat provides an easy way to send Tor protocol commands to Tor's ControlPort form inside {{project_name_workstation_short}}. Actually for security reasons to onion-grater, the [[Dev/onion-grater|Tor Control Protocol Filter Proxy]]. {{Box|text= Inside {{project_name_workstation_short}}. '''1.''' Install netcat. {{CodeSelect|code= sudo apt install netcat-openbsd }} '''2.''' Connect to Tor's ControlPort. This works in {{project_name_workstation_short}}, because the [https://github.com/{{project_name_short}}/anon-ws-disable-stacked-tor anon-ws-disable-stacked-tor] package has set up listening for connections on localhost and forwards them to {{project_name_gateway_short}}, where the [[Dev/onion-grater|onion-grater (Control Port Filter Proxy)]] is listening. {{CodeSelect|code= nc 127.0.0.1 9051 }} '''3.''' Example command to change the Tor circuit. {{CodeSelect|code= signal newnym }} The output should be.
250 OK
}} == tor-prompt == On {{project_name_gateway_short}}, run. Example tor-prompt in non-interactive mode. {{CodeSelect|code= tor-prompt --no-color --run "getinfo consensus/valid-until" }} Example tor-prompt in interactive mode. On {{project_name_gateway_short}}, run. {{CodeSelect|code= tor-prompt }} Will be greeted with the following or similar introduction message.
Welcome to Stem's interpreter prompt. This provides you with direct access to
Tor's control interface.

This acts like a standard python interpreter with a Tor connection available
via your 'controller' variable...

  >>> controller.get_info('version')
  '0.2.5.1-alpha-dev (git-245ecfff36c0cecc)'

You can also issue requests directly to Tor...

  >>> GETINFO version
  250-version=0.2.5.1-alpha-dev (git-245ecfff36c0cecc)
  250 OK

For more information run '/help'.

>>>
Run any Tor control protocol command. For example GETINFO version. Replace GETINFO version with the actual command intended to run. {{CodeSelect|code= GETINFO version }} Should show something similar to.
  250-version=0.2.5.1-alpha-dev (git-245ecfff36c0cecc)
  250 OK
= Deprecated = == Vidalia == {{mbox | image = [[File:Ambox_warning_pn.svg.png|40px]] | text = Vidalia is no longer maintained. }} {{Anchor|Vidalia_recommended_against}} Vidalia is recommended against because development has ceased, leading to it being removed from all Debian variants (stretch, sid etc.) as well as from Tor Browser Bundle v3.5 by The Tor Project. https://tor.stackexchange.com/questions/1075/what-happened-to-vidalia As noted by Tor developer Roger Dingledine:
Cammy is right -- we've removed the bridge/relay/exit bundles from the download page too, since Vidalia has been unmaintained for years and pointing people to unmaintained software is dangerous. I'd love to have enough developers to do everything at once, but we don't.
Vidalia had a number of limitations, such as an inability to fully control Tor -- it could not stop Tor which came with the Debian package because it is started as user "debian-tor". It also could not edit {{Code2|/usr/local/etc/torrc.d/50_user.conf}} It is unclear whether control commands such as New Identity were correctly processed either. and did not understand obfuscated bridges. Since Vidalia has been deprecated and provides a pretty bad and confusing user experience, it is simply better to use [[#Nyx|nyx]]. Unless the reader is interested in Vidalia's nice network map. = See Also = * [[Tor-ctrl-observer|tor-ctrl-observer - Tor Connection Destination Viewer]] = Footnotes = {{reflist|close=1}} {{Footer}} [[Category:Documentation]]