m0nad/Diamorphine
GitHub: m0nad/Diamorphine
一款轻量级 Linux 内核模块 rootkit,通过系统调用挂钩实现进程隐藏、权限提升和模块自身隐藏。
Stars: 2266 | Forks: 476
# Diamorphine
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 开头将自动变为不可见;
- 源码:https://github.com/m0nad/Diamorphine
## 安装说明
验证内核版本是否为 2.6.x/3.x/4.x/5.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/
标签:0day挖掘, ARM64, Linux内核, LKM, Rootkit, x86_64, Zeek, 内核安全, 内核模块, 内核黑客, 协议分析, 安全资源, 客户端加密, 客户端加密, 恶意软件, 提权, 攻击路径可视化, 数据展示, 文件隐藏, 权限提升, 系统调用劫持, 红队, 网络可见性, 网络安全, 进程隐藏, 隐私保护, 黑客工具