{
  "id": 9156007,
  "title": "I wrote a new Elastic detection rule to catch eBPF rootkits compiling on-host 🛡️",
  "url": "https://urgent.news/2026/09/22/i-wrote-a-new-elastic-detection-rule-to-catch-ebpf-rootkits-compiling",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-22T15:46:13.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/secbyshresth/i-wrote-a-new-elastic-detection-rule-to-catch-ebpf-rootkits-compiling-on-host-2cfl"
  },
  "original_language": "en",
  "account": "A new Elastic detection rule has been created to identify eBPF rootkits that are compiling on-host. eBPF, or extended Berkeley Packet Filter, is a powerful tool for observability and networking in Linux, but it has also become a favorite tool for attackers to create rootkits. Most open-source security rules focus on detecting eBPF malware when it loads into the kernel, but this new rule addresses a gap in identifying malware during its compilation stage.\n\nThe rule uses Event Query Language (EQL) to monitor process executions on Linux hosts specifically looking for clang being executed with arguments targeting the BPF backend. This approach accounts for various little-endian, big-endian, full target triples, and single-token flag variants that attackers may use. The rule also considers failed attempts where attackers might make typos, as Linux execve still logs these errors. By capturing these syntax errors, the query can detect attackers making mistakes in real-time.\n\nThe author of the rule, who is part of the Elastic Security detection-rules repository, noticed the need for this new detection method when attackers use the \"Compile After Delivery\" technique (T1027.004). Instead of dropping the eBPF object as a .c source code file, attackers compile it on the fly using the local clang toolchain. To address this, the author submitted a pull request to Elastic (closing issue #6562). Collaboration with the original issue author, who provided a corpus of real-world clang execution logs, helped harden the query and remove blind spots. This open-source security collaboration demonstrates the power of community-driven security efforts. When Elastic Defend or Auditbeat is running in your environment, keep an eye out for this new rule in an upcoming release.",
  "summary": "If you've been following Linux security, you know that eBPF is a double-edged sword. It's incredible for observability and networking, but it's also the new favorite playground for Linux rootkits. Most open-source security rules try to catch eBPF malware when it loads into the kernel (usually by watching bpftool **or the **bpf() syscall). But I noticed a gap in the Elastic Security…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}