Flare Finds eBPF Rootkit Tutorials Circulating on Underground Forums

· Original article ↗

Summary

Flare found underground posts sharing eBPF rootkit code and tutorials. The article details described stealth and activation methods, related exploit samples and limitations, and ways defenders can monitor and restrict eBPF use.

Key points

  • Flare found a Russian-language Duty Free forum tutorial with source code and screenshots its author presented as demonstrations.
  • The tutorial describes triggering an implant with a specially sized TCP SYN packet, hiding processes via getdents64 hooks, and encrypting command-and-control traffic with AES-256-GCM.
  • It also describes using XDP to inspect plaintext HTTP and drop packets matching 43 IP addresses the author associates with antivirus vendors; Flare found 10 related Pastebin posts.
  • eBPF programs can operate through the kernel's bpf() interface without loading a kernel module, so checks focused on loaded modules may miss them.
  • The article reviews BPFDoor, Symbiote and LinkPro techniques. In LinkPro, investigators could still see associated BPF maps and links despite attempts to hide programs from bpftool.
  • Flare found a frequently reposted exploit for CVE-2017-16995 and an unverified kTLS/eBPF sockmaps privilege-escalation PoC; its claimed compatibility with all kernels from 4.18 onward is incorrect, and success on Ubuntu 22.04 or 24.04 is unverified.
  • Suggested defenses include auditing programs with bpftool, restricting eBPF access, monitoring for crafted activation packets and unexpected XDP programs, and patching BPF verifier flaws.

Article Details

Attack Vectors
  • eBPF rootkits can hook kernel functions, observe system calls, and inspect or modify network traffic without loading a kernel module.
  • The Duty Free forum tutorial describes activating an implant with a TCP SYN packet having a specific window size and hiding processes by hooking getdents64.
  • The tutorial describes encrypting command-and-control traffic with AES-256-GCM and using XDP to inspect incoming plaintext HTTP traffic and drop packets matching a list of 43 IP addresses associated by the author with antivirus vendors.
  • A circulated exploit targets CVE-2017-16995, a Linux BPF verifier flaw involving incorrect sign extension. The article also describes an unverified local privilege-escalation PoC targeting kTLS and eBPF sockmaps; its claimed compatibility with all kernels from 4.18 onward is incorrect, and successful escalation on Ubuntu 22.04 or 24.04 has not been verified.
Defensive Notes
  • Audit loaded eBPF programs regularly with bpftool prog list and compare multiple sources of host telemetry; LinkPro reportedly hid its eBPF programs from that listing, while associated BPF maps and links remained visible.
  • Restrict eBPF access with kernel.unprivileged_bpf_disabled=1 and limit CAP_BPF and CAP_NET_ADMIN.
  • Monitor for magic packets, including specific TCP flags or window sizes, and for unexpected XDP programs on network interfaces.
  • Monitor bpf() system calls and suspicious attachment points on sensitive system calls such as getdents64 and execve.
  • Patch aggressively because BPF verifier bugs can be targeted by weaponized exploits.

MITRE ATT&CK

CVE

Threat Actors

Malware

Products

Tools

Countries

Related Articles