Detect Exfiltration Over Unencrypted Non-C2 Protocol in Elastic Security
Adversaries may steal data by exfiltrating it over an unencrypted network protocol other than that of the existing command and control channel. Common protocols used include HTTP, FTP, SMTP, DNS, and TFTP. Data may be obfuscated using encoding schemes such as Base64 or embedded within protocol headers and fields without the use of encryption. Real-world threat actors including Lazarus Group, FIN8, APT32, Salt Typhoon, and Mustang Panda have leveraged FTP, HTTP POST, DNS tunneling, and SMTP for this purpose.
MITRE ATT&CK
- Tactic
- Exfiltration
- Sub-technique
- T1048.003 Exfiltration Over Unencrypted Non-C2 Protocol
- Canonical reference
- https://attack.mitre.org/techniques/T1048/003/
Elastic Detection Query
any where
(event.category == "process" and event.type == "start" and (
process.name in~ ("ftp.exe", "winscp.exe", "filezilla.exe", "ncftp", "lftp", "dnscat", "iodine", "dns2tcp", "blat.exe", "swaks", "sendmail", "msmtp") or
(
process.name in~ ("curl.exe", "curl", "wget.exe", "wget") and
process.command_line like~ "*http://*" and
(
process.args : ("--upload-file", "--data-binary", "--form", "-F") or
process.command_line like~ "*--data @*" or
process.command_line like~ "*-d @*"
)
) or
process.command_line like~ "*ftp://*" or
process.command_line like~ "*ftps://*" or
process.args : ("--ftp-upload", "STOR") or
process.command_line like~ "*dnscat*" or
process.command_line like~ "*iodine*" or
process.command_line like~ "*dns2tcp*" or
(
process.command_line like~ "*smtp*" and
(
process.args : ("-attach", "--attach", "-server") or
process.command_line like~ "*-to *" or
process.command_line like~ "*--to *"
)
)
)) or
(event.category == "network" and event.type in ("connection", "start") and
destination.port in (21, 25, 69, 80, 110, 143, 2121, 8080, 8000, 8888) and
not destination.ip like ("10.*", "172.16.*", "172.17.*", "172.18.*", "172.19.*",
"172.20.*", "172.21.*", "172.22.*", "172.23.*", "172.24.*", "172.25.*",
"172.26.*", "172.27.*", "172.28.*", "172.29.*", "172.30.*", "172.31.*",
"192.168.*", "127.*", "::1") and
not process.name in~ ("chrome.exe", "firefox.exe", "msedge.exe", "iexplore.exe",
"svchost.exe", "services.exe", "lsass.exe", "MsMpEng.exe")
) Detects exfiltration over unencrypted non-C2 protocols via two correlated event categories: (1) process launches matching known FTP clients, curl/wget HTTP upload patterns targeting plaintext HTTP URLs, DNS tunneling tools (dnscat, iodine, dns2tcp), and SMTP exfiltration utilities (blat, swaks, sendmail); (2) outbound network connections on plaintext protocol ports (FTP/21, SMTP/25, TFTP/69, HTTP/80, POP3/110, IMAP/143, HTTP-alt/8080/8000/8888) to external IPs from non-browser processes.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate FTP or plain HTTP file transfers by system administrators performing patching, configuration pushes, or authorized data migrations to external hosting providers
- Internal developer tooling or CI/CD pipelines that upload build artifacts over plain HTTP to internal artifact repositories that route through addresses appearing external
- Network diagnostic engineers running nslookup, dig, or DNS resolution scripts as part of authorized troubleshooting that match DNS tunneling command-line patterns
Other platforms for T1048.003
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 File Exfiltration Using Native Windows FTP Client
Expected signal: Sysmon Event ID 1: Process Create with Image=ftp.exe, CommandLine containing '-s:%TEMP%\ftp_script.txt'. Sysmon Event ID 11: File Create for ftp_script.txt. Sysmon Event ID 3: Network Connection attempt to 127.0.0.1:21 (may not appear if connection immediately refused). Security Event ID 4688 if command line auditing enabled.
- Test 2HTTP POST File Upload via curl to Plaintext Endpoint
Expected signal: Sysmon Event ID 1: Process Create with Image=curl.exe, CommandLine containing '--upload-file' and 'http://127.0.0.1:8080/upload'. Sysmon Event ID 3: Network Connection to 127.0.0.1:8080 from curl.exe. The connection will be refused but process and network events will still be logged.
- Test 3DNS Subdomain Exfiltration via nslookup
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe and child nslookup.exe with a long base64-like subdomain in the command line. Sysmon Event ID 22: DNS query event showing the long subdomain query. The query will fail (NXDOMAIN or timeout) but all telemetry is generated.
- Test 4SMTP Email Exfiltration via PowerShell Send-MailMessage
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'Send-MailMessage', '-SmtpServer', and '-Attachments'. Sysmon Event ID 3: Network Connection attempt to 127.0.0.1:25. PowerShell ScriptBlock Log Event ID 4104 with the full Send-MailMessage command and parameters including attachment path.
- Test 5Data Staging and FTP Exfiltration via WinSCP Script (Linux/macOS via curl)
Expected signal: Linux auditd or Sysmon for Linux Event ID 1: Process Create for tar, then curl with --upload-file and ftp:// URL. Syslog or auditd SYSCALL records for execve of curl with FTP arguments. Network connection attempt to 127.0.0.1:21. File creation events for the tar archive.
References (12)
- https://attack.mitre.org/techniques/T1048/003/
- https://attack.mitre.org/techniques/T1048/
- https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/fundamentals/command/cf_command_ref/C_commands.html#wp1068167689
- https://arxiv.org/ftp/arxiv/papers/1408/1408.1136.pdf
- https://www.mandiant.com/resources/blog/cutting-edge-part-2
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1048.003/T1048.003.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/network_connection
- https://unit42.paloaltonetworks.com/cookieminer/
- https://securelist.com/faq-the-projectsauron-apt/75533/
- https://www.welivesecurity.com/2019/03/20/fake-or-fake-keeping-up-with-oceanlotus-decoys/
- https://blog.checkpoint.com/security/apt35-exploits-log4j-vulnerability-to-distribute-new-modular-powershell-toolkit/
- https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/fundamentals/command/cf_command_ref/C_commands.html
Unlock Pro Content
Get the full detection package for T1048.003 including response playbook, investigation guide, and atomic red team tests.