Skip to content

Hiding

VFS and /proc Hooking in Linux Rootkits: Traces, Checks

How Linux kernel rootkits hide files, processes and connections inside the VFS and /proc, what that leaves in memory and on disk, and how to check a host.

Goal
Hiding
Layer
Kernel
Platforms
Linux
ATT&CK
T1014
Also known as
VFS hooking, file_operations hooking
Checked by
Linux kernel

Overview

Linux reaches every file system, /proc included, through the Virtual File System (VFS). When a program lists a directory, the VFS calls that file system's directory-reading operation, which hands each entry to a small callback (filldir) that copies it to the program. Opening a path goes through a lookup operation. /proc/net/tcp is written line by line by a "show" function such as tcp4_seq_show.

A rootkit that changes one of these hides things one level below the system call. It does not matter which system call the program uses or whether it is statically linked: the file system itself no longer reports the entry. Elastic calls this VFS hooking and gives Adore-ng as the example, a 2004 rootkit whose design lives on in Syslogk.

This page is about the target: hiding done in the VFS and /proc layer, whatever the hooking method. Patching a function's code is covered as a method in inline kernel function hooking; the other methods are system call table hooking and ftrace and kprobe hooking.

How it works

Rootkits change this layer in two ways:

MethodWhat changesFamilies
Pointer swapA function pointer in an operations table: the root file system's or /proc's directory-reading operation (readdir, later iterate and iterate_shared), /proc's lookup, or the TCP and UDP "show" functionsAdore-ng, Syslogk (both samples' file hiding)
Function hookThe VFS helpers themselves (filldir, filldir64, iterate_dir, d_lookup, tcp4_seq_show), patched with a jump (inline hooking) or diverted through ftraceReptile, Drovorub, Syslogk (ASEC's sample), KoviD

What each target hides:

TargetEffect
Directory reading of / and other file systemsFiles and folders missing from every listing; still reachable by full path unless lookup is hooked too
Directory reading and lookup of /procPIDs missing from ps and top; with lookup hooked, /proc/<pid> stops answering. Adore-ng also uses /proc lookups as its control channel
tcp4_seq_show, udp4_seq_show and their IPv6 versionsConnections missing from /proc/net/tcp and from netstat, which reads it
vfs_readText removed from any file a program reads (Reptile)

The ss command asks the kernel through netlink rather than reading /proc/net/tcp. Synacktiv uses that difference to find a connection that /proc/net hides (Synacktiv). It only works when the rootkit filters one path and not the other: KoviD also hides from ss (README).

How families use it

FamilyWhat it hooksSource
Adore-ngReplaces the directory-reading operation of / and of /proc, /proc's lookup, and tcp4_seq_show; hides files by owner UID and GID, PIDs and ports. Also drops syslog messages and utmp, wtmp and lastlog writes from hidden processesSource mirror
SyslogkAvast's 2022 sample replaces the readdir pointer of the root file system's file_operations and hooks the TCP seq_show output. ASEC's 2026 sample also swaps the readdir pointer to hide files, and uses inline hooks on proc_root_readdir and tcp4_seq_showAvast, ASEC
ReptileKHOOK inline hooks on filldir, filldir64, fillonedir, __d_lookup and vfs_statx (files), tcp4_seq_show and udp4_seq_show (connections), and vfs_read (text between tags)Repository
DrovorubHooks iterate_dir() or vfs_readdir(), d_lookup() and the /proc lookup operation, and the functions behind /proc/net/tcp, tcp6, udp and udp6, "either by patching functions directly, or by overwriting function pointers"NSA and FBI
KoviDHides files "by hijacking filldir and filldir64", through ftraceREADME

Skidmap's 2023 module mcpuinfo.ko fakes the system load with a function named fake_loading_proc_show. Trustwave does not say which /proc file it serves or how it is installed, so Skidmap is not listed above.

Traces it leaves

WhereTraceNotes
MemoryAn operation pointer of /, /proc or a network protocol that points into a modulePointer swaps
MemoryA jump at the start of filldir, iterate_dir, tcp4_seq_show and similarInline patches; see inline kernel function hooking
Live hostNames that answer stat or cd but are absent from listings; PIDs that answer kill -0 but not psLookup is often left alone
Live hostConnections in ss but not in /proc/net/tcp, or only in a capture taken outside the hostDepends on which paths are filtered
Disk, read from a clean machineFiles that were hidden, now plainly visible; a cluster owned by a UID and GID no account uses (Adore-ng)The best offline lead
Module fileStrings naming filldir, tcp4_seq_show, /proc/net/tcp, /proc/kallsymsWhen the .ko is on disk
LogsKernel taint lines; gaps in syslog, wtmp and lastlog (Adore-ng)

How to check a host

Live, with caution. Static tools go through the same VFS and are fooled too. Compare views that use different paths.

cat /proc/sys/kernel/tainted
# local TCP ports that ss (netlink) reports but /proc/net/tcp and tcp6 (seq_show) do not; ports are hex there
for p in $(ss -tanH | awk '{n=split($4,a,":"); print a[n]}' | sort -un); do
  grep -qi ":$(printf '%04X' "$p") " /proc/net/tcp /proc/net/tcp6 || echo "port $p: in ss, missing from /proc/net/tcp"
done
unhide brute proc                                  # PIDs that exist but are missing from /proc listings
ls -ld /etc/rc-Zobk0jpi /reptile 2>&1              # known default names: hidden from listings, reachable by name
  • A port that ss, or a capture taken outside the host, sees but /proc/net/tcp does not points to a hooked seq_show. Short-lived connections can appear in one and not the other, so run it twice.
  • Tracee's hooked_proc_fops and hooked_seq_ops events report replaced /proc file operations and network sequence operations at run time.

Memory. Capture memory first. Volatility 3's linux.malware.check_afinfo "verifies the operation function pointers of network protocols", which catches a swapped tcp4_seq_show. Volatility 2's linux_check_fop checks the file operations of /proc and open files; Volatility 3 has no equivalent. Add linux.malware.hidden_modules for the module. For patched functions, the memory checks are on the inline hooking page.

Offline, from an image mounted read-only on a clean machine, where nothing is hidden:

R=/mnt/evidence
find "$R" -xdev \( -nouser -o -nogroup \) -printf '%U:%G %TY-%Tm-%Td %p\n' 2>/dev/null | sort | head -50
find "$R" -xdev \( -name '*-Zobk0jpi*' -o -name '*was-patch*' -o -path '*/reptile/*' \) 2>/dev/null
strings -a /path/to/suspect.ko | grep -E 'filldir|iterate|seq_show|/proc/net/tcp|/proc/kallsyms'
last -f "$R"/var/log/wtmp | head -40

The names in the second line are public defaults from the Syslogk and Reptile reports; operators change them.

What the checker looks for

The linuxkernel module reads module files under lib/modules/ and raises:

  • "Names kernel functions that rootkits hook" for strings such as filldir, filldir64, fillonedir, tcp4_seq_show, tcp6_seq_show, udp4_seq_show, udp6_seq_show or proc_pid_readdir. Strings such as /proc/net/tcp and /proc/kallsyms are listed among the module's notable strings without a finding of their own.
  • The usual module findings: "Unsigned module among signed modules", "Module unknown to the kernel build and to every package", and "Module built for another kernel" (Avast's Syslogk sample was built for a CentOS 6 kernel).
  • Kernel log taint lines, and the _live/ module comparisons described in hiding a loaded module.

It cannot see a swapped pointer or a patched function, which exist only in memory. A rootkit that finds its targets at run time without naming them, as Adore-ng does by opening / and /proc, raises no hook-name finding. The checker does not search the image for hidden files or unknown owners. Do that by hand, as above.

Mitigation and recovery

  • Stop the module. Enforce module signatures (module.sig_enforce=1, or kernel lockdown), set kernel.modules_disabled=1 where possible, and audit init_module and finit_module.
  • Watch kernel integrity. LKRG validates "kernel and modules code and read-only data" at run time, which covers patched VFS functions. Load it before any compromise.
  • Ship logs off the host. Adore-ng filters syslog at the source.

Recovery. Capture memory, then image the disk. The proof (swapped pointers, patched code) exists only in memory. From the image, list every file the rootkit hid, then rebuild from known-good media. The host's own logs and listings cannot be trusted for the period of infection. Rotate the credentials used on it.

Sources

Primary public reports, newest first.

  1. 2026-09-03Detection and Removal of the Syslogk Rootkit in a Linux EnvironmentAhnLab ASEC
  2. 2026-03-05Hooked on Linux: Rootkit Taxonomy, Hooking Techniques and TradecraftElastic Security Labs
  3. 2025-10-14LinkPro: eBPF rootkit analysisSynacktiv
  4. 2022-06-13Linux Threat Hunting: 'Syslogk' a kernel rootkit found under development in the wildGen Digital (Avast)
  5. 2022-04-01KoviD source repositoryGitHub
  6. 2020-08-13Russian GRU 85th GTsSS Deploys Previously Undisclosed Drovorub MalwareNSA and FBI
  7. 2017-10-22Reptile source repositoryGitHub
  8. 2014-09-26adore-ng, adapted for 2.6 and 3.x kernels (source mirror)GitHub

See also

Families that use it