Executive Summary
CASTLETAP exploits FortiGate firewalls by listening for an ICMP port‑knocking sequence that opens a covert channel for remote command execution. The backdoor hides within legitimate ICMP traffic, making it difficult to detect with standard firewall inspection tools. Attackers can gain full CLI access and exfiltrate sensitive configuration data.
Enhanced Description
CASTLETAP is an ICMP‑based port‑knocking backdoor designed for use against FortiGate firewalls running on network device platforms. The code listens for a predefined sequence of IPv4 or IPv6 ICMP echo requests; when the exact pattern is detected it triggers the creation of a covert tunnel that allows the attacker to execute arbitrary commands, transfer files, and exfiltrate data from inside the protected network. The backdoor leverages FortiGate’s privileged CLI interface as its attack surface. Once activated, CASTLETAP can remotely invoke shell commands, modify firewall policy tables, and establish a persistent connection that resists detection by conventional port‑based monitors because it operates over standard ICMP traffic, which is often allowed through firewalls without deep packet inspection. The malware’s installation is attributed to the supply‑chain actor UNC3886, with evidence pointing to the exploitation of a zero‑day vulnerability disclosed by Mandiant in its Fortinet investigation. Operationally, CASTLETAP remains dormant until the ICMP knock pattern arrives from an attacker‑controlled IP address. After activation, it opens a backchannel that can be used for lateral movement within the device’s operating system and to exfiltrate logs or configuration information. The stealthy nature of its traffic combined with the privileged privileges grants attackers broad control over network infrastructure, posing a substantial risk to critical communications. Because the tool was first observed in enterprise deployments of FortiGate firewalls, organizations using Fortinet products should scrutinize ICMP traffic for anomalous or repeated echo requests, especially from untrusted sources. Regular firmware updates and hardening of privileged access are essential mitigations.
Key Capabilities
ATT&CK Techniques
Recommended Actions
Suggested Tags
Confidence Assessment
The analysis is based primarily on publicly cited reports from Mandiant and Fortinet; while the described behaviors are well documented, detailed technical specifications regarding payloads or encryption mechanisms remain sparse. Confidence in the core functionality (ICMP knock activation, backdoor channel) is high, but uncertainties exist around variations of the tool in different firmware versions or potential additional capabilities such as covert tunneling protocols.
CASTLETAP is an ICMP port knocking backdoor that has been installed on compromised FortiGate firewalls by UNC3886.(Citation: Mandiant Fortinet Zero Day)