Skip to main content
The 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

1

Download TOR Exit Node List

Downloads the latest list of known TOR exit node IP addresses from the SecOps Institute repository.
2

Random Sampling

Randomly selects 15 TOR exit node IPs and validates them using IP address pattern matching.
3

Port Scanning

Tests socket connections to each TOR exit node on common web ports (80, 443) with a 5-second timeout.
4

Results Logging

Logs all connection attempts with timestamps to TOR_Results.txt.
5

Cleanup

Removes temporary downloaded files after testing completes.

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

TOR has legitimate privacy and security use cases:
  • Journalists protecting sources
  • Whistleblowers reporting safely
  • Users in countries with internet censorship
  • Privacy-conscious individuals
Organizations should balance security with legitimate privacy needs.
Threat actors use TOR for:
  • Anonymizing command & control traffic
  • Data exfiltration without attribution
  • Accessing dark web marketplaces
  • Bypassing network security controls
  • Hiding malware communication
Recommended approach:
  1. Block TOR by default in high-security environments
  2. Allow with monitoring for specific business needs
  3. Alert security teams on all TOR connections
  4. Investigate context around TOR usage
Successful connections to TOR exit nodes may indicate:
  • Unauthorized TOR usage in your network
  • Malware using TOR for command & control
  • Data exfiltration attempts
  • Policy violations requiring investigation

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:
  1. High-Security Environments - Block all TOR traffic at the perimeter
  2. Regulated Industries - Monitor and log all TOR connections for compliance
  3. General Corporate - Alert on TOR usage and investigate context
  4. Research/Academic - Allow with user accountability and monitoring