TorScan Quick Start Guide
TorScan is an advanced dark web intelligence platform that enables security researchers to monitor and analyze .onion sites on the Tor network. This guide will help you get up and running quickly.
Prerequisites
- Docker and Docker Compose installed
- Basic understanding of command line operations
- At least 4GB of RAM available
5-Minute Setup
1. Clone and Configure
# Clone the repository
git clone <repository-url>
cd torscan
# Create your configuration
cp .env.example .env
# Edit the .env file - IMPORTANT: Change these values!
nano .env
Key settings to update in
.env
:- SECRET_KEY: Generate a random string
- MONGODB_PASSWORD: Set a strong password
- ELASTICSEARCH_PASSWORD: Set a strong password
- FLASK_DEBUG: Set to
False
for production
2. Start TorScan
# Start all services
docker-compose up -d
# Check that services are running
docker-compose ps
Services should be running on:
- Web Dashboard: http://localhost:5000
- MongoDB: localhost:27017
- Elasticsearch: localhost:9200
- Redis: localhost:6379
3. Initial Login
- Navigate to http://localhost:5000
- Login with default credentials:
- Username:
admin
- Password:
admin123
- Username:
- Change the password immediately!
Your First Scan
Step 1: Add Target Sites
Create or edit
config/sources.yaml
:# Example .onion sites to scan
- http://example1.onion
- http://example2.onion
- http://example3.onion
Step 2: Define Search Patterns
Create or edit
config/targets.json
:[
"keyword1",
"company-name",
"email@example.com",
"bitcoin:.*",
"specific phrase"
]
Step 3: Run a Manual Scan
- Go to the Dashboard
- Click "New Scan"
- Select your sources and targets
- Click "Start Scan"
- Monitor progress in real-time
Step 4: View Results
- Navigate to "Scan Results"
- Click on your completed scan
- Review matches with context
- Export results as JSON or CSV
Setting Up Scheduled Scans
Create a Daily Scan
- Go to "Scheduled Scans"
- Click "New Schedule"
- Configure:
- Name: "Daily Dark Web Monitor"
- Schedule Type: "Cron"
- Cron Expression:
0 2 * * *
(runs at 2 AM daily) - Select sources and targets
- Save and enable
Schedule Types Available
- Cron: Use cron expressions for complex schedules
- Interval: Simple recurring intervals (e.g., every 6 hours)
- One-time: Single execution at a specific date/time
Advanced Features
Full-Text Search
- Navigate to "Advanced Search"
- Use search operators:
keyword
- Basic search"exact phrase"
- Exact matchkeyword1 AND keyword2
- Boolean logicbitcoin~
- Fuzzy matching
- Apply filters:
- Date range
- Confidence score
- Source domain
Plugin Management
- Go to "Plugins" section
- Available plugin types:
- Crawlers: Custom site crawling logic
- Matchers: Advanced pattern matching
- Exporters: Custom export formats
- Notifiers: Alerts and notifications
- Upload or configure plugins as needed
Threat Intelligence Integration
Enable MISP or OpenCTI integration in
.env
:# MISP Configuration
MISP_URL=https://your-misp-instance.com
MISP_KEY=your-api-key
MISP_VERIFYCERT=True
# OpenCTI Configuration
OPENCTI_URL=https://your-opencti-instance.com
OPENCTI_TOKEN=your-api-token
API Usage
Authentication
# Get API token from dashboard
curl -X POST http://localhost:5000/api/login -H "Content-Type: application/json" -d '{"username":"admin","password":"your-password"}'
Start a Scan
curl -X POST http://localhost:5000/api/scan -H "Authorization: Bearer YOUR_TOKEN" -H "Content-Type: application/json" -d '{
"sources": ["http://example.onion"],
"targets": ["keyword1", "keyword2"]
}'
Search Results
curl -X GET "http://localhost:5000/api/search?q=bitcoin&limit=10" -H "Authorization: Bearer YOUR_TOKEN"
Best Practices
Security
- Change default passwords immediately
- Use environment variables for sensitive configuration
- Enable HTTPS for production deployments
- Regularly update Docker images and dependencies
- Monitor logs for suspicious activity
Performance
- Limit concurrent scans to avoid overloading Tor circuits
- Use pagination for large result sets
- Schedule scans during off-peak hours
- Monitor resource usage with
docker stats
Responsible Use
- Only scan sites you have authorization to monitor
- Respect robots.txt and rate limits
- Use for legitimate security research only
- Comply with all applicable laws and regulations
Troubleshooting
Common Issues
Services won't start:
# Check logs
docker-compose logs -f
# Restart services
docker-compose restart
Tor connection issues:
# Check Tor status
docker-compose exec tor-proxy tor-resolve check.torproject.org
# Restart Tor
docker-compose restart tor-proxy
Search not working:
# Rebuild Elasticsearch index
docker-compose exec web python scripts/reindex.py
Getting Help:
- Check logs:
docker-compose logs [service-name]
- Dashboard logs:
/logs
endpoint when debug is enabled - Configuration issues: Verify
.env
file settings - Permission errors: Ensure proper file ownership
Next Steps
- Customize patterns in
config/targets.json
for your use case - Set up notifications using the plugin system
- Integrate with your SIEM using the API
- Create custom plugins for specialized monitoring
- Enable threat intelligence feeds for enhanced detection
For more detailed documentation, API reference, and advanced configurations, refer to the full documentation in the /docs directory.