eBPF rootkit
TripleCross eBPF Rootkit: Traces and Checks
TripleCross is an open-source eBPF rootkit from a 2022 thesis that hooks tracepoints, XDP and TC without a kernel module. What it leaves on disk, how to check.
- Kind
- eBPF rootkit · Kernel layer
- Platforms
- Linux
- First seen
- 2022
- Status
- Proof of concept
- Checked by
- None: no module reads its traces
Overview
TripleCross is a public, open-source Linux rootkit built on eBPF instead of a kernel module. It was written for a bachelor's thesis at Universidad Carlos III de Madrid; the repository holds the code and the thesis document. The first release, v0.1.0, is dated July 2022. It is published under the GPL-3.0 "purely for educational and academic purposes" and was tested on Ubuntu 21.04 with kernel 5.11.
Elastic's taxonomy calls it "a proof-of-concept". No report of its use in an intrusion was found for this page.
It is in this catalogue because it shows what an eBPF rootkit looks like to a responder:
- no
.kofile, no module list entry and no kernel taint from a module; - programs that live in kernel memory while a userland loader runs;
- on-disk persistence through ordinary cron and sudoers files.
How it loads and hides
Loading. Two pieces go into the kernel, both from files on disk:
| Piece | What it is |
|---|---|
kit | A userland program built with libbpf. It loads the eBPF programs, attaches them and keeps running |
tc.o | An eBPF object for a traffic-control (TC) egress filter, attached to a network interface with tc |
eBPF programs disappear at reboot. TripleCross brings itself back with two files the project's deployment script creates:
- a cron job in
/etc/cron.d/that restarts the rootkit after boot; - a
sudoers.dentry that grants passwordless privileges, so that the restarted rootkit keeps root.
Loading eBPF programs of these types needs root or CAP_BPF with related capabilities.
Hooks. The eBPF programs in the public source attach to syscall tracepoints and the network path:
| Attached to | Purpose (README and source) |
|---|---|
sys_enter_getdents64, sys_exit_getdents64 | Rewrites directory listings to hide its files: by default anything named ebpfbackdoor and a directory named SECRETDIR |
sys_enter_read, sys_exit_read, sys_enter_openat | Changes what a program reads, for example sudo reading /etc/sudoers, for privilege escalation |
sys_enter_execve | Rewrites the program path passed to the kernel, to run its own program first (execution hijacking) |
sys_enter_timerfd_settime, sys_exit_timerfd_settime, sys_enter_openat | Overwrites a target process's GOT so that it loads a library, which opens a reverse shell |
| XDP program | Watches incoming packets for the backdoor's trigger patterns and commands |
| TC egress program | Sends the backdoor's replies |
Several of these programs write into user memory with the bpf_probe_write_user() helper. That has two consequences for defenders:
- A log line. Kernels before 6.14 log a warning when such a program is loaded:
<comm>[<pid>] is installing a program with bpf_probe_write_user helper that may corrupt user memory!(kernel source, v6.13). Later kernels no longer print it. - Lockdown stops it. Kernel lockdown in integrity mode refuses the helper, which the kernel lists as "use of bpf to write user RAM" (security.h). It logs
Lockdown: <comm>: use of bpf to write user RAM is restricted; see man kernel_lockdown.7when a program asks for it.
Traces on disk
| Location | What | Source |
|---|---|---|
/etc/cron.d/ebpfbackdoor (default name) | Restarts the rootkit after reboot; hidden from listings while it runs | Repository |
/etc/sudoers.d/ebpfbackdoor (default name) | Passwordless sudo for the user that restarts it; hidden the same way | Repository |
A directory named SECRETDIR | Hidden folder for the rootkit's files | Repository |
kit, tc.o, and helper programs such as execve_hijack and injection_lib.so | Loader, TC object, payloads | Repository |
An ELF file whose machine type is eBPF (file reports eBPF) | Compiled eBPF object | General |
/var/log/kern.log, the journal | The bpf_probe_write_user warning (kernels before 6.14), or the lockdown refusal | Linux kernel source |
/var/log/auth.log, /var/log/secure | sudo use by the account the sudoers file trusts | General |
The names above are the public defaults, set at build time. A modified build would rename them.
How to check a host
Live. eBPF programs are listed by the kernel itself. A rootkit built this way can tamper with what userland tools read, but the listing comes from the bpf() syscall. Collect it early with a trusted bpftool.
bpftool prog show # look for tracepoint programs on getdents64, execve, read, timerfd_settime
bpftool link show
bpftool net show # XDP and TC attachments per interface
tc filter show dev eth0 egress # replace eth0 with each interface
ip link show | grep -i xdp
ls /sys/fs/bpf/ # pinned objects, if any
dmesg | grep -iE 'bpf_probe_write_user|use of bpf to write user RAM'
cat /etc/cron.d/ebpfbackdoor /etc/sudoers.d/ebpfbackdoor 2>&1 # hidden from listings, readable by name
bpftool prog showgives each program's type, name, load time, owning user and, on recent builds, the owning process.- Many legitimate tools load eBPF programs: systemd, Cilium, Falco, security agents. Compare with a known-good host of the same build.
- Linux Forensics' eBPF programs page explains the fields.
- For memory images, Volatility 3 has a
linux.ebpfplugin.
Offline.
R=/mnt/evidence
ls -la "$R"/etc/cron.d "$R"/etc/sudoers.d
grep -rn 'NOPASSWD' "$R"/etc/sudoers "$R"/etc/sudoers.d 2>/dev/null
find "$R" -xdev -type d -name SECRETDIR 2>/dev/null
find "$R" -xdev -type f -size -10M -exec file {} + 2>/dev/null | grep -i 'eBPF'
zgrep -hE 'bpf_probe_write_user|use of bpf to write user RAM' "$R"/var/log/kern.log* "$R"/var/log/syslog* 2>/dev/null
The cron and sudoers files are the dependable trace: they exist on disk for the rootkit to survive a reboot. See cron and sudoers on Linux Persistence for what normal looks like.
What the checker looks for
None of the checker's modules sees TripleCross, so this page lists no checks. The linuxkernel module reads kernel modules, their load configuration, ld.so.preload, shared objects and the kernel log's module-loading lines. TripleCross has:
- no module and no module configuration;
- no preload library;
- no taint message from a module.
The checker does not read /etc/cron.d, /etc/sudoers.d or eBPF objects, and does not flag the bpf_probe_write_user warning or a lockdown refusal of BPF. If your collection includes kern.log, search it for those lines yourself, as shown above. Use Linux Persistence to review the cron and sudoers side of a collection.
Removal and recovery
- Capture first. Record
bpftool prog show,bpftool link showandbpftool net show, and capture memory. A reboot unloads the programs and leaves only the loader and its persistence files. - Remove the persistence from the image or a rescue boot: the
cron.dandsudoers.dfiles, the loader, the TC object and the hidden folder. Detach any XDP or TC program still attached if the host must stay up. - Rebuild. The rootkit could rewrite what
sudoread, redirect anyexecveand inject a library into running processes. The host's binaries and logs cannot be trusted afterwards. Rebuild and rotate credentials. - Harden.
- Run with kernel lockdown in integrity mode, which blocks
bpf_probe_write_user. Many distributions turn it on when booted with Secure Boot;cat /sys/kernel/security/lockdownshows the current mode. - Keep
kernel.unprivileged_bpf_disabledset, and auditbpf()calls as Elastic recommends (Elastic, 2026). - Alert on new files in
/etc/sudoers.dand/etc/cron.d.
- Run with kernel lockdown in integrity mode, which blocks
KoviD and PUMAKIT show the module-based approach to the same hiding goals.
Sources
Primary public reports, newest first.
- 2026-04-02Hooked on Linux: Rootkit Detection EngineeringElastic Security Labs
- 2026-03-05Hooked on Linux: Rootkit Taxonomy, Hooking Techniques and TradecraftElastic Security Labs
- 2022-07-03TripleCross v0.1.0 releaseGitHub
- 2021-10-27TripleCross source repository and thesisGitHub