A loadable kernel module demonstrating process hiding techniques through syscall hooking for educational and security research purposes.
This software is provided for educational and authorized security research only. Unauthorized use is illegal. Use only in isolated test environments with explicit permission.
- Hide processes by PID or name prefix.
- Syscall hooking (getdents, getdents64, kill)
- Procfs control interface
- Runtime process hiding and unhiding
- Optional module stealth capability
- Linux kernel 4.x or 5.x
- Kernel headers matching running kernel
- GCC compiler and make
- Root privileges
sudo apt-get install build-essential linux-headers-$(uname -r)
sudo yum install kernel-devel kernel-headers gcc makemake
sudo insmod rootkit.ko
lsmod | grep rootkitsleep 1000 6
PID=$!
sudo kill -31 $PID
ps aux | grep $PIDsudo kill -32 $PIDcd /bin/sleep /tmp/evil_daemon
/tmp/evil_daemon 1000 &
ps aux | grep evil_daemoncat /proc/rootkit_controlchmod +x test_rootkit.sh
sudo ./test_rootkit.shsudo rmmod rootkitThis rootkit can be detected by: - Syscall table integrity checking - Memory forensics tools - Comparing /proc output with kernel structures - Kernel module signature verification - Runtime integrity monitoring tools
Detection commands:
sudo cat /proc/kallsyms | grep sys_call_table
diff <(ps aux | wc -l) <(cat /proc/loadavg | awk '{print $4}')
diff <(lsmod) <(cat /proc/modules)- Enable kernel module signing (CONFIG_MODULE_SIG_FORCE)
- Use Secure Boot
- Enable kernel lockdown mode
- Implement runtime integrity monitoring
- Use SELinux or AppArmor mandatory access controls
- sys_getdents
- sys_getdents64
- sys_kill
- T1014
- T1547: Boot or Logon Autostart Execution
- T1562.001: Impair Defenses
- Does not survive reboot
- Detectable vie memory forensics
- Requires root to load
- May be unstable on some kernels
- Does not hide network connections or open files
sudo dmesg | tail -20
ls /lib/modules/$(uname -r)/buildsudo rmmod rootkit
sudo journalctl -xe**This tool is for authorized testing only. Users must have explicit permission to test on target systems and comply with all applicable laws. Unauthorized use may result in criminal prosecution.**
- Linux Kernel Module Programming Guide
- MITRE ATT&CK Framework
- Linux kernel documentation-