T1071.002

File Transfer Protocols

Adversaries may communicate using application layer protocols associated with transferring files to avoid detection/network filtering by blending in with existing traffic. Commands to the remote system, and often the results of those commands, will be embedded within the protocol traffic between the client and server. Protocols such as SMB, FTP, FTPS, and TFTP that transfer files may be very common in environments. Packets produced from these protocols may have many fields and headers in which data can be concealed. Data could also be concealed within the transferred files. An adversary may abuse these protocols to communicate with systems under their control within a victim network while also mimicking normal, expected traffic.

Microsoft Sentinel / Defender
kusto
let TimeWindow = 24h;
// Detect anomalous FTP/SMB/TFTP connections to external IPs
DeviceNetworkEvents
| where Timestamp > ago(TimeWindow)
| where RemotePort in (20, 21, 445, 139, 69, 990)
| where RemoteIPType == "Public"
| where ActionType == "ConnectionSuccess"
| summarize
    ConnectionCount = count(),
    BytesSent = sum(SentBytes),
    BytesReceived = sum(ReceivedBytes),
    FirstSeen = min(Timestamp),
    LastSeen = max(Timestamp)
    by DeviceName, InitiatingProcessFileName, RemoteIP, RemotePort, AccountName
| extend Protocol = case(
    RemotePort in (20, 21, 990), "FTP/FTPS",
    RemotePort in (445, 139), "SMB",
    RemotePort == 69, "TFTP",
    "Unknown")
| where ConnectionCount > 3
| project LastSeen, DeviceName, AccountName, InitiatingProcessFileName, RemoteIP, RemotePort, Protocol, ConnectionCount, BytesSent, BytesReceived, FirstSeen
| sort by ConnectionCount desc
high severity high confidence

Data Sources

Network Traffic: Network Connection Creation Network Traffic: Network Traffic Flow Microsoft Defender for Endpoint

Required Tables

DeviceNetworkEvents

False Positives

  • Legitimate FTP file transfers to external vendors or partner organizations (common in manufacturing, healthcare, and finance)
  • SFTP/FTPS connections to cloud-hosted file exchange platforms (e.g., GoAnywhere, MOVEit)
  • SMB connections through VPN tunnels to remote offices that appear as public IPs before NAT
  • Automated backup scripts that upload to external FTP servers

Unlock Pro Content

Get the full detection package for T1071.002 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections