OnionSpy is a CLI toolkit for Tor-based research workflows. It helps you validate Tor connectivity, inspect onion services, crawl metadata, run dark web search collection and filtering workflows, and optionally store outputs in MongoDB.
- Tor connection verification and local Tor daemon control
- Proxy management (default Tor SOCKS, optional Privoxy)
- Onion service health scanning and metadata crawling
- Relay lookup by IP, fingerprint, or relay name
- Dark web search aggregation and AI-based content filtering
- Data breach lookups (full list and company-specific)
- Optional MongoDB insertion for collected outputs
- Security researchers
- Threat intelligence analysts
- Incident response teams
- Advanced learners studying Tor ecosystem operations
The tool is built for research and monitoring workflows, not for offensive or illegal use.
Required:
- Python 3.13+
- Tor daemon
- Windows: Tor Expert Bundle is recommended
- Linux/macOS: system Tor package is fine
torccconfiguration with at least:SocksPort 9050ControlPort 9051CookieAuthentication 1
Optional but recommended:
- Ollama (needed for
search,crawl, and AI-powered install guidance flows) - Privoxy (only if you want HTTP proxy forwarding through
http://127.0.0.1:8118) - MongoDB (only for optional data insertion prompts)
Tor daemon is a core dependency for OnionSpy. If Tor is not installed, Tor-based commands can fail with connection or startup errors.
Use a valid torcc file with proper configuration, at minimum:
SocksPort 9050ControlPort 9051CookieAuthentication 1
Behavior summary:
- If Tor daemon is already installed, running, and using the correct
torccsetup, OnionSpy connects normally. - If Tor daemon is installed but not running, and
app.tor.tor_executableplusapp.tor.torccare set correctly inconfig.yaml, OnionSpy can start Tor automatically and then connect to the Tor network. - If the executable path or
torccpath is invalid, startup/connection will fail until the paths and Tor config are fixed.
- Clone and enter project directory.
- Run setup:
.\setup.bat
- Edit
config.yamlvalues:tor_executable(Tor binary path)tor_data_dirproxy_url(socks5h://127.0.0.1:9050by default)- Optional MongoDB/Ollama fields
- Start Tor with your local setup (if not already running).
- Launch tool:
python main.py
- Clone and enter project directory.
- Run setup:
bash setup.sh
- Edit
config.yamlvalues as needed (Tor path/proxy/MongoDB/Ollama). - Ensure Tor daemon is running with compatible control and SOCKS ports.
- Launch tool:
python3 main.py
- Clone and enter project directory.
- Run setup:
bash setup.sh
- Edit
config.yamlvalues as needed (Tor path/proxy/MongoDB/Ollama). - Ensure Tor daemon is running with compatible control and SOCKS ports.
- Launch tool:
python3 main.py
Both scripts:
- create
.venv - install dependencies from
requirements.txt - bootstrap
config.yamlfromexample.config.yamlif missing - create required data/log directories (if not exist or missing)
- Default proxy is Tor SOCKS:
socks5h://127.0.0.1:9050 - Privoxy can be enabled by switching proxy with:
changeproxy http://127.0.0.1:8118
- Keep Tor control port reachable (
9051) fortorverify,torconn, andtorclose.
- Usage and commands:
USAGE.md - Engine and workflow internals:
WORKING.md - Contribution guidelines:
CONTRIBUTING.md - Project layout reference:
PROJECT_STRUCTURE.md
This project is released under the Apache License.
Current project version in code: 0.1.0
