Exfiltration over ICMP
MITRE ATT&CK™ - Exfiltration Over Alternative Protocol - Technique T1048
Last updated
Was this helpful?
MITRE ATT&CK™ - Exfiltration Over Alternative Protocol - Technique T1048
Last updated
Was this helpful?
The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet protocol suite. It is used by network devices, including routers, to send error messages and operational information indicating success or failure when communicating with another IP address (Wikipedia).
At a high level, an ICMP packet consists of multiple fields, including a Data section. This section can contain arbitrary information, such as diagnostic messages, test payloads, or even copied portions of other network packets (e.g., IPv4 headers for error reporting). The following diagram illustrates the Data section, which is optional but can be leveraged for various purposes, including covert communication.
Notably, RFC 792 (which defines ICMP) does not impose any strict requirements on the content of the Data field. This means that any data can be transmitted, as long as the overall structure of the ICMP packet remains valid.
We can, on linux targets, exfiltrate datas with the -p
options of the ping
command.
On the attacking machine, we can receive the data as follows
Note that the -p option is only available for Linux operating systems. We can confirm that by checking the ping's help manual page.
To facilitate file exfiltration and remove the limit of 16 bytes in the data field using the native ping command, you can alternatively employ ICMP-Data-Exfiltration (python).
On a Windows victime, we may exfiltrate data over ICMP using poweshell
On the attacking machine, we can receive the data as follows