Command & Control

ICMP Tunnel

ICMP Tunnel

Detection overview

The "ICMP Tunnel" detection identifies unusual or suspicious use of the Internet Control Message Protocol (ICMP) for non-standard purposes. ICMP, typically used for diagnostic and error-reporting functions in networking, can be exploited by attackers to establish covert communication channels for command-and-control (C2) or data exfiltration.

Triggers

  • A host was observed using ICMP in ways inconsistent with standard implementation of the protocol.
  • More precisely, a host’s ICMP traffic was observed to contain datagrams which vary in size more frequently than typical ICMP traffic would.
  • An attacker may be using the host to communicate with or transfer data to an external host.

Possible Root Causes

Malicious Detection

  • An attacker is using ICMP as a staging and/or control channel. An attacker has established persistence & has chosen ICMP as a backup channel.

Benign Detection

  • A network device like a vulnerability scanner is crafting nonstandard ICMP datagrams.

Business Impact

  • The presence of an ICMP tunnel indicates the host was compromised & that an attacker has remote access to the machine.
  • Recon, data exfiltration, lateral movement, privilege escalation, & establishing a tunnel over a more reliable protocol like HTTPS are all likely next steps.
  • ICMP tunnels can be stealthy and are often used to evade sophisticated perimeter security controls.

Steps to Verify

  • Check the destination IP & determine if the observed traffic arrives at a trusted endpoint.
  • Investigate the host for malware, there may be code present which establishes a C2 channel with another host.
ICMP Tunnel

Possible root causes

Malicious Detection

Attackers often use ICMP tunnels to hide communication between a compromised machine and a remote server. These tunnels can transmit data or instructions while blending with legitimate network traffic, allowing attackers to maintain persistence or exfiltrate data unnoticed.

Benign Detection

In legitimate cases, certain diagnostic tools, vulnerability scanners, or network management utilities may generate ICMP traffic that appears anomalous. These tools may use custom payloads for testing or troubleshooting purposes.

ICMP Tunnel

Example scenarios

1. Covert Data Exfiltration

A compromised server sends ICMP packets containing encoded data to an external attacker-controlled host, avoiding traditional data monitoring systems.

2. Fallback Communication for Malware

Malware switches to using ICMP for C2 communication after primary channels are disrupted or blocked.

ICMP Tunnel

Business impact

If this detection indicates a genuine threat, the organization faces significant risks:

Undetected Data Exfiltration

ICMP tunnels can allow attackers to extract sensitive data covertly, exposing the organization to confidentiality breaches.

Persistence of Compromised Systems

Attackers may use ICMP to maintain long-term access, enabling further reconnaissance or lateral movement.

Security Monitoring Challenges

Traditional security solutions may not inspect ICMP payloads thoroughly, allowing malicious activity to bypass defenses.

ICMP Tunnel

Steps to investigate

ICMP Tunnel

MITRE ATT&CK techniques covered

FAQs

Why is ICMP used for tunneling?

ICMP is often allowed through firewalls for diagnostic purposes, making it a convenient covert channel for attackers.

How can ICMP tunneling be detected?

By analyzing payloads, packet sizes, and patterns inconsistent with typical ICMP usage.

How does ICMP tunneling affect security?

It bypasses conventional monitoring systems, enabling data theft, malware communication, or attacker persistence.

Should ICMP traffic be blocked entirely?

Not necessarily; ICMP is essential for network diagnostics. Restricting and monitoring payloads is more effective.

Can ICMP be used alongside other protocols?

Yes, attackers often combine ICMP tunnels with other covert methods to enhance their strategies.

Can ICMP tunneling be legitimate?

Yes, certain diagnostic or management tools may produce traffic resembling tunneling. Contextual analysis is required.

What are typical tunneling tools?

Utilities such as Ptunnel, icmpsh, and custom scripts are commonly used for ICMP-based tunneling.

What should I do if ICMP tunneling is detected?

Isolate the affected host, inspect for malware, and monitor for signs of data exfiltration or C2 activity.

What does anomalous ICMP payload look like?

It may contain encoded or encrypted data, which is unusual for typical ping or traceroute operations.

What tools can help detect ICMP misuse?

Intrusion detection systems (IDS) and packet inspection tools with protocol analysis capabilities can detect irregular ICMP behavior.