Detect Exfiltration Over Alternative Protocol in Google Chronicle
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
- Canonical reference
- https://attack.mitre.org/techniques/T1048/
YARA-L Detection Query
rule T1048_ExfilOverAlternativeProtocol {
meta:
author = "Argus Detection Engineering"
description = "Detects exfiltration over alternative protocols including FTP/SFTP/SMTP tool usage with upload indicators, outbound connections on exfil-relevant ports, and DNS tunneling via long subdomain queries."
mitre_attack_tactic = "Exfiltration"
mitre_attack_technique = "T1048"
severity = "HIGH"
priority = "HIGH"
events:
// Branch 1: Exfil tool with upload command-line indicators
(
$e1.metadata.event_type = "PROCESS_LAUNCH"
and (
re.regex($e1.principal.process.file.full_path, `(?i)(ftp\.exe|curl\.exe|winscp\.exe|pscp\.exe|sftp\.exe|ncftp\.exe|wget\.exe|bitsadmin\.exe|robocopy\.exe)$`)
)
and (
re.regex($e1.principal.process.command_line, `(?i)(\s-T\s|--upload-file|\sPUT\s|\sSTOR\s|ftp://|sftp://|ftps://|\s-F\s|--form|smtp://|smtps://|--mail-from|--mail-rcpt)`)
)
)
or
// Branch 2: Outbound connection on exfil ports from unexpected process
(
$e1.metadata.event_type = "NETWORK_CONNECTION"
and (
$e1.target.port = 21
or $e1.target.port = 22
or $e1.target.port = 25
or $e1.target.port = 465
or $e1.target.port = 587
or $e1.target.port = 989
or $e1.target.port = 990
or $e1.target.port = 2121
or $e1.target.port = 2222
)
and not net.ip_in_range_cidr($e1.target.ip, "10.0.0.0/8")
and not net.ip_in_range_cidr($e1.target.ip, "172.16.0.0/12")
and not net.ip_in_range_cidr($e1.target.ip, "192.168.0.0/16")
and not net.ip_in_range_cidr($e1.target.ip, "127.0.0.0/8")
and not re.regex($e1.principal.process.file.full_path, `(?i)(svchost\.exe|lsass\.exe|services\.exe|Outlook\.exe|thunderbird\.exe|filezilla\.exe)$`)
)
or
// Branch 3: DNS tunneling via long query names
(
$e1.metadata.event_type = "NETWORK_DNS"
and strings.length($e1.network.dns.questions.name) > 50
and not re.regex($e1.network.dns.questions.name, `(?i)(microsoft\.com|windows\.com|google\.com|amazon\.com|cloudfront\.net)$`)
)
condition:
$e1
} Chronicle YARA-L 2.0 rule detecting exfiltration over alternative protocols across three branches: known exfil tool usage with upload command-line patterns, outbound network connections to FTP/SMTP/SSH ports from non-whitelisted processes, and DNS tunneling via anomalously long query subdomain names. Uses UDM event types PROCESS_LAUNCH, NETWORK_CONNECTION, and NETWORK_DNS.
Data Sources
Required Tables
False Positives & Tuning
- Managed file transfer software (e.g., GoAnywhere, MOVEit) using SFTP on port 22 to authorized external partners — add principal.hostname or principal.ip allowlists for known MFT servers
- DevOps tooling (Ansible, Terraform) using SSH on port 22 for remote execution against cloud infrastructure — exclude based on initiating process name and known CI/CD asset groups
- DNS queries to cloud provider endpoints with long CNAME chains (e.g., AWS Route 53 health checks, Akamai edge nodes) — tune the 50-character threshold upward or add regex allowlist for known CDN patterns
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.
- 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.
- 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.
- 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.
- 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.
- 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.
References (12)
- https://attack.mitre.org/techniques/T1048/
- http://researchcenter.paloaltonetworks.com/2016/10/unit42-oilrig-malware-campaign-updates-toolset-and-expands-targets/
- https://labs.sentinelone.com/20-common-tools-techniques-used-by-macos-threat-actors-malware/
- https://blog.talosintelligence.com/poetrat-update-april-2020/
- https://www.sentinelone.com/labs/frameworkpos-another-pos-threat-using-dns-for-exfiltration/
- https://www.welivesecurity.com/2021/01/26/operation-windmill-eset-research-kobalos/
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-352a
- https://www.trendmicro.com/vinfo/us/security/news/ransomware-by-the-numbers/play-ransomware
- https://arxiv.org/ftp/arxiv/papers/1408/1408.1136.pdf
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1048/T1048.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/network_connection
Unlock Pro Content
Get the full detection package for T1048 including response playbook, investigation guide, and atomic red team tests.