known_TOR() function tests your network’s ability to detect and control connections to TOR (The Onion Router) exit nodes. While TOR has legitimate privacy uses, it’s also commonly used by threat actors to anonymize malicious activities.
Data Source
This module uses a curated list of TOR exit nodes:- SecOps Institute TOR List -
https://raw.githubusercontent.com/SecOps-Institute/Tor-IP-Addresses/master/tor-exit-nodes.lst
TOR exit nodes are the final relay in the TOR network where traffic exits before reaching its destination. Monitoring connections to these nodes can reveal potential data exfiltration or anonymized command & control traffic.
How It Works
Download TOR Exit Node List
Downloads the latest list of known TOR exit node IP addresses from the SecOps Institute repository.
Random Sampling
Randomly selects 15 TOR exit node IPs and validates them using IP address pattern matching.
Port Scanning
Tests socket connections to each TOR exit node on common web ports (80, 443) with a 5-second timeout.
Output Format
Results are saved to TOR_Results.txt with the following format:What to Monitor
Firewall Rules
Configure firewall rules to block or alert on connections to known TOR exit nodes based on your organization’s policy.
Network Behavior
Monitor for unusual network patterns that may indicate TOR usage, such as encrypted traffic to non-standard ports.
Policy Violations
If your organization prohibits TOR usage, successful connections indicate a policy violation requiring investigation.
Threat Intelligence
Correlate TOR node connections with other security events to identify potential data exfiltration or C2 activity.
Security Considerations
Legitimate Uses
Legitimate Uses
TOR has legitimate privacy and security use cases:
- Journalists protecting sources
- Whistleblowers reporting safely
- Users in countries with internet censorship
- Privacy-conscious individuals
Malicious Uses
Malicious Uses
Threat actors use TOR for:
- Anonymizing command & control traffic
- Data exfiltration without attribution
- Accessing dark web marketplaces
- Bypassing network security controls
- Hiding malware communication
Detection Strategy
Detection Strategy
Recommended approach:
- Block TOR by default in high-security environments
- Allow with monitoring for specific business needs
- Alert security teams on all TOR connections
- Investigate context around TOR usage
Testing Workflow
The test generates 30 total connection attempts (15 IPs × 2 ports). TOR exit nodes may be intermittently available, so some FAILED connections are normal.
Policy Recommendations
Organizations should establish clear policies regarding TOR usage:- High-Security Environments - Block all TOR traffic at the perimeter
- Regulated Industries - Monitor and log all TOR connections for compliance
- General Corporate - Alert on TOR usage and investigate context
- Research/Academic - Allow with user accountability and monitoring