T1048 Microsoft Sentinel · KQL

Detect Exfiltration Over Alternative Protocol in Microsoft Sentinel

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.

MITRE ATT&CK

Tactic
Exfiltration
Technique
T1048 Exfiltration Over Alternative Protocol
Canonical reference
https://attack.mitre.org/techniques/T1048/

KQL Detection Query

Microsoft Sentinel (KQL)
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

Multi-branch detection for T1048 Exfiltration Over Alternative Protocol targeting Microsoft Defender for Endpoint telemetry. Branch 1 identifies upload activity by known exfiltration tools (curl, ftp.exe, WinSCP, bitsadmin) with upload-specific flags. Branch 2 detects outbound network connections on FTP/SMTP/SSH ports from unusual initiating processes carrying significant data volume. Branch 3 identifies DNS tunneling via abnormally long DNS query subdomains or high-frequency DNS queries to a single external resolver — a pattern used by FrameworkPOS and similar malware to encode data in DNS lookups.

Data Sources

Process: Process CreationNetwork Traffic: Network Connection CreationNetwork Traffic: Network Traffic FlowMicrosoft Defender for Endpoint

Required Tables

DeviceProcessEventsDeviceNetworkEvents

False Positives & Tuning

  • 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
Download portable Sigma rule (.yml)

Other platforms for T1048


Testing Methodology

Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1FTP Upload via Windows Built-in FTP Client

    Expected signal: Sysmon Event ID 1: Process Create with Image=ftp.exe, CommandLine containing '-s:%TEMP%\df00tech-ftp.txt'. Sysmon Event ID 3: Network Connection attempt to 127.0.0.1:21 from ftp.exe. Sysmon Event ID 11: File create for the ftp script file in TEMP.

  2. Test 2curl SMTP Exfiltration Simulation

    Expected signal: Sysmon Event ID 1: Process Create with Image=curl.exe, CommandLine containing '--mail-from', '--mail-rcpt', '--upload-file', 'smtp://'. Sysmon Event ID 3: Network Connection to 127.0.0.1:25 from curl.exe. The connection will fail but telemetry events fire.

  3. Test 3DNS Tunneling Simulation via Long Subdomain Queries

    Expected signal: Sysmon Event ID 22 (DNS Query): 25 events with QueryName containing long base64-encoded subdomains (>50 characters) under df00tech-test.com. DNS queries will fail to resolve (NXDOMAIN) but the DNS telemetry events are generated by the Sysmon DNS query logging provider.

  4. Test 4curl Upload via HTTP PUT (Alternative Protocol Exfiltration)

    Expected signal: Sysmon Event ID 1: Process Create with Image=curl.exe, CommandLine containing '-X PUT', '-T', and 'http://127.0.0.1:8888'. Sysmon Event ID 3: Network Connection to 127.0.0.1:8888. Sysmon Event ID 11: File Create for exfil_test.txt in TEMP directory.

  5. Test 5SCP File Exfiltration via OpenSSH (Linux/macOS)

    Expected signal: Auditd EXECVE record for scp with arguments including the destination host and port. Network connection event to 198.51.100.1:22. On systems with Sysmon for Linux: Process Create event (EventCode=1) for scp binary, Network Connect (EventCode=3) for the outbound SSH connection attempt.

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