The Tor Network Toolkit (TNT) is a multi-OS demonstration framework that showcases how to interact with the Tor network programmatically and how to run local packet-crafting operations using Scapy. Tor traffic and Scapy traffic remain strictly separated, as raw ICMP and TCP packets cannot be routed through Tor.
This project is designed for researchers, analysts, and developers who need a clean, minimal, and reproducible demo setup for Tor automation and local network inspection.
- Launches a Tor process with a dedicated data directory
- Full lifecycle control via context manager (startup, controller authentication, cleanup)
- Requests a new Tor identity (NEWNYM)
- Queries the current Tor exit IP
- Performs HTTP requests via Tor (SOCKS5)
- Local ICMP Echo demo via Scapy
- Local TCP SYN demo via Scapy
- Cross-platform privilege detection for raw sockets
-
Python 3.x
-
Tor installed on the system or automatically launched
-
Python packages:
stemrequestspysocksscapy(optional, only required for local demos)
Install all dependencies:
pip install -r requirements.txtDefault run:
python3 tnt.pyModes:
python3 tnt.py --mode tor
python3 tnt.py --mode scapy
python3 tnt.py --mode fullCustom URL:
python3 tnt.py --url https://icanhazip.comNew identity:
python3 tnt.py --new-identityChange Scapy target:
python3 tnt.py --target 1.1.1.1- Starts a Tor instance
- Connects to the control port
- Gets exit IP
- Optional NEWNYM identity change
- Performs an HTTP request through Tor
- ICMP Echo Request (local)
- TCP SYN probe (local)
- Does not use Tor
Runs both Tor and Scapy demos sequentially.
- ICMP and TCP raw packets cannot be routed through Tor
- Raw socket operations require admin/root privileges
- NEWNYM requires a short cooldown
- Tor data directory is isolated (
./tor_data) - Ensure the Tor control port is enabled for external instances
This toolkit is intended for research, education, debugging, and network analysis in controlled environments. It demonstrates Tor automation and local packet crafting for privacy research, protocol inspection, and development workflows.
Certain functions (raw sockets, packet crafting, identity rotation) can be considered dual-use. Use of this software must comply with applicable laws, ethical guidelines, and the Tor Project’s policies. Do not run Scapy-based operations or traffic analysis against systems you do not own or have explicit permission to test.
Tor traffic in this toolkit is limited to standard HTTP(S) requests. Scapy traffic is strictly local and never routed through Tor.
Respect the copyright. It is provided as a free learning resource under GPLv3.
This project is licensed under the GNU General Public License v3 (GPLv3). You must retain the copyright notice and share modifications under the same license.
(Readme.md crafted with the help of AI. Code crafted by Volkan Sah)
Found this useful?
- ⭐ Star this repository
- 🐛 Report issues
- 💡 Suggest improvements
- 💖 Sponsor development
Stay secure. Stay paranoid. 🔒
- Multiple Isolated Tor Instances for Hidden Services
- Security Headers — Complete Implementation Guide
- Securing FastAPI Applications
- ModSecurity Webserver Protection Guide
- Tor Isolation Layer (TIL)
Thank you for your support! ❤️
Created by Volkan Sah (Kücükbudak).
More privat projects: https://volkansah.github.io
Updated on 07.12.2025