Anonsurf routes all your system traffic through Tor via iptables — handy when you want system-wide anonymity without configuring individual apps. Here's how I got it set up on Kali.
Installation
Create a directory for it, clone the repo, then run the installer as root:
mkdir Anonsurf && cd Anonsurf
git clone https://github.com/Und3rf10w/kali-anonsurf
cd kali-anonsurf
sudo ./installer.sh
The installer pulls in Tor, torsocks, i2p, secure-delete and a few other dependencies. Takes a couple of minutes. One thing to watch — when I first ran sudo ./installer.sh from the parent directory it threw a "command not found" error. You need to be inside the kali-anonsurf folder itself.
Usage
Once installed, all the commands need to run as root:
# Start routing traffic through Tor
sudo anonsurf start
# Check it's running
anonsurf status
# Change your Tor identity (get a new exit node)
sudo anonsurf change
# Stop and restore normal traffic
sudo anonsurf stop
# Restart
sudo anonsurf restart
# Check your current IP (use with caution)
anonsurf myip
When you run start it kills potentially identifying background apps, disables IPv6, starts Tor, saves your existing iptables rules, and redirects everything through the Tor network. The stop command restores everything back to normal.
Checking it worked
After starting, run anonsurf status — you should see the Tor service active. The output will look something like this:
● tor.service - Anonymizing overlay network for TCP (multi-instance-master)
Loaded: loaded (/usr/lib/systemd/system/tor.service; disabled)
Active: active (exited) since Sun 2026-07-19 10:14:08 AEST
You can also confirm your traffic is going through Tor by browsing to check.torproject.org — it'll tell you straight away whether you're connected to the Tor network or not.
Stopping Anonsurf
When you're done, sudo anonsurf stop cleans everything up — deletes the iptables rules, restores your original ones, and re-enables IPv6:
sudo anonsurf stop
* killing dangerous applications
* cleaning some dangerous cache elements
[ i ] Stopping anonymous mode:
* Deleted all iptables rules
* Iptables rules restored
[ i ] Reenabling IPv6 services:
Failed to forcibly reenable IPv6
IPv6 successfully enabled
* Anonymous mode stopped
Worth noting — the "Failed to forcibly reenable IPv6" message looks alarming but the next line confirms it enabled fine. Seems to be a quirk of the script rather than an actual failure.
A couple of gotchas
- Running
anonsurf startwithoutsudowill throw a "must be run as root" error even though the status command works without it - The
myipcommand is flagged as risky in the help output — it makes a network request to check your IP which could potentially leak information depending on how it's implemented - i2p services are available separately via
sudo anonsurf starti2pandsudo anonsurf stopi2pif you need them