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

[rule]
author = ["Elastic"]
description = """
This rule detects events that may indicate the use of FTP network connections to the Internet. The File Transfer
Protocol (FTP) has been around in its current form since the 1980s. It can be a common and efficient procedure on your
network to send and receive files. Because of this, adversaries will also often use this protocol to exfiltrate data
from your network or download new tools. Additionally, FTP is a plain-text protocol which, if intercepted, may expose
usernames and passwords. FTP activity involving servers subject to regulations or compliance standards may be
unauthorized.
"""
false_positives = [
    """
    FTP servers should be excluded from this rule as this is expected behavior. Some business workflows may use FTP for
    data exchange. These workflows often have expected characteristics such as users, sources, and destinations. FTP
    activity involving an unusual source or destination may be more suspicious. FTP activity involving a production
    server that has no known associated FTP workflow or business requirement is often suspicious.
    """,
]
index = ["filebeat-*", "packetbeat-*", "logs-endpoint.events.*"]
language = "kuery"
license = "Elastic License"
name = "FTP (File Transfer Protocol) Activity to the Internet"
risk_score = 21
rule_id = "87ec6396-9ac4-4706-bcf0-2ebb22002f43"
severity = "low"
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:(20 or 21) or event.dataset:zeek.ftp) 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.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"
[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1048"
name = "Exfiltration Over Alternative Protocol"
reference = "https://attack.mitre.org/techniques/T1048/"


[rule.threat.tactic]
id = "TA0010"
name = "Exfiltration"
reference = "https://attack.mitre.org/tactics/TA0010/"

