On this page
visibility_off
Stealth Hooks & daniel.* Commands
Hiding files, modules, PIDs, plus our rmdir() command channel
1. File & Directory Hiding
What we did
We hook getdents()
/getdents64()
.
How it works
- Call the original syscall to fill a
dirent
buffer. - Traverse entries; if
d_name
starts with any prefix inwe drop that entry byhide_prefixes[] = { "jules_est_bo_", "memfd:" };
memmove()
. - Return the new byte count.
2. Module Hiding
What we did
We hide our LKM from /proc/modules
and lsmod
.
How it works
We hook the procfs iterate
method for /proc/modules
and /sys/modules
, filtering out "epirootkit"
entries.
3. PID Hiding
What we did
Allow dynamic hiding of arbitrary PIDs.
How it works
- Maintain a
hidden_pids
list in the kernel. - In our
getdents()
hook on/proc
, skip entries matching that list. - Add to the list via
rmdir("daniel.k.<pid>")
.
4. C2 & Commands via rmdir()
What we did
Use rmdir()
as our stealth control channel.
Command | Action |
---|---|
daniel.0 | Privilege escalation |
daniel.c | Dump in-kernel config |
daniel.v | Report version |
daniel.k.<pid> | Hide PID <pid> |
How it works
- Hook
rmdir(const char __user *path,…)
. - Copy
path
into kernel space. - If it matches
^daniel\.
we run the command and return-ENOENT
.