TorRecon is an OPSEC-aware reconnaissance framework that routes reconnaissance traffic through the Tor network, applies risk-based scan profiles, and produces structured JSON output.
It is built to operate reliably in Tor-constrained environments, prioritizing correctness, transparency, and failure-tolerant design over raw scan speed.
For detailed setup instructions, architecture, and usage examples, see
👉 DOCUMENTATION.md
-
🔒 Explicit Tor Routing
- HTTP traffic via
requests[socks] - System tools via
torsocks - No proxychains or LD_PRELOAD hacks
- HTTP traffic via
-
🎯 OPSEC Scan Profiles
- Risk-aware scan behavior
- Tor-safe defaults
- Easily extensible profiles
-
🧠 Explain Mode
- Transparent reasoning for scan behavior
- Clear visibility into OPSEC decisions
-
🔁 Campaign Mode
- Multi-target reconnaissance
- Optional Tor circuit rotation
-
📦 Structured Output
- Automatic JSON results
- SIEM / SOC friendly
- Failures recorded, not hidden
-
🧰 Tool Orchestration
nmap(best-effort port scanning)subfinder(subdomain enumeration)- Designed for extension (
httpx,nuclei, etc.)
User
└── TorRecon (Python)
├── requests + SOCKS5h → Tor
├── torsocks → System tools
├── stem (ControlPort) → Tor circuit control
└── JSON Output- Linux (Ubuntu / Kali recommended)
- Tor
- torsocks
- nmap
- Python 3.12+
sudo apt update
sudo apt install -y tor torsocks nmap python3 python3-venvTor Configuration
- Edit Tor configuration:
sudo nano /etc/tor/torrc
- Ensure the following:
SocksPort 127.0.0.1:9050
ControlPort 127.0.0.1:9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1- Restart Tor:
sudo systemctl restart tor
- Allow user access to the control cookie:
sudo usermod -aG debian-tor $USER
- Log out and log back in.
Python Setup
Create and activate a virtual environment:
python3 -m venv torrecon-venv
source torrecon-venv/bin/activateInstall dependencies:
pip install --upgrade pip
pip install requests[socks] stemUsage
Activate the environment and run TorRecon:
source torrecon-venv/bin/activate
cd TorReconExplain Mode
python tor_recon.py scanme.nmap.org --ports --explainSingle Target – Port Scan
python tor_recon.py scanme.nmap.org --portsSingle Target – Subdomain Enumeration
python tor_recon.py hackerone.com --subsCampaign Mode
python tor_recon.py --campaign scanme.nmap.org example.com --portsOutput
All runs generate JSON output in the output/ directory.
{
"profile": "stealth",
"timestamp": "2026-01-21T16:20:42+00:00",
"target": "scanme.nmap.org",
"tor_exit_ip": "109.70.100.12",
"results": [
{
"module": "ports",
"command": "nmap -sT -Pn --max-rate 10 ...",
"status": "attempted"
}
]
}
OPSEC Notes
-
Active scanning over Tor is best-effort
-
Tor exits are rate-limited and frequently blocked
-
Some failures are expected and intentionally logged
-
Passive DNS & TLS certificate harvesting
-
HTTP header & favicon analysis
-
Noise-budget based recon
-
Tor exit reliability scoring
-
HTML / Markdown reporting
-
Tor-safe Nuclei integration
This tool is intended for educational use, research, and authorized security testing only.
** Do not run it against systems without explicit permission.** You are responsible for complying with local laws, provider terms, and bug bounty program scopes.
This project is licensed under the MIT License.
You are free to:
- Use, modify, and distribute the software
- Use it for commercial and non-commercial purposes
Under the condition that the original copyright notice and this permission notice are included.
See the LICENSE file for full details.
Contributions are welcome!
- Fork the repository
- Create a new branch:
git checkout -b feature/my-feature
Built by a SOC analyst / full-stack developer who enjoys combining Python automation, Tor, and classic security tools to create practical reconnaissance workflows.