Warning: due to the unexport of kallsyms_lookup functions from the kernel introduced in v5.7, this rootkit will NOT work on this version onwards.
- Clone the repository to a local folder.
- cd into src/
- Run make in order to build the module.
- Watch the kernel logging with
dmesg -w
in order to see printk messages in real time. - Insert the module with
sudo insmod rootkit.ko
and specify parameters:
pid - process id to hide.
file_name - file name to hide. - Remove the module with
sudo rmmod rootkit
.
- When inserting the module, pass the chosen pid as a parameter to the insmod function, like this:
sudo insmod rookit.ko pid=6375
, to hide pid 6375.
- When inserting the module, pass the chosen file name as a parameter to the insmod function, like this:
sudo insmod rookit.ko file_name=foobar
, to hide files with the name "foobar".
- Read from
/dev/rootkit
file, for example, withcat /dev/rootkit
.
- Execute the get_root program (in get_root folder) or anything similar which write "please_give_me_root" to
/dev/rootkit
and spawns a shell. - Execute the
id
program to make sure you are root. - Enjoy unlimited capabilities!
- keylogging.
- providing root access from inside the machine.
- process hiding from ps
- file hiding from ls.
- Automate the mknod process.
Built and tested on a 18.04 ubuntu machine (kernel version 5.4.0).