Home » Tools » Automatically Change Your IP Address Every 3 Seconds

Automatically Change Your IP Address Every 3 Seconds on Kali Linux with Tor + TorNet (Red-Team OPSEC Edition – Pipx Clean Install)

This content is STRICTLY EDUCATIONAL. Only perform these actions on systems you OWN or have EXPLICIT WRITTEN PERMISSION to test. Unauthorized access is a crime under CFAA and equivalent laws worldwide. Use isolated lab environments only (VirtualBox/VMware + Kali Linux VM + snapshot before starting). Never use these techniques outside authorized red-team exercises, CTFs, or defensive privacy training. This guide teaches safe anonymous browsing and IP rotation for educational purposes.

Why This Technique Matters

In red-team operations, frequently rotating your public IP breaks correlation attacks, evades basic logging/geo-fencing, and demonstrates real-world OPSEC. Tor provides layered anonymity. TorNet forces fresh exit nodes with a single command. We use pipx (Kali’s official 2026 recommendation) for a clean, isolated Python install.

Prerequisites

  • Fresh Kali Linux 2026 VM (take a snapshot now)
  • Stable internet
  • Firefox (pre-installed)
  • sudo access

Full Step-by-Step Instructions

  1. Update Kali Linux
    Bash
     
    sudo apt update && sudo apt full-upgrade -y
     
     

    What this does: Refreshes package lists and upgrades every installed package to the latest version. Why we need it: Guarantees Tor and pipx are the newest, most secure versions with all patches applied. Reboot if the system prompts you: sudo reboot.

  2. Install Tor
    Bash
     
    sudo apt install tor -y
     
     

    What this does: Downloads and installs the official Tor daemon from Kali repositories. Why we need it: Tor is the core engine that routes traffic through volunteer relays to hide your real IP.

  3. Start, Enable, and Verify Tor Service
    Bash
     
    sudo systemctl start tor
    sudo systemctl enable tor
    sudo systemctl status tor
     
     

    What this does: Starts Tor now, sets it to auto-start on boot, and displays current status. Why we need it: Tor must be running before any traffic can be routed through it. Expected output: Active: active (running) — press q to quit.

  4. Enable Tor Control Port (Required for IP Rotation)
    Bash
     
    sudo nano /etc/tor/torrc
     
     

    Scroll to the very bottom and add these two lines exactly:

    text
     
    ControlPort 9051
    CookieAuthentication 1
     
     

    Save & exit (Ctrl+O → Enter → Ctrl+X). Restart Tor:

    Bash
     
    sudo systemctl restart tor
    sudo systemctl status tor
     
     

    What this does: Opens a secure control channel on port 9051 and enables cookie authentication. Why we need it: TorNet uses this channel to send the NEWNYM signal that forces a brand-new circuit and new public IP.

  5. Install pipx (Kali’s Recommended Clean Tool Manager)
    Bash
     
    sudo apt install pipx -y
     
     

    What this does: Installs pipx from the official apt repositories. Why we need it: pipx creates isolated virtual environments for every Python CLI tool, preventing the “externally-managed-environment” error and keeping your system clean.

  6. Install TorNet via pipx (Clean Primary Method)
    Bash
     
    pipx install tornet
    pipx ensurepath
     
     

    What this does: Downloads TorNet into its own isolated environment and adds the tornet command to your PATH. Why we need it: TorNet is not packaged in Kali’s apt repos. This is the official, safest way. Close the current terminal and open a new terminal (or run source ~/.bashrc).

  7. Add Your User to the debian-tor Group
    Bash
     
    sudo usermod -aG debian-tor $USER
     
     

    What this does: Grants your normal user account permission to read Tor’s control cookie file. Why we need it: Allows tornet to communicate with Tor without using sudo every time. Important: Log out completely and log back in (or reboot the VM) for the group change to take effect.

  8. Run TorNet Auto-Fix (One-Time)
    Bash
     
    tornet --auto-fix
     
     

    What this does: Automatically installs/upgrades Stem and any missing dependencies TorNet needs. Why we need it: Prevents “module not found” errors on first run.

  9. Configure Firefox for Tor (SOCKS5 Proxy)
    1. Open Firefox
    2. Menu (☰) → Settings
    3. Scroll to bottom → Network Settings → Settings…
    4. Select Manual proxy configuration
    5. Enter:
      • SOCKS Host: 127.0.0.1
      • Port: 9050
      • Select SOCKS v5
      • ✅ Tick Proxy DNS when using SOCKS v5
    6. Leave HTTP/SSL/FTP fields empty
    7. Click OKWhat this does: Routes every single Firefox request through the Tor network. Why we need it: Gives you a browser with a constantly changing IP for live demos and safe browsing.
  10. Start Automatic IP Rotation Every 3 Seconds
    Bash
     
    tornet --interval 3 --count 0
     
     

    What this does: Sends a NEWNYM signal every 3 seconds (–interval 3) and runs forever (–count 0). Why we need it: Forces a brand-new Tor exit node (new public IP) on a rapid schedule. Expected live output:

    text
     
    [TorNet] New IP acquired: 185.220.101.XX (Germany)
    [TorNet] Rotating in 3 seconds...
     
     

Live Verification (Perfect for Video)

How to Stop

  • Press Ctrl+C in the TorNet terminal
  • Alternative: tornet –stop
  • Revert Firefox to “No proxy” when finished.

RED-TEAM Usage

Short anonymous OSINT, bypassing simple geo-blocks, or safe C2 testing in authorized engagements. Easily chain with proxychains4 nmap.

WHITE-HAT Ethical Usage & Reporting

Use in client demos to show how easily attackers rotate IPs. Recommend exit-node monitoring, behavioral analytics, and rate-limiting in your reports.

Advanced OPSEC Tips

  • VPN → Tor nesting
  • nyx for live circuit view: sudo apt install nyx && nyx
  • iptables kill-switch for non-Tor traffic

Common Mistakes to Avoid

  • Forgetting to log out/in after adding to debian-tor group
  • Skipping “Proxy DNS when using SOCKS v5” → DNS leak
  • Using interval < 10 s in real operations (circuit build time)
  • Running on bare-metal host instead of VM

Key Lessons Learned

  • Tor + TorNet = simple, powerful IP rotation with one command
  • pipx is the cleanest way to install Python tools on modern Kali
  • 3-second rotation is demo-only; real ops use 30–300 seconds
  • Always verify no leaks

Further Reading

Scroll to Top