Rapid7 Details New BPFDoor Variants Using Protocol Tunneling and Stealthy C2

· Original article ↗

Summary

Rapid7 analyzes seven BPFDoor variants, detailing stealth techniques, multi-protocol triggers, ICMP shell tunneling, and an active beacon that disguises C2 as NTP-over-SSL. The research also identifies host and network detection markers.

Key points

  • Rapid7 identified seven new BPFDoor variants, F–L, with features including new BPF filters, timestomping, file-descriptor wiping, and hidden files and processes.
  • Variant G uses separate TCP, UDP, and ICMP capture threads with BPF filters, providing alternate trigger protocols if one is blocked.
  • The icmpShell variant tunnels interactive shell traffic over ICMP; commands use the plaintext “X:” prefix, while PTY output is encrypted with RC4 using the key “icmp”.
  • Variant H actively beacons to dynamic DNS domains, including ntpussl[.]instanthq[.]com, and connects over port 443 while masquerading as NTP-over-SSL.
  • Reported stealth techniques include process-name masquerading, AF_PACKET sockets, environment changes intended to disable user-mode hooks, and hiding files under /var/run/user/0.
  • Rapid7 recommends monitoring for ICMP sequence number 1234, invalid ICMP Code 1, AF_PACKET socket creation, and BPF filters attached to packet sockets.

Article Details

Attack Vectors
  • icmpShell carries attacker commands in cleartext with an “X:” prefix over ICMP and returns PTY output encrypted with RC4 using the hardcoded key “icmp”.
  • BPFDoor variants use custom BPF filters and magic bytes to detect activation triggers over ICMP, TCP, and UDP; variant G monitors all three protocols in separate threads.
  • Variant H resolves dynamic DNS C2 domains and connects over port 443, disguising encrypted shell traffic as NTP-over-SSL.
  • Variant I uses a TCP port 9999 handshake with magic bytes and a hardcoded password before spawning an unencrypted reverse shell.
  • Some variants use ICMP relay and proxying to tunnel shell sessions and route traffic through internal network segments.
  • Variants conceal activity through process-name masquerading, FD wiping, timestomping, hidden execution paths, and attempts to disable user-mode security hooks.
Defensive Notes
  • Monitor network traffic for the hardcoded ICMP sequence number 1234 and the technically invalid ICMP Code 1 heartbeat marker.
  • Monitor host activity for AF_PACKET socket creation, including SOCK_RAW and SOCK_DGRAM, and for setsockopt calls attaching BPF filters.
  • Check for root processes with spoofed names or executable paths that do not exist on disk.
  • Rapid7 recommends using rapid7_bpfdoor_check.sh to check for zero-byte mutex files and active BPF filters attached to packet sockets.

Indicators of compromise

TypeIndicatorContext
DOMAINntpd[.]casacam[.]netDomain described as used by BPFDoor to disguise beacon traffic as a time-check service.
DOMAINntpupdate[.]ddnsgeek[.]comC2 domain used by a BPFDoor variant and described as mimicking a system update service.
DOMAINntpupdate[.]ygto[.]comDomain described as used for dynamic DNS updates to maintain BPFDoor command-and-control access.
DOMAINntpussl[.]instanthq[.]comDynamic DNS domain resolved by BPFDoor variant H for active C2 beaconing over port 443.
SHA256195b98211d1ce968669a0740ca08d0ddcf03a2df03a47e2e70550f6c002b49e8Hash of a BPFDoor sample associated with the ntpussl[.]instanthq.com C2 domain.
SHA2562cc90edd9bc085f54851bed101f95ce2bace7c9a963380cfd11ea0bc60e71e0cHash of a BPFDoor variant F sample identified by Rapid7.
SHA256757e911edaf45cc135f2498c38d4db8acec39cb6aeb3a1dcc38305ab2d326fa9Hash of a BPFDoor sample whose BPF filtering logic is shown in the article.
SHA2569ee77ed38e5bc69f841bdaba7c5e6c3bf30fd9ae94cd2e69f39834e9cec76e82Hash of a BPFDoor sample described as an HPE ProLiant-tuned variant.
SHA256ca56622773c1b6f648b1578978b57aa668df25a11e0c782be008384a6af6c2c4Hash of a BPFDoor variant associated with the ntpupdate.ddnsgeek[.]com C2 domain.
SHA256de472ed37e33b79e1aa37e67a680ee3a9d74628438c209543a06e916a0a86fbaHash of a BPFDoor variant F sample identified by Rapid7.
SHA256ed768dd922742a597257ad684820d7562bb6be215710ec614bd041a22f3d6863Hash of a BPFDoor sample exhibiting protocol-specific threads and process-name spoofing.

MITRE ATT&CK

Malware

Vendors

Products

Tools

Related Articles