Skip to content

Tor Integration

Dragon edited this page Dec 23, 2025 · 2 revisions

๐Ÿง… Tor Integration Guide

Complete guide to anonymous browsing with Tor in NaviDuck. Learn how to enable, use, and troubleshoot Tor for maximum privacy.

๐Ÿ“‹ Table of Contents


๐ŸŽฏ What is Tor?

Tor Overview

Tor (The Onion Router) is a free, open-source software that enables anonymous communication by directing internet traffic through a worldwide volunteer network of relays.

Why Use Tor with NaviDuck?

  • Privacy: Hide your browsing activity from ISPs and surveillance
  • Access: Reach websites blocked in your region
  • Security: Encrypt your traffic through multiple layers
  • Research: Access information without geographical restrictions
  • Testing: Check how your site appears from different locations

How NaviDuck Integrates Tor

NaviDuck doesn't bundle Tor but connects to an existing Tor service. You can:

  • Use system-wide Tor
  • Use Tor Browser's Tor instance
  • Let NaviDuck manage Tor automatically
  • Connect to remote Tor services

โšก Quick Start

1-Minute Tor Setup

If you already have Tor running:

# Just enable it in NaviDuck
tor start

If you have Tor Browser installed:

# NaviDuck will auto-detect it
tor start

Complete new user setup:

# Install Tor
# Linux: sudo apt install tor
# Mac: brew install tor
# Windows: Download Tor Browser

# Start Tor in NaviDuck
tor start

# Verify it's working
tor status

Quick Commands Cheat Sheet

tor start      # Start Tor connection
tor stop       # Stop Tor connection
tor status     # Check Tor status
tor restart    # Restart Tor
s <query>      # Search via Tor (when enabled)
go <onion-url> # Visit .onion sites

๐Ÿ“ฆ Installation Guide

Platform-Specific Installation

Windows

Option A: Tor Browser (Recommended for beginners)

  1. Download from torproject.org
  2. Install normally
  3. NaviDuck will auto-detect it
  4. Run tor start in NaviDuck

Option B: Standalone Tor

# Download tor expert bundle
# Extract to C:\tor\
# Add to PATH or set in NaviDuck settings

macOS

Using Homebrew (Recommended)

# Install Tor
brew install tor

# Start Tor service
brew services start tor

# In NaviDuck
tor start

Using Tor Browser

# Download from torproject.org
# Install to Applications
# NaviDuck auto-detects it

Linux

Ubuntu/Debian

# Install Tor
sudo apt update
sudo apt install tor

# Start Tor service
sudo systemctl start tor
sudo systemctl enable tor

# Optional: Run as user (more secure)
sudo usermod -a -G debian-tor $USER
# Log out and back in

# In NaviDuck
tor start

Fedora/RHEL/CentOS

sudo dnf install tor
sudo systemctl start tor
sudo systemctl enable tor
tor start

Arch Linux

sudo pacman -S tor
sudo systemctl start tor
sudo systemctl enable tor
tor start

Verifying Installation

Check Tor is Installed

# Should show Tor version
tor --version

# Or check service
systemctl status tor  # Linux
brew services list    # Mac

Test Tor Connection

# In terminal (not NaviDuck)
curl --socks5 127.0.0.1:9050 https://check.torproject.org/api/ip
# Should return: {"IsTor":true}

Check in NaviDuck

# Main menu shows:
# ๐Ÿง… Tor: ON
# Or run:
tor status

๐Ÿ”ง Basic Usage

Enabling Tor

Manual Start

# Start Tor connection
tor start

# Verify
tor status
# Should show: Tor: Running on port 9050

Auto-start on Launch

(Future feature - currently manual only)

Browsing with Tor

Regular Browsing via Tor

# Tor must be running first
tor start

# Any search or visit now uses Tor
s python tutorial           # Anonymous search
go wikipedia.org           # Anonymous visit
open github.com            # Opens in browser via Tor

Visiting .onion Sites

# Tor automatically handles .onion sites
go duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion
go facebookcorewwwi.onion

Mixed Browsing

# You can switch between Tor and clearnet
tor start
s sensitive query          # Via Tor

tor stop
s normal query             # Via clearnet

Search Engines with Tor

Tor-Compatible Engines

  • DuckDuckGo: Works perfectly with Tor
  • Wikipedia: Accessible via Tor
  • Brave Search: Works with Tor
  • Google: May show CAPTCHA more often

Search via Tor

# All search commands work with Tor
tor start
search ddg privacy tools
search wikipedia anonymous browsing
s latest news

Monitoring Tor Usage

Check Current Status

# Main menu shows Tor status
# Or command:
tor status

# Detailed info (planned feature)
tor info

Connection Statistics

# View Tor usage stats
# (Planned feature - currently basic)

โš™๏ธ Advanced Features

Tor Configuration

Custom Tor Path

If NaviDuck can't auto-detect Tor:

# Set custom path in settings
settings
# Choose option 4 (Set Tor path manually)
# Enter: /path/to/your/tor

Custom SOCKS Port

(Advanced users)

# Edit config file manually
# ~/.naviduck_config.json
{
  "tor_port": 9150,  # Tor Browser uses 9150
  "tor_host": "127.0.0.1"
}

Tor Bridges (Censorship Circumvention)

# Configure in torrc first
# Then NaviDuck will use them automatically

# Example torrc lines:
UseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy
Bridge obfs4 1.2.3.4:1234 cert=abcdef...

Advanced Commands

Tor Circuit Management

# Get new circuit (new identity)
tor newcircuit

# View current circuit
tor circuit

# Force new identity
tor newnym

Tor Logs

# View Tor connection logs
tor logs

# Debug mode
tor debug

Performance Tuning

# Adjust Tor performance
tor fast    # Prefer faster relays
tor safe    # Prefer safer relays
tor balance # Balanced mode

Integration Features

Auto-Tor for Specific Sites

# Automatic Tor for .onion sites
# Already works - no config needed

# Planned: Auto-Tor for specific domains
# tor auto facebook.com
# tor auto wikipedia.org

Tor Isolation

# Isolate different activities
tor start --tag shopping
tor start --tag research
tor start --tag social

Exit Node Selection

# Choose exit country
tor exit us     # Exit from USA
tor exit de     # Exit from Germany
tor exit jp     # Exit from Japan
tor exit random # Random exit

๐Ÿšจ Troubleshooting

Common Problems & Solutions

Problem: "Tor not found"

# Solution 1: Install Tor
# See installation guide above

# Solution 2: Set custom path
settings -> Set Tor path manually

# Solution 3: Check PATH
echo $PATH
# Ensure Tor directory is in PATH

Problem: "Tor failed to start"

# Solution 1: Check if Tor is already running
ps aux | grep tor

# Solution 2: Check ports
netstat -tulpn | grep :9050
# If port 9050 is used, Tor Browser uses 9150

# Solution 3: Run Tor manually first
tor &
# Then in NaviDuck: tor start

Problem: "Connection timeout via Tor"

# Solution 1: Wait and retry
# Tor can be slow sometimes

# Solution 2: Get new circuit
tor newcircuit

# Solution 3: Use different exit
tor exit de  # Try Germany instead

# Solution 4: Disable Tor for now
tor stop

Problem: "CAPTCHA on every site"

# Solution 1: Use Tor-friendly sites
search ddg your_query
go duckduckgo.com

# Solution 2: Get new identity
tor newnym

# Solution 3: Wait and retry later

Problem: "Very slow browsing"

# Solution 1: That's normal for Tor
# Expect 2-10x slower than clearnet

# Solution 2: Use faster relays
tor fast

# Solution 3: Disable Tor for large downloads
tor stop
# Download files
tor start

Error Messages

"Could not connect to Tor"

1. Check Tor is running: `systemctl status tor`
2. Check port: Default is 9050, Tor Browser uses 9150
3. Check firewall: Allow localhost connections

"Permission denied"

# Linux: Add user to debian-tor group
sudo usermod -a -G debian-tor $USER
# Log out and back in

"No route to host"

# Tor service not running
# Start it: sudo systemctl start tor
# Or: tor &

"SOCKS5 connection failed"

# Wrong port or Tor not ready
# Wait 30 seconds after starting Tor
# Verify port: netstat -tulpn | grep :9050

Diagnostic Commands

Basic Diagnostics

# Run in terminal (not NaviDuck)
tor-check
# or
curl --socks5 127.0.0.1:9050 https://check.torproject.org/

Port Testing

# Test SOCKS port
nc -z 127.0.0.1 9050 && echo "Port open" || echo "Port closed"

# Test with curl
curl --socks5 127.0.0.1:9050 http://example.com

Tor Log Analysis

# View Tor logs
journalctl -u tor --no-pager -n 50  # Systemd
# or
tail -f /var/log/tor/log  # Linux

Platform-Specific Issues

Windows Issues

# Tor Browser not detected
# Set path manually: C:\Users\You\Desktop\Tor Browser\Browser\TorBrowser\Tor\tor.exe

# Port 9050 in use
# Tor Browser uses 9150, set in config

macOS Issues

# Homebrew Tor not starting
brew services restart tor

# Permissions
sudo chown $USER /usr/local/var/run/tor

Linux Issues

# AppArmor/SELinux blocking
sudo aa-complain /usr/sbin/tor
# or
sudo setenforce 0  # Temporarily disable SELinux

# Firewall blocking
sudo ufw allow out 9050
sudo ufw allow out 9051

๐Ÿ”’ Security Best Practices

General Security

Don't Mix Identities

# Bad: Switching rapidly
tor start
s "my personal info"
tor stop
s "my work stuff"
# Can link your identities

# Good: Separate sessions
# Session 1: Personal with Tor
# Session 2: Work without Tor
# Or use different circuits

Use HTTPS Always

# Tor + HTTPS = Maximum privacy
go https://example.com  # Good
go http://example.com   # Bad (unencrypted)

Clear Cookies/Session

# NaviDuck doesn't store cookies
# But your system browser might
# Clear browser cookies after Tor sessions

Tor-Specific Security

Circuit Isolation

# Different activities = different circuits
# Planned feature: tor isolate shopping
# Planned feature: tor isolate banking

Entry/Exit Guard Selection

# Use guard nodes for consistency
# (Configured in torrc, not NaviDuck)
EntryNodes {us} StrictNodes 1
ExitNodes {de} StrictNodes 1

Avoid Fingerprinting

# Tor helps, but be aware:
# 1. Don't log into accounts
# 2. Don't use unique browser patterns
# 3. JavaScript can fingerprint
# 4. Screen size/timezone can identify

Privacy Checklist

Before Using Tor

  • Close other browsers/apps
  • Disable browser extensions
  • Use private/incognito mode if using browser
  • Consider VPN + Tor for extra layer

While Using Tor

  • Don't log into personal accounts
  • Don't download files to default locations
  • Don't enable JavaScript unnecessarily
  • Don't resize window uniquely

After Using Tor

  • Clear NaviDuck history if sensitive
  • Close all Tor-related applications
  • Consider restarting computer for paranoids

Advanced Security Configurations

Torrc Configuration

# Recommended torrc additions
AvoidDiskWrites 1
MaxCircuitDirtiness 600
NewCircuitPeriod 600
# See: https://2019.www.torproject.org/docs/tor-manual.html

Pluggable Transports

# For censorship circumvention
# Install obfs4
# Configure in torrc
UseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy

Tails Integration

# Using NaviDuck on Tails OS
# Tor is already running
# Just: tor start in NaviDuck
# Or it auto-detects

โšก Pro Tips

Performance Optimization

Faster Tor Browsing

# 1. Use Tor-friendly sites
search ddg your_query  # Faster than Google via Tor

# 2. Avoid peak hours
# Tor is faster during off-hours in your region

# 3. Use faster exit nodes
tor exit us  # USA nodes often faster

# 4. Disable for large files
tor stop
# Download
tor start

Bandwidth Saving

# 1. Use text-only when possible
# NaviDuck is already text-focused

# 2. Disable images in .onion sites
# (Manual in page source)

# 3. Use compression
# Tor already compresses, but you can't control

Workflow Integration

Research Workflow

# 1. Initial research via Tor
tor start
s "sensitive topic"
# Get overview anonymously

# 2. Deep dive clearnet
tor stop
s "specific technical details"
# Faster access to resources

# 3. Documentation via Tor
tor start
go docs.onion.site
# Access restricted docs

Development Workflow

# 1. Check site accessibility
tor start
go myapp.com
# See if blocked in any regions

# 2. Test geo-restricted features
tor exit jp
go myapp.com
# Test Japanese version

# 3. Security testing
tor start
# Test your own site's Tor compatibility

Advanced Usage Patterns

Multi-hop Routing

# Not directly in NaviDuck, but you can:
# Configure in torrc:
NumEntryGuards 3
NumDirectoryGuards 3

Geographic Testing

# Test site from different countries
tor exit us && go example.com
tor exit de && go example.com  
tor exit jp && go example.com
tor exit ru && go example.com

Timing Analysis

# Compare load times
time curl --socks5 127.0.0.1:9050 http://example.com
time curl http://example.com
# See Tor overhead

Tool Integration

With Privacy Tools

# Use with VPN for extra layer
# 1. Connect VPN
# 2. Start Tor in NaviDuck
# 3. Browse with VPN+Tor

# Use with firewall
# Block all non-Tor traffic while Tor is active

Scripting with Tor

# Automate Tor browsing
#!/bin/bash
tor &
sleep 10
python naviduck.py << EOF
tor start
s "automated search"
quit
EOF

Monitoring Tools

# Monitor Tor bandwidth
nyx    # Terminal Tor monitor
arm    # Another terminal monitor
# Or web: tor://127.0.0.1:9051

Educational Uses

Learning About Tor

# Explore Tor ecosystem
go duckduckgo.com  # Via Tor
s "how tor works"
s "tor relay types"
s "onion services"

Teaching Privacy

# Demonstrate differences
tor stop && s "my ip"  # Shows your IP
tor start && s "my ip" # Shows Tor exit IP

Research Applications

# Academic research
tor start
s "privacy studies"
s "anonymity metrics"
s "tor network analysis"

๐Ÿ“Š Statistics & Metrics

Tor Usage Statistics

# View in main menu
# ๐Ÿง… Tor: ON
# Or planned: tor stats

Performance Metrics

  • Connection latency
  • Bandwidth usage
  • Circuit build time
  • Success/failure rates

Privacy Metrics

  • IP address changes
  • Geographic distribution
  • Connection stability

๐Ÿ”ฎ Future Features

Planned Enhancements

  • Auto-Tor: Automatic Tor for sensitive searches
  • Circuit control: GUI for circuit management
  • Performance tuning: Adaptive speed/security balance
  • Multi-Tor: Multiple Tor instances simultaneously
  • Integration: Built-in Tor installation/updates
  • Monitoring: Real-time Tor network stats
  • Isolation: Per-tab circuit isolation

Community Requests

  • Streaming support: Tor-optimized media
  • Download manager: Tor-friendly downloads
  • Bridge automation: Auto-bridge configuration
  • Meek integration: Censorship circumvention
  • Snowflake support: Volunteer-based bridging

๐Ÿ“š Related Resources

Official Resources

Learning Resources

External Tools

  • NyX: Tor terminal monitor
  • OnionShare: File sharing over Tor
  • Tails: Privacy-focused OS
  • Whonix: Tor-focused workstation

๐Ÿ’ก Final Wisdom

Golden Rules for Tor Usage

  1. Patience is key - Tor is slower by design
  2. HTTPS always - Tor protects the route, HTTPS protects content
  3. No logging in - Don't connect Tor activity to your identity
  4. Regular updates - Keep Tor software current
  5. Community support - Run a relay if you can

Remember:

"Tor is a tool, not a magic cloak. Use it wisely, understand its limits, and contribute back to the network."


โ“ Tor FAQ

Q: Is Tor legal? A: Yes, in most countries. Some restrict it, so check local laws.

Q: Does Tor make me completely anonymous? A: No Tor provides perfect anonymity. Tor is very good but has limits.

Q: Can I be tracked while using Tor? A: It's difficult but not impossible for powerful adversaries.

Q: Why is Tor so slow? A: Your traffic routes through multiple volunteers worldwide. This is by design.

Q: Should I use VPN with Tor? A: VPN+Tor adds complexity. For most, Tor alone is sufficient.

Q: Can I torrent over Tor? A: Please don't. It slows the network for everyone and isn't what Tor is for.

Q: How do I report Tor abuse? A: See: https://community.torproject.org/relay/community-resources/abuse/

Q: Can I run a Tor relay? A: Yes! Help the network: https://community.torproject.org/relay/


"Privacy is not about having something to hide. It's about having something to protect."

# Try Tor now:
tor start
s "what is my ip"
# See the difference

Stay safe, browse freely! ๐Ÿง…๐Ÿ”’


Last updated: 12/22/2025
Tor Integration Guide version: 3.1

Clone this wiki locally