This project provides both a command-line interface (CLI) script and a graphical user interface (GUI) to route all your system's network traffic through the Tor network using iptables rules.
- Load Tor iptables rules: Redirects all outgoing traffic through Tor, anonymizing your network activity.
- Flush rules: Restores iptables to their default state, disabling Tor routing.
- Get public IP: Shows your current public IP address (useful to verify Tor is working).
- Refresh circuit: Changes your Tor circuit to get a new exit IP address.
- Toggle: Quickly enable or disable Tor routing.
Run the script as root:
sudo ./better-tor-cli.py --helpExample commands:
sudo ./better-tor-cli.py --load— Load Tor iptables rulessudo ./better-tor-cli.py --flush— Flush rules to defaultsudo ./better-tor-cli.py --ip— Show current public IPsudo ./better-tor-cli.py --refresh— Change Tor circuitsudo ./better-tor-cli.py --toggle— Toggle Tor routing on/off
A graphical user interface (GUI) is now available and is becoming more stable and usable. While still under active development, it provides a friendlier way to use the CLI features. The GUI uses this CLI script under the hood to provide a more user-friendly experience.
- Execute the binary (
better-tor-gui). - Click the big power button to enable or disable Tor routing.
- When prompted, enter your password to authorize the network changes.
Yeah, that's it. :)
- A Linux distro that uses systemd to manage services;
tor;iptablesoriptables-nft;sudo(and a polkit agent if using the GUI version).
iptablesis the traditional Linux firewall tool, whileiptables-nftis a compatibility layer that uses the newer nftables backend. Most modern Linux distributions are migrating to nftables, soiptables-nftis often the default. The script should work with either.- Which should you use?
- Your distro's default one.
- If neither is installed, it is recommended to install
iptables-nft(sudo pacman -S iptables-nft,sudo apt install iptables-nft, or the equivalent for your distro), as it is the most compatible option for modern systems.
Using Tor in this way does not guarantee 100% anonymity or security.
- Misconfiguration, software leaks, or system vulnerabilities may expose your real IP address or other identifying information.
- DNS leaks, application-level leaks, or improper firewall rules can compromise your privacy.
- Some applications may bypass system iptables rules or use protocols not supported by Tor.
- This script is provided as-is, with no guarantee of security or fitness for any particular purpose.
You are solely responsible for your own security and privacy.
- The authors and contributors of this project are not responsible for any consequences, damages, or legal issues resulting from the use or misuse of this script.
- Always review and understand the risks before using tools that modify your network stack or claim to provide anonymity.
Bitcoin:
bc1qnkq7hf6r53fg73jh3awfsn6ydeh87u5cf8hs3g
Ko-fi: https://ko-fi.com/felipefma
Paypal: felipefmavelar@gmail.com
Brazilian Pix: felipefmavelar@gmail.com
Based on the toriptables3 script by Ruped24.

