A Bash tool that creates an isolated network namespace for cybersecurity lab work on Linux. Your scans, exploits, and lab traffic stay locked inside a sandbox — they can never reach the internet or your school network.
When you're learning penetration testing, you run tools like Nmap, Metasploit, and Burp Suite against vulnerable VMs. If those tools accidentally hit the wrong network, that's a bad day. HackNet puts a wall around your lab traffic so that can't happen.
HackNet uses Linux network namespaces — think of it like putting your lab network adapter inside a locked room. Only tools running inside that room can talk to your lab VMs. Everything else on your system (browser, email, etc.) keeps using the internet normally.
- You pick which network adapter connects to your VirtualBox lab
hn-startmoves that adapter into an isolated namespace- A red-prompt terminal opens — anything you run there is contained
hn-stopunlocks the room and puts everything back to normal
- Linux (tested on Kali and Debian)
- VirtualBox with a host-only or internal lab network
- Root/sudo access
iproute2,NetworkManager, and a DHCP client (dhcpcdordhclient)
sudo ./hacknet.sh installFollow the prompts to select your lab and internet interfaces.
| Command | What it does |
|---|---|
hn-start |
Start the isolated lab environment |
hn-stop |
Stop and restore your network to normal |
hn-status |
Check isolation, connectivity, and DNS |
hn-panic |
Emergency hard-reset if something breaks |
hn-help |
Show detailed usage docs |
sudo ./hacknet.sh uninstall| Problem | Fix |
|---|---|
| Can't reach lab VMs | Is VirtualBox running? Is the DHCP VM on? |
| Lost internet | Run hn-stop, then sudo systemctl restart NetworkManager |
| Interface missing | Run hn-panic or reboot |
Early / testing phase — use at your own risk. Feedback and bug reports welcome.