π§ TorForge
Advanced Transparent Tor Proxy with AI-Powered Security
Route all system traffic through Tor with military-grade security features
π Overview
TorForge is a production-ready transparent Tor proxy that routes all system traffic through the Tor network. Unlike traditional Tor setups, TorForge operates at the kernel level using iptables, ensuring zero application configuration and complete traffic capture.
Key Highlights
- Zero-config transparent proxying - Works with any application
- 10,000+ lines of Go - Production-quality codebase
- 10 internal packages - Modular architecture
- AI-powered optimization - Smart circuit selection and split-tunneling
- Post-quantum ready - CRYSTALS-Kyber768 encryption
β¨ Features
Core Fuβ¦
π§ TorForge
Advanced Transparent Tor Proxy with AI-Powered Security
Route all system traffic through Tor with military-grade security features
π Overview
TorForge is a production-ready transparent Tor proxy that routes all system traffic through the Tor network. Unlike traditional Tor setups, TorForge operates at the kernel level using iptables, ensuring zero application configuration and complete traffic capture.
Key Highlights
- Zero-config transparent proxying - Works with any application
- 10,000+ lines of Go - Production-quality codebase
- 10 internal packages - Modular architecture
- AI-powered optimization - Smart circuit selection and split-tunneling
- Post-quantum ready - CRYSTALS-Kyber768 encryption
β¨ Features
Core Functionality
| Feature | Description |
|---|---|
| Transparent Proxy | All TCP/DNS traffic automatically routed through Tor |
| Kill Switch | Default DROP policy prevents any IP leaks |
| IPv6 Blocking | Complete IPv6 leak protection |
| ICMP Blocking | Ping requests blocked to prevent leaks |
| Multi-Circuit | Concurrent circuit support for better performance |
| Auto-Rotation | Automatically change exit IP on schedule |
π Advanced Security
| Feature | Description |
|---|---|
| Post-Quantum Encryption | CRYSTALS-Kyber768 (NIST Level 3) β Future-proof against quantum computers |
| Steganography Mode | Traffic mimics YouTube/Netflix streaming to defeat DPI |
| Decoy Traffic | Injects fake requests to frustrate traffic analysis |
| Dead Manβs Switch | Panic key for instant emergency shutdown with trace wiping |
π€ AI-Powered
| Feature | Description |
|---|---|
| Smart Circuit Selection | AI learns optimal exit nodes based on latency/bandwidth |
| Split-Tunnel Learning | Automatic routing decisions based on app behavior |
| Performance Optimization | Adapts to network conditions in real-time |
π Censorship Circumvention
| Feature | Description |
|---|---|
| Bridge Auto-Discovery | Finds working bridges when Tor is blocked |
| Censorship Detection | Automatically detects if Tor is being blocked |
| Pluggable Transports | obfs4, Snowflake, meek-azure support |
π¦ Installation
Prerequisites
# Debian/Ubuntu/Kali
sudo apt update
sudo apt install -y tor iptables make gcc
# Fedora/RHEL
sudo dnf install tor iptables make gcc
# Arch Linux
sudo pacman -S tor iptables make gcc
Build from Source
git clone https://github.com/jery0843/torforge.git
cd torforge
make build
Install System-wide
sudo make install
Enable Auto-Start (systemd)
sudo torforge install-systemd
sudo systemctl enable torforge
Uninstall
# Stop TorForge if running
sudo torforge stop
# Remove binary
sudo rm /usr/local/bin/torforge
# Remove configuration
sudo rm -rf /etc/torforge
# Remove runtime data
sudo rm -rf /var/lib/torforge
# Remove logs
sudo rm -rf /var/log/torforge
# Remove systemd service (if installed)
sudo systemctl disable torforge
sudo rm /etc/systemd/system/torforge.service
sudo systemctl daemon-reload
π― Quick Start
# Start with default settings
sudo torforge tor
# Start with 8 circuits
sudo torforge tor -n 8
# Check status
sudo torforge status
# Request new exit IP
sudo torforge new-circuit
# Stop and restore network
sudo torforge stop
π Command Reference
Available Commands
| Command | Description |
|---|---|
tor | Start transparent Tor proxy |
status | Show live status dashboard |
stop | Stop proxy and restore network |
new-circuit | Request new Tor identity |
ai | Manage AI-powered features |
app | Run single command through Tor |
test | Run leak detection tests |
install-systemd | Install as system service |
torforge tor β Start Proxy
sudo torforge tor [flags]
| Flag | Short | Description | Default |
|---|---|---|---|
--circuits | -n | Number of concurrent circuits | 4 |
--post-quantum | CRYSTALS-Kyber768 encryption | off | |
--rotate-circuit | Auto-rotate every N minutes | 0 | |
--decoy-traffic | Generate N% fake traffic (0-100) | 0 | |
--stego | Steganography mode (mimic streaming) | off | |
--panic-key | Dead manβs switch key (e.g., F12) | none | |
--auto-bridge | Auto-discover bridges if blocked | off | |
--exit-nodes | -e | Preferred exit countries (US,DE) | any |
--bypass | -b | Bypass patterns (*.local) | none |
--speed | -s | Bandwidth limit (100Mbps) | none |
--no-kill-switch | -k | Disable kill switch | off |
--use-system-tor | -S | Use existing Tor instance | off |
--daemon | -d | Run as background daemon | off |
Examples
# Basic usage
sudo torforge tor -n 8
# Maximum security
sudo torforge tor --post-quantum --rotate-circuit 10 -n 8
# Anti-analysis mode
sudo torforge tor --decoy-traffic 50 --stego -n 8
# With panic key
sudo torforge tor --panic-key F12 -n 8
# Full featured
sudo torforge tor \
--post-quantum \
--rotate-circuit 5 \
--decoy-traffic 30 \
--stego \
--panic-key F12 \
-n 8
torforge status β Live Dashboard
sudo torforge status
Output:
π§
TorForge Status
ββββββββββββββββββ
Status: β
ACTIVE
Exit IP: 185.220.101.15
Circuits: 14 active
Commands:
torforge new-circuit β Get new exit IP
torforge stop β Stop TorForge
torforge ai β AI Management
# View learning statistics
sudo torforge ai stats
# Reset learned data
sudo torforge ai reset
# Add domain to bypass list (direct connection)
sudo torforge ai bypass streaming.example.com
# Mark domain as sensitive (always Tor)
sudo torforge ai sensitive secret.example.com
torforge app β Single App Through Tor
# Run Firefox through Tor
sudo torforge app firefox
# Run curl through Tor
sudo torforge app curl https://check.torproject.org/api/ip
# Run any command
sudo torforge app wget https://example.com/file.zip
torforge test β Leak Detection
sudo torforge test
Performs comprehensive tests:
- DNS leak detection
- IP leak detection
- WebRTC leak detection
- IPv6 leak detection
π Security Features
Post-Quantum Encryption
Uses CRYSTALS-Kyber768 from Cloudflareβs CIRCL library:
- NIST Level 3 security
- 192-bit quantum resistant
- AES-256-GCM symmetric layer
- New keys each session
π§
TorForge Active
π Post-Quantum: CRYSTALS-Kyber768 ACTIVE
π NIST Level: 3 | Key ID: a1b2c3d4e5f6g7h8
Dead Manβs Switch
Press the configured key in terminal:
π¨ PANIC KEY PRESSED!
π¨ DEAD MAN'S SWITCH TRIGGERED - EMERGENCY SHUTDOWN
π¨ KILLING ALL NETWORK CONNECTIONS...
β Flushing iptables
β Killing all sockets
β Killing Tor process
β Clearing browser caches
β Wiping RAM caches
β Clearing shell history
emergency exit - all connections terminated
Protection Matrix
| Threat Vector | Protection |
|---|---|
| TCP IP Leak | iptables forces all TCP through Tor |
| UDP IP Leak | UDP blocked except Tor DNS |
| IPv6 IP Leak | IPv6 completely blocked |
| ICMP Leak | Ping blocked |
| DNS Leak | DNS forced through Tor |
| Traffic Analysis | Decoy traffic + steganography |
| Quantum Attack | Post-quantum encryption |
| Kill Switch Fail | Default DROP policy |
| Emergency | Dead manβs switch |
ποΈ Architecture
Package Structure
torforge/
βββ cmd/torforge/ # CLI application (894 lines)
βββ internal/
β βββ ai/ # Circuit selector & split-tunnel (2 files)
β βββ api/ # REST API server
β βββ bridge/ # Bridge auto-discovery
β βββ bypass/ # Smart bypass rules (6 files)
β βββ netfilter/ # iptables management (6 files)
β βββ netns/ # Network namespaces
β βββ proxy/ # Main proxy controller
β βββ security/ # Quantum, decoy, stego, panic (5 files)
β βββ tor/ # Tor process management (3 files)
β βββ ui/ # TUI dashboard
βββ pkg/
βββ config/ # Configuration handling
βββ logger/ # Structured logging
Network Flow
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Application Traffic β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β iptables NAT (PREROUTING/OUTPUT) β
β β Redirect TCP to Tor TransPort (9040) β
β β Redirect DNS to Tor DNS Port (5353) β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β iptables FILTER β
β β Allow Tor process β
β β Allow localhost β
β β Block ICMP β
β β Block non-Tor UDP β
β β DEFAULT DROP (kill switch) β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Tor Network β
β Guard β Middle β Exit β Destination β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βοΈ Configuration
Create /etc/torforge/torforge.yaml:
proxy:
transparent: true
block_udp: true
block_icmp: true
tor:
socks_port: 9050
trans_port: 9040
dns_port: 5353
control_port: 9051
data_dir: /var/lib/torforge
num_circuits: 8
security:
kill_switch: true
block_ipv6: true
ai:
enabled: true
data_dir: /var/lib/torforge/ai
api:
enabled: false
address: 127.0.0.1:8080
π File Locations
| Path | Purpose |
|---|---|
/etc/torforge/torforge.yaml | Configuration |
/var/lib/torforge/ | Runtime data |
/var/lib/torforge/ai/ | AI learning data |
/var/log/torforge/ | Logs |
π§ͺ Development
# Build
make build
# Run tests
make test
# Run linter
go vet ./...
# Clean build
make clean
π License
MIT License - See LICENSE
β οΈ Legal Disclaimer
TorForge is designed for legitimate privacy and security purposes including:
- Protecting personal privacy
- Security research
- Bypassing censorship in restrictive regions
- Anonymous whistleblowing
Users are responsible for complying with applicable laws. The developers assume no liability for misuse.