TLP Clear
Hilko Bengen
2026-06-12
ls or find/proc/$PID/ directory entriesgetdents64 (1)readdir syscall: Writes multiple directory
entries into user-provided bufferssize_t getdents64(int fd, void dirp[.count], size_t count);
struct linux_dirent64 {
ino64_t d_ino; /* 64-bit inode number */
off64_t d_off; /* Not an offset; see getdents() */
unsigned short d_reclen; /* Size of this dirent */
unsigned char d_type; /* File type */
char d_name[]; /* Filename (null-terminated) */
};getdents64 (2)Read a directory containing foo bar baz quux HIDEME:
getdents64 (3)syscall or libc hook copies remaining data over HIDEME:
Goal: hide suspicious activity after rootkit has been activated
Technique: Hook read call, recognize hide start and end
markers
For example, parts of a patched init script
/proc/$PIDkill pidfd_open getpgid getpriority getsid ioprio_get prlimit64 rt_sigqueueinfo rt_tgsigqueueinfo sched_getaffinity sched_getattr sched_getparam sched_getscheduler sched_rr_get_interval
init
and kthreadd (pid 1, 2)/proc/$PID/task/$TID/children/sys/fs/cgroup/*/cgroup.threadsgetdents64 corner casegetdents64 with mininal buffer sizes.rk-exposerk-exposeFinding hidden processes:
# rk-expose ps-diff
Differences between: [children, getdents, readdir]
- No anomalies found using 'children'
- No anomalies found using 'getdents'
- Missing processes in 'readdir':
- 3273 boopkit /usr/bin/boopkit
- 3274 boopkit /usr/bin/boopkit
Finding hidden files:
$ rk-expose ls-diff .
Differences between: [getdents, readdir]
- No anomalies found using 'getdents'
- Missing paths in 'readdir':
- - ./diamorphine_secret_file
/proc/$PIDSlides will be published here:
Contact me at
Hilko Bengen <bengen@hilluzination.de> @hillu@infosec.exchange