A user-friendly, colorful, and fully-featured Bash script for managing a transparent Tor proxy on Linux. Includes status reporting, DNS redirection via dnsmasq, IPv6 blocking, Tor ControlPort integration, IP renewal, and easy start/stop/restart commands.
- 🎨 Colorful & user-friendly CLI with clear status messages
- 🔀 Transparent Tor routing with
iptablesredirection - 🔒 IPv6 traffic blocking for privacy
- 🌐 DNS redirection via dnsmasq
- 📜 Automatic
resolv.confbackup & restore - 🔄 Start, stop, restart, and status commands
- 🔑 Tor ControlPort integration:
- Renew Tor IP via signal or ControlPort command
- Initialize Tor config with hashed password
- 🕵 Check your current Tor exit IP
- 💾 Backup of Tor configuration before changes
- Linux (Debian/Ubuntu recommended)
toriptablesandip6tablesdnsmasqcurlnetcat(nc)
git clone https://github.com/suuhm/tor-trans.sh
cd tor-trans.sh
chmod +x tor-trans.sh./tor-trans.sh {command}Available Commands:
| Command | Description |
|---|---|
start |
Start transparent Tor proxy |
stop |
Stop transparent Tor proxy |
restart |
Restart transparent Tor proxy |
status |
Show iptables rules and current Tor IP |
renew |
Request new Tor IP via ControlPort |
init |
Initialize Tor ControlPort configuration |
# Start Tor transparent proxy
./tor-trans.sh start
# Check status
./tor-trans.sh status
# Get a new Tor identity via ControlPort
./tor-trans.sh renew- All outgoing TCP traffic is transparently redirected to Tor's
TransPortusingiptables - All DNS queries are redirected to Tor's
DNSPortviadnsmasq - IPv6 is optionally blocked to prevent leaks
- A backup of
/etc/resolv.confis kept and restored when stopped - Tor ControlPort can be configured to allow programmatic IP renewal
- This script modifies your system's firewall and DNS settings.
- Always review the script before running it on a production machine.
- IPv6 blocking is recommended to prevent leaks.
MIT License – feel free to modify and share.