Skip to content

A kernel module (for use in CTFs) that will execute arbitrary commands

License

Notifications You must be signed in to change notification settings

ChrisPritchard/root_exec_kernel_module

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

root_exec kernel module

A kernel module (for use in CTFs) that will execute arbitrary commands

  1. use make to build a root_exec.ko
  2. then sudo insmod root_exec.ko to install the module (obviously you need permissions to do this - ctf had this as an allowable sudoers command)
  3. finally, the command will be run when you cat /proc/root_exec

By default, the root_exec.c module will copy /bin/sh to tmp, and make it suid so you can use sh -p to jump to root.

Credits:

  • deepseek (after a long battle with various hallucinations and dire warnings) helped me write this
  • it was built for the challenge 'Avengers Hub' in TryHackMe's Hackfinity CTF, March 2025

About

A kernel module (for use in CTFs) that will execute arbitrary commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published