Disclaimer: My code is not compatible with every system. (It may work in KERNAL_VERSION>4.7 & KERNAL_VERSION<5.7).
The code is not working correctly due to manipulating the cr0 register in ARM64, which might be incorrect.
My Setup
ubuntu 20.04.6 LTS
5.4.0-190-generic
ARM-64 arch
GNU/Linux
UTM (VM)
sudo apt update & sudo apt upgrade
Make sure to use Kernel Version in between 4.7.x to 5.7.x ( Reason is given in report)
sudo apt-get install build-essential linux-headers-$(uname -r)
( Keep rootkit.c and Makefile in same directory)
Run this command in same Directory
make
To load the module :
sudo insmod rootkit.ko
To unload the module :
sudo rmmod rootkit.ko
To check the messages:
sudo dmesg | tail
To Cheak Loaded module:
lsmod