T1048

Exfiltration Over Alternative Protocol

Adversaries may steal data by exfiltrating it over a different protocol than that used for command and control. Data may be sent over FTP, SMTP, DNS, SMB, HTTP/S, or any other network protocol not serving as the primary C2 channel. Adversaries often encrypt or obfuscate these alternate channels. Common tools include curl, ftp.exe, WinSCP, and built-in OS utilities. DNS tunneling (encoding data in DNS query subdomains) is a particularly stealthy variant used by malware families like FrameworkPOS. IaaS and SaaS platforms (Exchange, SharePoint, GitHub, AWS S3) can also serve as exfiltration endpoints via cloud APIs or direct downloads.

Microsoft Sentinel / Defender
kusto
let ExfilTools = dynamic(["ftp.exe", "curl.exe", "winscp.exe", "pscp.exe", "sftp.exe", "ncftp.exe", "lftp", "wget.exe", "bitsadmin.exe", "robocopy.exe"]);
let SuspiciousFTPPatterns = dynamic(["-T ", "--upload-file", "PUT ", "STOR ", "ftp://", "sftp://", "ftps://"]);
let ExfilPorts = dynamic([21, 22, 25, 465, 587, 989, 990, 2222, 2121]);
// Branch 1: Suspicious exfil tool usage with upload indicators
let ToolBased = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (ExfilTools)
| where ProcessCommandLine has_any (SuspiciousFTPPatterns)
    or ProcessCommandLine has_any ("-o ", "--output", "-F ", "--form", "smtp://", "smtps://", "--mail-from", "--mail-rcpt")
| extend DetectionBranch = "ExfilToolUpload"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
          InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionBranch;
// Branch 2: Outbound connections on exfil-relevant ports from non-standard processes
let NetworkBased = DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemoteIPType == "Public"
| where RemotePort in (ExfilPorts)
| where InitiatingProcessFileName !in~ ("svchost.exe", "lsass.exe", "services.exe", "System",
         "Outlook.exe", "thunderbird.exe", "filezilla.exe", "winsshd.exe")
| where InitiatingProcessFileName !startswith "MicrosoftEdge"
| summarize BytesSent=sum(SentBytes), Connections=count(), FirstSeen=min(Timestamp), LastSeen=max(Timestamp)
    by DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, RemoteIP, RemotePort, RemoteUrl
| where BytesSent > 1048576 or Connections > 10
| extend DetectionBranch = "SuspiciousOutboundPort"
| project FirstSeen, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
          RemoteIP, RemotePort, RemoteUrl, BytesSent, Connections, DetectionBranch;
// Branch 3: DNS tunneling — long subdomains or high DNS query volume to single domain
let DNSTunneling = DeviceNetworkEvents
| where Timestamp > ago(24h)
| where ActionType == "DnsQueryResponse" or ActionType == "ConnectionSuccess"
| where RemotePort == 53
| where RemoteIPType == "Public"
| extend QueryLength = strlen(RemoteUrl)
| where QueryLength > 50
| summarize QueryCount=count(), MaxQueryLen=max(QueryLength), Domains=make_set(RemoteUrl, 20)
    by DeviceName, InitiatingProcessFileName, bin(Timestamp, 1h)
| where QueryCount > 20 or MaxQueryLen > 100
| extend DetectionBranch = "DNSTunnelingSuspect"
| project Timestamp, DeviceName, InitiatingProcessFileName, QueryCount, MaxQueryLen, Domains, DetectionBranch;
ToolBased
| union NetworkBased
| union DNSTunneling
| sort by Timestamp desc
high severity medium confidence

Data Sources

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

Required Tables

DeviceProcessEvents DeviceNetworkEvents

False Positives

  • IT administrators using curl or WinSCP for legitimate file transfers to managed SFTP/FTP endpoints
  • Backup agents (Veeam, Commvault, Acronis) initiating large outbound transfers to cloud storage over non-HTTP protocols
  • DevOps pipelines using scp/sftp/ftp in CI/CD scripts for artifact deployment or release publishing
  • Security tools and vulnerability scanners performing outbound SMTP or FTP tests as part of scheduled assessments
  • Email clients (Outlook, Thunderbird) generating high SMTP/SMTPS traffic during mass mail campaigns or automated notifications

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections