after @Eugene, I find a way to read the kernel memory directly to find the so-called not-so-smart hidden module: just compare the module in terms of both procfs and sysfs:
static int detect_hidden_mod_init(void) { char *procfs_modules[MAX_MODULE_SIZE]; char *sysfs_modules[MAX_MODULE_SIZE]; int proc_module_index = 0, sys_module_index = 0; struct module *mod; struct list_head *p;
In fact, it can detect most of the current routine hidden module, but, as Eugene said, "a smart rootkit may try to hide this data." So this is not an ideal way.
ytliu source share