Stack Notes

When ps and ls lie: catching an ld.so.preload rootkit like QLNX

In May, Trend Micro described QLNX, a Linux remote-access tool that hides by making ls and ps lie. We re-enacted its main trick on a test host with a harmless stand-in. Here is why the host's own tools came up clean, what Stack Snack raised instead, and what to do about it.

Stack Snack Crew

October 27, 2026 · 5 min read

“Your tools say it's clean”, 42 s, captions on screen. Re-enactment with harmless stand-ins; the detections are real. Voice: Kyutai Pocket TTS (CC BY 4.0).
Read the narration

On screen: Re-enactment with harmless stand-ins. The detections are real.

The host's own tools find nothing.

In May, Trend Micro reported QLNX. It hides with one line in ld.so.preload, so ls and ps stop showing its files and processes.

We wrote a harmless stand-in to that file. Stack Snack raised a critical alert about two seconds later.

Hiding a kernel module is the same trick, one level down. Two views of the kernel disagree, and that gap is the alert.

One console shows what is really there, and what to do about it.

What QLNX does

Trend Micro published its research on QLNX on 4 May 2026. It is a remote-access trojan for Linux with several ways to stay out of sight:

  • A userspace rootkit. QLNX compiles a library on the host and lists it in /etc/ld.so.preload. Every new dynamically linked program then loads it first.
  • Hooks in the C library. The library intercepts readdir, stat, open and fopen. That hides its files and process IDs from ls, find, stat and ps.
  • eBPF hiding. It carries a controller for eBPF maps that hide process IDs, files and ports. The kernel-side eBPF program is not part of it.
  • A login backdoor. A PAM module captures credentials and logs them to /tmp/.pam_cache.

What it isn't: QLNX has no kernel module and doesn't mine. Trend's report doesn't say how it gets onto a host.

Why your own tools say it's clean

ls and ps ask the C library what is there. With the hooks in place, the answer comes from the rootkit. ps aux | grep returns nothing, and the host looks clean.

The way out is to look at something the hiding depends on. The preload trick needs a file at /etc/ld.so.preload. A hidden kernel module, the same trick one level down, leaves the kernel's own views disagreeing.

What we re-enacted

We didn't run QLNX. We staged two harmless stand-ins on a disposable test host with the Stack Snack agent installed:

  • The preload file. We wrote /etc/ld.so.preload with one comment line and no library, 85 bytes. Nothing was preloaded. A real rootkit lists its library there.
  • A hidden kernel module. Inside the test container we faked two views: /sys/module listed a module called lss_demo_hidden, and /proc/modules did not. No module was loaded and no kernel setting changed. A real kernel rootkit removes itself from the kernel's list; we faked the two views the agent compares, and the check is the same.

The alerts below are the real ones the agent and console raised.

What Stack Snack showed

RuleSeverityAfter staging
SEC-027
Non-empty /etc/ld.so.preload
Criticalabout 2 s
SEC-010
Hidden kernel module (cross-view)
Criticalabout 8 s

Our test agent took an inventory snapshot every 10 seconds, faster than a default install, so expect these a little later on your own hosts. The preload file also raised SEC-002, a watched file appearing, and SEC-145, a change in a critical persistence path.

SEC-027: the preload file

SEC-027: /etc/ld.so.preload exists and is non-empty (85 bytes) — preload indicator, not a verdict

What it means. Every new dynamically linked program on the host, including sshd, sudo and your shell, loads whatever this file lists. A few security products use it on purpose, and you would know. On a homelab box, treat an entry you can't explain as hostile.

What to do. Save the file and the library it names. Empty the file, move the library aside, then restart services or reboot so no running program keeps it loaded. Rotate credentials: anything typed into a program since the file appeared may have been read. QLNX's login backdoor makes that doubly true.

SEC-010: the kernel-level version of the same trick

This one is not part of QLNX. It is how the same hiding looks one level down, in the kernel.

SEC-010: kernel module 'lss_demo_hidden' present in /sys/module but absent from /proc/modules (not builtin) — hidden module indicator

What it means. A module is in the kernel's sysfs view but missing from its module list, and it isn't built in. Nothing legitimate removes itself from /proc/modules. Code in your kernel controls everything the host reports.

What to do. Don't try to clean it on the live host; the module can fake anything you run there. Note the module name, take the host offline, keep the disks if you want forensics, and rebuild from clean media. Then close the way in, or the rebuild gets infected again.

Why comparing two views works

The agent doesn't trust a single answer. For modules, it reads /sys/module, /proc/modules and the kernel's built-in list on every snapshot, and the gap between them is the alert. For preload, it checks the one file the trick can't work without.

There are honest limits:

  • A compromise that lies the same way to every view, the agent's included, is invisible to these checks. A clean result never proves a clean host.
  • We didn't test QLNX's eBPF hiding or its login backdoor in this re-enactment.

Check your own host

On a healthy host /etc/ld.so.preload usually doesn't exist. If a preload rootkit is already active, these commands can lie too, which is why a second view matters.

# does the preload file exist, and what does it list?
ls -la /etc/ld.so.preload
cat /etc/ld.so.preload

# loaded modules, two ways: compare the names
cat /proc/modules
ls -d /sys/module/*/initstate

A module with an initstate file that is missing from /proc/modules matches SEC-010. The rule also checks the built-in module list, so built-ins don't count.

Sources

Want this watching your stack?

Every alert in this post comes from the Stack Snack agent and console. Install the agent on a Linux host and see what it sees.