Exfiltration Over Alternative Protocol: 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. The data may also be sent to an alternate network location from the main command and control server.

Asymmetric encryption algorithms are those that use different keys on each end of the channel. Also known as public-key cryptography, this requires pairs of cryptographic keys that can encrypt/decrypt data from the corresponding key. Each end of the communication channels requires a private key (only in the procession of that entity) and the public key of the other entity. The public keys of each entity are exchanged before encrypted communications begin.

Network protocols that use asymmetric encryption (such as HTTPS/TLS/SSL) often utilize symmetric encryption once keys are exchanged. Adversaries may opt to use these encrypted mechanisms that are baked into a protocol.

ID: T1048.002
Sub-technique of:  T1048
Tactic: Exfiltration
Platforms: ESXi, Linux, Windows, macOS
Contributors: William Cain
Version: 1.2
Created: 15 March 2020
Last Modified: 15 April 2025

Procedure Examples

ID Name Description
G0007 APT28

APT28 has exfiltrated archives of collected data previously staged on a target's OWA server via HTTPS.[1]

G1012 CURIUM

CURIUM has used SMTPS to exfiltrate collected data from victims.[2]

S0483 IcedID

IcedID has exfiltrated collected data via HTTPS.[3]

S1040 Rclone

Rclone can exfiltrate data over SFTP or HTTPS via WebDAV.[4]

C0024 SolarWinds Compromise

During the SolarWinds Compromise, APT29 exfiltrated collected data over a simple HTTPS request to a password-protected archive staged on a victim's OWA servers.[5]

G1046 Storm-1811

Storm-1811 has exfiltrated captured user credentials via Secure Copy Protocol (SCP).[6]

Mitigations

ID Mitigation Description
M1057 Data Loss Prevention

Data loss prevention can detect and block sensitive data being uploaded via web browsers.

M1037 Filter Network Traffic

Enforce proxies and use dedicated servers for services such as DNS and only allow those systems to communicate over respective ports/protocols, instead of all systems within a network.

M1031 Network Intrusion Prevention

Network intrusion detection and prevention systems that use network signatures to identify traffic for specific adversary command and control infrastructure and malware can be used to mitigate activity at the network level.

M1030 Network Segmentation

Follow best practices for network firewall configurations to allow only necessary ports and traffic to enter and exit the network.[7]

Detection

ID Data Source Data Component Detects
DS0017 Command Command Execution

Monitor for execution of asymmetric encryption tools (e.g., OpenSSL, GPG, SSH key exchange), processes generating RSA/ECC key pairs before outbound network activity, or file encryption activity linked to later network transmissions.

Analytic 1 - Detecting Asymmetric Encryption Before Exfiltration

(EventCode=1 OR source="/var/log/audit/audit.log" type="execve")| where (command IN ("openssl rsautl -encrypt", "gpg --encrypt", "ssh-keygen -t rsa", "openssl pkeyutl -encrypt"))| eval risk_score=case( command IN ("openssl rsautl -encrypt", "gpg --encrypt"), 9, command IN ("ssh-keygen -t rsa", "openssl pkeyutl -encrypt"), 8)| where risk_score >= 8| stats count by _time, host, user, command, risk_score

DS0022 File File Access

Monitor files being encrypted before transmission, temporary storage of encrypted files in staging areas before exfiltration, or presence of public/private key files in suspicious locations.

Analytic 1 - Detecting Encrypted Files Before Exfiltration

(EventCode=11 OR EventCode=4663 OR source="/var/log/audit/audit.log" type="open")| where (file_path IN ("/tmp/", "/var/tmp/", "/home//Downloads/", "C:\Users\*\Documents\exfil") AND file_extension IN ("gpg", "rsa", "pem", "p12"))| eval risk_score=case( file_extension="gpg" OR file_extension="rsa", 9, file_extension="pem" OR file_extension="p12", 8)| where risk_score >= 8| stats count by _time, host, user, file_path, file_extension, risk_score

DS0029 Network Traffic Network Connection Creation

Monitor for outbound network connections using TLS-based encryption over non-standard ports, processes initiating large encrypted data transfers that typically do not communicate, or encrypted traffic with long-duration sessions indicative of large data exfiltration.

Analytic 1 - Detecting Exfiltration Over Asymmetric Encrypted Channels

(EventCode=3 OR source="zeek_conn.log" OR source="firewall_logs")| where (dest_port IN (22, 443, 465, 993, 995) AND bytes_out > 10000000)| stats count, sum(bytes_out) as total_bytes by _time, host, process, dest_ip, dest_port| where count >= 3 AND total_bytes > 50000000| eval risk_score=case( total_bytes > 100000000, 9, total_bytes > 50000000, 8)| where risk_score >= 8| table host, dest_ip, total_bytes, dest_port, risk_score

Network Traffic Content

Monitor for asymmetric encryption key exchange over unexpected network channels, detection of long Base64, PEM, or PGP keys transmitted in network payloads, or TLS handshakes or encrypted payloads in non-TLS standard traffic.

Analytic 1 - Detecting Encrypted Payloads in Non-C2 Channels

(EventCode=3 OR source="zeek_http.log" OR source="dns.log")| where (uri_length > 200 OR request_body_length > 5000)| eval encoded_data=if(match(uri, "-----BEGIN (RSA|EC|PGP) PRIVATE KEY-----") OR match(request_body, "-----BEGIN (RSA|EC|PGP) PUBLIC KEY-----"), 1, 0)| where encoded_data=1| stats count by _time, host, user, uri, request_body_length, risk_score| eval risk_score=case( request_body_length > 10000, 9, request_body_length > 5000, 8)| where risk_score >= 8| table host, uri, request_body_length, risk_score

Network Traffic Flow

Monitor network data for uncommon data flows. Processes utilizing the network that do not normally have network communication or have never been seen before are suspicious.

References