Skip to content

suuhm/tor-trans.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tor-TRANS.sh

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.

grafik

Features

  • 🎨 Colorful & user-friendly CLI with clear status messages
  • 🔀 Transparent Tor routing with iptables redirection
  • 🔒 IPv6 traffic blocking for privacy
  • 🌐 DNS redirection via dnsmasq
  • 📜 Automatic resolv.conf backup & 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

grafik

Requirements

  • Linux (Debian/Ubuntu recommended)
  • tor
  • iptables and ip6tables
  • dnsmasq
  • curl
  • netcat (nc)

Installation

git clone https://github.com/suuhm/tor-trans.sh
cd tor-trans.sh
chmod +x tor-trans.sh

Usage

Important

At the first start you have to run ./tor-trans.sh init

grafik
./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

Example

# 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

How It Works

  • All outgoing TCP traffic is transparently redirected to Tor's TransPort using iptables
  • All DNS queries are redirected to Tor's DNSPort via dnsmasq
  • IPv6 is optionally blocked to prevent leaks
  • A backup of /etc/resolv.conf is kept and restored when stopped
  • Tor ControlPort can be configured to allow programmatic IP renewal

Security Notes

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

License

MIT License – feel free to modify and share.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages