Skip to content
Projects

cristiancmoises/torando has 32 GitHub stars and 3 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-09 16:38 UTC. Last push 2026-09-06.

How these counts are measured

Tor VPN

Measured star growth

in 24h
0
in 7 days
0
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Torando

Torando routes one Linux user's IPv4 TCP connections through Tor and blocks other outgoing traffic for that user. It is a small command-line tool for people who already run Tor and want to turn routing on and off without editing firewall commands by hand.

Torando-Gui is the GUI for Torando. It provides a desktop interface, connection status, exit checks and settings. It installs its own daemon; you do not need to install these scripts first. Use one controller at a time for a given user.

Português · FreeBSD · Security

What's new in 2.0.1

Interrupted firewall updates now show the same recovery instructions as failed commands. This covers Ctrl+C, a closed terminal, termination signals and errors while inspecting rules during an update. Any blocking guards already installed stay in place so you can check the state and finish cleanup with toroff.sh.

The per-user routing, custom ports and status checks introduced in 2.0.0 remain available. If you still use the original scripts containing USERAQUI, read the upgrade notes below before switching.

Before you start

You need Linux, Bash, iptables, ip6tables unless IPv6 is disabled at kernel boot, flock from util-linux, pgrep from procps, and a Tor service running under a separate account. Run the scripts through sudo from your normal login. Root and known Tor service accounts cannot be selected as the target.

On Debian or Ubuntu, install the packages with:

sudo apt update
sudo apt install tor iptables util-linux procps

Install the equivalent packages with your distribution's package manager on other systems. These scripts do not install or start Tor for you.

Configure Tor

Edit your service's torrc (usually /etc/tor/torrc) and add or update these settings once:

SocksPort 127.0.0.1:9050
TransPort 127.0.0.1:9040
DNSPort 127.0.0.1:5353
VirtualAddrNetworkIPv4 10.192.0.0/10
AutomapHostsOnResolve 1

Keep the listeners on loopback. Check the configuration, then restart Tor using your distribution's service manager. For a typical systemd installation:

sudo tor --verify-config -f /etc/tor/torrc
sudo systemctl restart tor

Tor's DNS listener handles UDP A, AAAA and PTR queries. The Tor manual explains the listener and virtual-address options.

Torando redirects the selected user's IPv4 UDP queries on port 53 to the local Tor DNS listener, including queries addressed to a loopback DNS stub. It does not edit /etc/resolv.conf or make files immutable. DNS requests delegated over a Unix socket to a resolver running as another user are outside these per-user rules; check how your system resolves names before relying on this setup.

Connect, check and disconnect

Close applications with existing network connections before enabling. Existing UDP DNS sockets can retain a conntrack mapping to your old resolver, including a loopback stub. Reopen the applications after the rules are installed.

git clone https://github.com/cristiancmoises/torando.git
cd torando
./torando.sh --version
sudo ./torando.sh
sudo ./torando.sh --status

Without --user, Torando selects the user who invoked sudo. From a root shell, choose the target explicitly:

sudo ./torando.sh --user alice
sudo ./torando.sh --status --user alice
sudo ./toroff.sh --user alice

To disconnect your own login:

sudo ./toroff.sh

If your Tor listeners use different ports, pass matching values when enabling:

sudo ./torando.sh --trans-port 9041 --dns-port 5354

Run ./torando.sh --help for the available options. Status checks inspect the firewall rules; they do not prove that Tor has bootstrapped or that a remote request used Tor. Exit codes are 0 for enabled, 3 for disabled, and 2 for an incomplete or modified ruleset.

From a terminal owned by the selected user, open a fresh connection to check routing:

curl --noproxy '*' https://check.torproject.org/api/ip

Look for "IsTor": true. Run this without sudo and without a SOCKS option: a SOCKS request would test the proxy separately from Torando's redirect rules. Torando-Gui also offers a SOCKS exit check and clearly reports its scope.

What is covered

The rules cover locally generated traffic owned by the selected UID in the current network namespace. IPv4 TCP goes to Tor, IPv4 UDP/53 goes to its DNS listener, and other external IPv4 traffic is blocked. External IPv6 is blocked, not redirected. UDP applications such as QUIC and many games may stop working.

Loopback remains available. Local proxies, services running under other users, containers in other network namespaces, and root processes need their own controls. Existing connections may need to be reopened after enabling. Firewall managers that reload their rules can remove or reorder Torando's hooks; check status again after such a reload. The scripts do not persist rules across reboot.

Torando changes routing, not browser fingerprints or account identity. Use HTTPS, keep browser security protections enabled, and do not treat one positive exit check as a guarantee about every application's traffic.

Upgrading and recovery

If you used the original scripts, disable their rules with your old, edited toroff.sh before replacing the checkout. Version 2 only removes its own chains; it deliberately leaves those older rules alone. The default Tor DNS port is now 5353, so update torrc or pass --dns-port 53 for your existing listener.

If you made /etc/resolv.conf immutable using the old guide, remove that flag with sudo chattr -i /etc/resolv.conf and restore your distribution's normal resolver configuration. Do not replace a managed symlink blindly. You no longer need the old browser changes that disabled malware protection.

After a failed or interrupted enable or disable, run sudo ./torando.sh --status and then sudo ./toroff.sh for the same user. A retained guard intentionally blocks that user's outgoing traffic until cleanup succeeds. Resolve any reported firewall error and retry; avoid flushing the whole firewall. Keep a separate administrator session available when changing network rules remotely.

An interrupted update exits with 129 for SIGHUP, 130 for SIGINT (Ctrl+C), or 143 for SIGTERM. A forced kill or power loss cannot print recovery instructions; check the rules after reconnecting if an update did not finish.

Development

The firewall tests use a stateful mock and do not change the host's rules:

python3 -m unittest discover -s tests -v
shellcheck torando.sh toroff.sh lib/torando.sh

For every new version, run the tests, commit the code and documentation, and create a version tag. Publish the tagged source as both .tar.gz and .zip, with a SHA256SUMS file, in matching releases on GitHub, Codeberg, SecurityOps.co and SecurityOps.com.br. Verify each release's downloads before calling it complete. Torando-Gui is the GUI for Torando, and every new GUI release must also include its complete set of supported platform binaries and installer packages on all four hosts.

Torando is licensed under GPL-3.0.

Explore related projects