[metadata]
creation_date = "2020/02/18"
maturity = "production"
updated_date = "2020/11/03"

[rule]
author = ["Elastic"]
description = """
This rule detects network events that may indicate the use of Tor traffic to the Internet. Tor is a network protocol
that sends traffic through a series of encrypted tunnels used to conceal a user's location and usage. Tor may be used by
threat actors as an alternate communication pathway to conceal the actor's identity and avoid detection.
"""
false_positives = [
    """
    Tor client activity is uncommon in managed enterprise networks but may be common in unmanaged or public networks
    where few security policies apply. Because these ports are in the ephemeral range, this rule may false under certain
    conditions such as when a NATed web server replies to a client which has used one of these ports by coincidence. In
    this case, such servers can be excluded if desired.
    """,
]
index = ["filebeat-*", "packetbeat-*", "logs-endpoint.events.*"]
language = "kuery"
license = "Elastic License"
name = "Tor Activity to the Internet"
risk_score = 47
rule_id = "7d2c38d7-ede7-4bdf-b140-445906e6c540"
severity = "medium"
tags = ["Elastic", "Host", "Network", "Threat Detection", "Command and Control"]
type = "query"

query = '''
event.category:(network or network_traffic) and network.transport:tcp and destination.port:(9001 or 9030) and
  source.ip:(10.0.0.0/8 or
             172.16.0.0/12 or
             192.168.0.0/16) and

  not destination.ip:(10.0.0.0/8 or
                      127.0.0.0/8 or
                      169.254.0.0/16 or
                      172.16.0.0/12 or
                      192.168.0.0/16 or
                      224.0.0.0/4 or
                      "::1" or
                      "FE80::/10" or
                      "FF00::/8")
'''


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1090"
name = "Proxy"
reference = "https://attack.mitre.org/techniques/T1090/"

[[rule.threat.technique.subtechnique]]
id = "T1090.003"
name = "Multi-hop Proxy"
reference = "https://attack.mitre.org/techniques/T1090/003/"

[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

