Skip to content

Linux LKM rootkit

PUMAKIT LKM Rootkit: Traces and Offline Checks

PUMAKIT pairs an ftrace-hooking kernel module with a preload library and a fileless dropper. Its log lines, hidden files, live and offline checks, and recovery.

Kind
Linux LKM rootkit · Kernel layer
Platforms
Linux
First seen
2024-09
Status
In the wild
Checked by
Linux kernel

Overview

PUMAKIT is a Linux rootkit kit that Elastic Security Labs analysed in December 2024. The dropper was first uploaded to VirusTotal on 4 September 2024, with no detections at the time. Elastic does not describe victims and does not attribute the kit. Its write-up rests on the samples, so what follows is what those samples do, not a campaign history.

The kit has four stages:

StageElastic's nameRole
DroppercronRuns its payloads from memory (memfd)
Cover/memfd:tgt (deleted)A benign cron binary, run so the process looks normal
Loader/memfd:wpn (deleted)Poses as /usr/sbin/sshd, checks the environment and loads the kernel module
Kernel rootkitPUMA (puma.ko)Hooks syscalls through ftrace; carries a .puma-config section
Userland rootkitKitsune (/lib64/libs.so)Shared object loaded through LD_PRELOAD

Elastic describes the module as built for older kernels, likely before 5.7. It relies on kallsyms_lookup_name(), which later kernels stopped exporting.

How it loads and hides

Loading. The dropper embeds every component as ELF data and executes them from anonymous memory files. On a live host, their /proc/<pid>/exe links point to /memfd:… (deleted).

Before loading PUMA, the loader checks the system:

  • whether Secure Boot is on, by reading dmesg;
  • the kernel symbol tables, from a kernel image it unpacks out of /boot/vmlinuz-* into /tmp/vmlinux with a helper /tmp/script.sh. Both files are deleted afterwards.

The module's .modinfo carries a fake license=GPL so that it can reach GPL-only functions. Elastic reports the kernel's signature warning when it loads: module verification failed: signature and/or required key missing - tainting kernel.

Elastic does not describe how PUMAKIT survives a reboot. It says Kitsune plays a part in persistence and stealth. Kitsune is referenced as LD_PRELOAD=/lib64/libs.so, an environment setting, not /etc/ld.so.preload.

Hooking. PUMA registers ftrace callbacks on 18 syscalls and several kernel functions. Elastic's taxonomy article adds that it also patches the syscall table directly. The hooks Elastic details are:

  • getdents and getdents64: files and directories whose names start with zov_ disappear from listings but stay reachable by full path;
  • rmdir: a control channel. Calls on names starting with zarya carry commands (show the configuration, test that the module is loaded, hide a PID, report the version). One of them gives the caller root credentials through prepare_creds and commit_creds.

PUMA also starts user-mode commands through kernel threads. Elastic saw kthreadd spawn commands such as truncate -s 0 /usr/share/zov_f/zov_latest. Its detection article flags that pattern, since user commands rarely have kthreadd as their parent.

Traces on disk

LocationWhatSource
/usr/share/zov_f/, /usr/share/zov_f/zov_latestWorking folder, hidden by the zov_ prefix; the file is truncated repeatedlyElastic
Any file or folder named zov_*Hidden by the moduleElastic
/lib64/libs.soKitsune, the userland rootkitElastic
/tmp/script.sh, /tmp/vmlinuxTemporary helper and unpacked kernel, deleted after use: look in the file system's free space and journalElastic
The cron dropper wherever it was storedNot named in Elastic's text; it runs the rest from memoryElastic
/var/log/kern.log, /var/log/messages, the journalmodule verification failed naming the module, an executable stack warning, and segfault linesElastic
Process start records (auditd, EDR)Commands whose parent is kthreadd; a process named sshd whose binary is a deleted memfdElastic

Strings from Elastic's YARA rule Linux_Trojan_Pumakit are useful for a byte search of an image or memory:

  • PUMA %s, Kitsune PID %ld, .puma-config;
  • /usr/share/zov_f, zarya;
  • ping_interval_s, session_timeout_s, c2_timeout_s, kit_so_len;
  • LD_PRELOAD=/lib64/libs.so.

The rule matches on any four. Elastic also lists hashes and the C2 domains under opsecurity1[.]art. Take them from the report.

How to check a host

Live, with caution. PUMA hooks syscalls, so ls, ps and even static tools see the filtered view.

ls -l /proc/[0-9]*/exe 2>/dev/null | grep memfd     # programs running from deleted memory files
ps -eo pid,ppid,comm,args | awk '$2 == 2'           # user commands whose parent is kthreadd (PID 2)
cat /proc/sys/kernel/tainted
dmesg | grep -iE 'taint|module verification|executable stack'
grep -l 'LD_PRELOAD' /proc/[0-9]*/environ 2>/dev/null
stat /usr/share/zov_f/zov_latest                    # hidden from listings, but reachable by name
cat /sys/kernel/tracing/enabled_functions           # functions with ftrace callbacks (root, tracefs mounted)
  • The kernel's ftrace documentation describes enabled_functions as a list of every function with a callback attached. Hooks on syscalls or filldir-type functions from an unknown module deserve a look. Live patching and some security agents also use ftrace.
  • A rootkit can filter this file too, so a clean result is not proof.
  • Kernel threads are children of kthreadd, so the ps filter also prints them; look for ordinary programs such as cat or truncate in its output.
  • Elastic recommends auditd rules on init_module, finit_module and delete_module.
  • Capture memory next: the module, the loader and Kitsune may exist only there.

Offline, from an image.

R=/mnt/evidence
ls -la "$R"/usr/share/zov_f "$R"/lib64/libs.so 2>/dev/null
find "$R" -xdev -name 'zov_*' 2>/dev/null
zgrep -hE 'module verification|executable stack|segfault' "$R"/var/log/kern.log* "$R"/var/log/syslog* 2>/dev/null
journalctl -D "$R"/var/log/journal _TRANSPORT=kernel -o short-iso | grep -iE 'taint|module verification'
grep -rn 'LD_PRELOAD' "$R"/etc "$R"/root "$R"/home/*/.[a-z]* 2>/dev/null
dpkg --root="$R" -S /lib64/libs.so 2>&1             # or: rpm --root "$R" -qf /lib64/libs.so

On a clean analysis machine the zov_ names are visible. A /lib64/libs.so that no package owns, exporting libc functions, is the Kitsune lead to follow. Search the whole image, including unallocated space, for the YARA strings above. The deleted /tmp files may survive there.

What the checker looks for

The linuxkernel module can see:

  • The kernel log line module verification failed naming the module, as "Kernel log: unsigned module loaded", when kern.log or messages was collected; and, from the collect script's _live/ outputs, "Kernel tainted by an out-of-tree or unsigned module".
  • A module file, if PUMA was ever written under lib/modules/: "Unsigned module among signed modules", "Module unknown to the kernel build and to every package", "Resolves unexported kernel symbols" for the kallsyms_lookup_name import or kprobe lookup, and "Redirects kernel functions with ftrace" for the register_ftrace_function and ftrace_set_filter_ip imports. Elastic does not say whether the module is ever stored as a file.
  • Kitsune's library, /lib64/libs.so, when it is in the collection: "Library replaces libc directory and file functions" if it exports libc's directory-listing or file functions. Elastic reports LD_PRELOAD, which lives in environments and unit files the checker does not read; if /etc/ld.so.preload named the library, "Library preloaded into every program" would follow.

The checker cannot see:

  • the memfd processes, kthreadd-spawned commands and ftrace callbacks: they exist only on the running system or in memory;
  • the zov_ folders, which it does not search for;
  • the journal, which it does not read.

Removal and recovery

  1. Capture memory, then image the disk. The dropper runs its stages from memory, so a reboot loses the loader and possibly the only copy of the module. Volatility 3's linux.malware.hidden_modules, linux.tracing.ftrace and linux.malware.check_syscall cover the hiding PUMA does. See memory forensics on Linux Forensics.
  2. Find the dropper and its trigger. The name cron suggests it hides among scheduled jobs. Check crontabs, units and shell startup files for what launched it. Also check what set LD_PRELOAD for Kitsune.
  3. Rebuild the host. Kernel code with a root-granting control channel ran on it. Removing /lib64/libs.so and the zov_ folders is not enough to trust it again.
  4. Rotate credentials and review access from the host. Block and hunt for the reported C2 infrastructure in proxy and DNS logs.
  5. Prevent reloading.
    • Enforce module signatures (Secure Boot with lockdown, or module.sig_enforce=1). They refuse an unsigned module such as the one Elastic analysed.
    • Keep kernels current.
    • Alert on kthreadd-parented user commands and on memfd executables.

See also KoviD, another ftrace-based module, and Symbiote for a preload rootkit on its own.

Sources

Primary public reports, newest first.

  1. 2026-04-02Hooked on Linux: Rootkit Detection EngineeringElastic Security Labs
  2. 2026-03-05Hooked on Linux: Rootkit Taxonomy, Hooking Techniques and TradecraftElastic Security Labs
  3. 2024-12-12Declawing PUMAKITElastic Security Labs

See also