Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/nurupo/rootkit
权限提升持久化机制后渗透利用
GitHubnurupo/rootkit

rootkit

Linux 内核模块,可授予 root 权限、隐藏进程/文件,并保护自身免遭卸载,专为 Ubuntu 内核上的教育目的而设计。

查看仓库
82819672年前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Linux Rootkit

一个为乐趣而非恶意编写的简单 Linux 内核 rootkit。

功能

该 rootkit 可以实现以下功能:

  • 向用户态进程授予 root 权限
  • 按 PID 隐藏进程
  • 按 PID 取消隐藏先前隐藏的进程
  • 按名称隐藏文件或目录
  • 取消隐藏先前隐藏的文件或目录
  • 隐藏自身
  • 取消隐藏自身
  • 防止被用户卸载
  • 禁用卸载保护

支持的平台

该 rootkit 已在 Ubuntu 10.04.4 LTS 和 Ubuntu 16.04 LTS 提供的 Linux 内核 2.6.32-38 和 4.4.0-22 上测试通过,但应该很容易移植到介于两者之间的内核版本以及更新的版本。

rootkit 中包含一些特定于架构的代码,这些代码仅针对 x86 和 x86-64 架构实现。 这些代码用于查找系统调用表、禁用写保护内存以及两种函数挂钩方法之一。 将其移植到新架构应该非常容易,而且其中部分代码并非 rootkit 运行所必需的,例如不可移植的挂钩方法可以剥离掉,不过如果你愿意放弃那种通过覆盖目标内核函数的机器码来调用我们的挂钩函数的乐趣,那你一定是个非常无趣的人。

该 rootkit 仅在 1 个 CPU 核心上测试过,因此在多核系统上可能无法正常工作。 它很可能无法在多核系统上良好运行,因为该 rootkit 的编写假设任意时刻只有 1 个线程在执行代码,因此它缺少针对链表数据结构的原子写入/读取和互斥锁。

构建

搭建环境

启动你选择的虚拟机。

获取并安装所需的 Ubuntu 镜像:

内核 / 架构x86x86-64
2.6.32Ubuntu 10.04.4 i386 (694M) [torrent] [iso]Ubuntu 10.04.4 amd64 (681M) [torrent] [iso]
4.4.0Ubuntu 16.04 i386 (647M) [torrent] [iso]Ubuntu 16.04 amd64 (655M) [torrent] [iso]

对于 Ubuntu 10.04,请修补软件包仓库地址:

root@kitploit:~
sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

安装编译器、Linux 头文件以及构建 rootkit 所需的其他所有内容:

root@kitploit:~
apt-get update
apt-get install build-essential

确保不要执行 apt-get upgrade,因为它会更新内核,而该 rootkit 仅在预装的内核版本上测试过。

实际构建

root@kitploit:~
make

使用

加载 rootkit:

root@kitploit:~
insmod rootkit.ko

使用 rootkit:

root@kitploit:~
$ ./client --help
Usage: ./client [OPTION]...

Options:
  --root-shell            Grants you root shell access.
  --hide-pid=PID          Hides the specified PID.
  --unhide-pid=PID        Unhides the specified PID.
  --hide-file=FILENAME    Hides the specified FILENAME globally.
                          Must be a filename without any path.
  --unhide-file=FILENAME  Unhides the specified FILENAME.
  --hide                  Hides the rootkit LKM.
  --unhide                Unhides the rootkit LKM.
  --help                  Print this help message.
  --protect               Protects the rootkit from rmmod.
  --unprotect             Disables the rmmod protection.

卸载 rootkit:

root@kitploit:~
./client --unhide
./client --unprotect
rmmod rootkit.ko

你居然公开在网上发布如此恶意的代码,你简直是在给脚本小子们武装核武器!!!1

并非如此,网上有很多关于如何编写 Linux rootkit 的文章并附带了完整源代码,更不用说数不胜数的 GitHub 仓库了。

参考资料

编写此 rootkit 时使用了以下资料:

  • Linux kernel code
  • Linux kernel documentation
  • Linux Loadable Kernel Module HOWTO
  • WRITING A SIMPLE ROOTKIT FOR LINUX
  • Modern Linux Rootkits 101
  • Writing Modern Linux Rootkits 201 - VFS
  • Linux Kernel Module example. Rickroll prank.

许可证

本项目采用 GPLv2 许可证。

下载工具