Exfiltration Over Asymmetric Encrypted Non-C2 Protocol
Adversaries may steal data by exfiltrating it over an asymmetrically encrypted network protocol other than that of the existing command and control channel. Common protocols include HTTPS/TLS, SFTP, SCP, SMTPS, and FTPS. These protocols use asymmetric encryption (public-key cryptography) for key exchange, often transitioning to symmetric encryption for bulk data transfer. Because these protocols are widely used for legitimate business purposes, malicious exfiltration traffic can blend in with normal network activity. Threat actors such as APT28, CURIUM, and Storm-1811 have leveraged HTTPS, SMTPS, and SCP respectively for data exfiltration.
let ExfilTools = dynamic(["rclone.exe", "winscp.exe", "pscp.exe", "psftp.exe", "filezilla.exe", "sftp.exe", "scp.exe", "curl.exe", "wget.exe"]);
let ExfilKeywords = dynamic(["sftp", "scp ", "smtps", "ftps", "webdav", "rclone", "winscp", "put ", "mput", "--sftp", "--webdav", "ssl", "tls"]);
let LargeTransferThresholdMB = 10;
// Detection 1: Known exfiltration tools making outbound encrypted connections
let ExfilToolProcesses = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (ExfilTools)
or (FileName =~ "cmd.exe" and ProcessCommandLine has_any ("sftp", "scp ", "rclone", "winscp"))
or (FileName =~ "powershell.exe" and ProcessCommandLine has_any ("sftp", "scp", "smtps", "WebDAV", "ftps", "rclone"))
| extend ToolName = case(
FileName =~ "rclone.exe", "Rclone",
FileName =~ "winscp.exe", "WinSCP",
FileName =~ "pscp.exe" or FileName =~ "scp.exe", "SCP",
FileName =~ "psftp.exe" or FileName =~ "sftp.exe", "SFTP",
FileName =~ "filezilla.exe", "FileZilla",
ProcessCommandLine has "sftp", "SFTP",
ProcessCommandLine has "scp ", "SCP",
ProcessCommandLine has "rclone", "Rclone",
"Unknown"
)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, ToolName;
// Detection 2: Large outbound HTTPS/SFTP/SCP connections
let ExfilNetworkEvents = DeviceNetworkEvents
| where Timestamp > ago(24h)
| where RemotePort in (443, 22, 465, 587, 990, 993, 8443, 21)
| where RemoteIPType == "Public"
| where InitiatingProcessFileName in~ (ExfilTools)
or InitiatingProcessCommandLine has_any (ExfilKeywords)
| summarize ConnectionCount=count(), BytesSent=sum(SentBytes), BytesReceived=sum(ReceivedBytes),
UniqueRemoteIPs=dcount(RemoteIP), Ports=make_set(RemotePort),
RemoteIPs=make_set(RemoteIP, 10)
by DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, bin(Timestamp, 1h)
| extend MBSent = round(toreal(BytesSent) / 1048576, 2)
| where MBSent > LargeTransferThresholdMB or ConnectionCount > 5
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName,
InitiatingProcessCommandLine, ConnectionCount, MBSent, UniqueRemoteIPs, Ports, RemoteIPs;
// Detection 3: Rclone-specific command line patterns
let RcloneActivity = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "rclone.exe"
| extend HasCopy = ProcessCommandLine has "copy" or ProcessCommandLine has "sync" or ProcessCommandLine has "move"
| extend HasRemote = ProcessCommandLine has ":" and (
ProcessCommandLine has "sftp" or ProcessCommandLine has "s3" or
ProcessCommandLine has "gdrive" or ProcessCommandLine has "onedrive" or
ProcessCommandLine has "mega" or ProcessCommandLine has "box" or
ProcessCommandLine has "dropbox" or ProcessCommandLine has "webdav"
)
| where HasCopy or HasRemote
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, HasCopy, HasRemote;
union ExfilToolProcesses, ExfilNetworkEvents, RcloneActivity
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- IT administrators using WinSCP, FileZilla, or SCP for legitimate file transfers to managed servers
- Backup software using SFTP/FTPS to transfer data to authorized cloud storage or DR sites
- DevOps pipelines using Rclone or curl for legitimate artifact publishing to cloud storage (S3, Azure Blob, GCS)
- Security teams running vulnerability scans or transferring forensic images via SFTP
- Software update mechanisms that download or upload telemetry over HTTPS to vendor endpoints
References (10)
- https://attack.mitre.org/techniques/T1048/002/
- https://media.defense.gov/2021/Jul/01/2002753896/-1/-1/1/CSA_GRU_GLOBAL_BRUTE_FORCE_CAMPAIGN_UOO158036-21.PDF
- https://www.pwc.com/gx/en/issues/cybersecurity/cyber-threat-intelligence/yellow-liderc.html
- https://rclone.org/docs/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1048.002/T1048.002.md
- https://www.rapid7.com/blog/post/2024/05/10/storm-1811-email-bombing-vishing-attacks/
- https://thedfirreport.com/2021/03/29/sodinokibi-aka-revil-ransomware/
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://docs.splunk.com/Documentation/SplunkCloud/latest/SearchReference/CommonStatsFunctions
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/process_creation
Unlock Pro Content
Get the full detection package for T1048.002 including response playbook, investigation guide, and atomic red team tests.