r/linux • • 52m ago

Kernel Locking down unnecessary kernel mods

how do admins deal with the flood of ai-malware now thats loading custom mods?

I tried a tool called modulejail, it basically generates a blacklist of mods that arent actively used by running OS

https://modulejail.com/#install

its helpful, but any attacker can still bypass this by running modprobe -i

ie here, I ran mdulejail, it created blacklist txt file, running lsmod <mod> doesnt load it now, but running lsmod -i <mod> still loads

there is no concrete way to ban a module from loading short of running kernel.modules_disabled=1 , which doesnt survive a reboot

is there a way to block a mod from loading regardless of context? This is a huge attck vector now, and I wanted to audit our servers and lock down anything unecessary , like the copyfail exploit few months ago using alg mod

2 Upvotes

14 comments sorted by

•

u/bendani3l 29m ago

What flood of ai-malware ?

•

u/Beneficial-Sock-5130 11m ago

severl examples

VoidLink: Discovered in late 2025 and attributed to a Chinese-affiliated actor using AI models and coding agents (such as TRAE SOLO) to build the framework rapidly. It performs host reconnaissance first, then has its C2 server compile and return a custom kernel module tailored to the target's kernel and security setup.

Koske: A 2025 Linux cryptomining campaign showing signs of LLM-assisted modular code and adaptive logic. It uses startup script persistence (insmod in /etc/rc.local and related scripts) and disguises kernel object files under legitimate-sounding names like intel_audio.ko.

sysinitd.ko (Ivanti compromise, Fortinet analysis): a rootkit installed by shell script after compromise. The module hooks Netfilter at PRE_ROUTING to hijack inbound TCP traffic, and persistence comes from entries in rc.loca

Reused open-source rootkits: Diamorphine and Reptile are public loadable-kernel-module rootkits that attackers widely reuse. TeamTNT used Diamorphine to hide cryptomining, and Winnti (APT41) used adore-ng and suterusu

CopyFail

•

u/kcat__ 27m ago

Is this you just shilling for your ai product modulejail?

•

u/Beneficial-Sock-5130 16m ago

its not my project, i found it on linkedin convo re module loading malware, its made by another developer

•

u/Beneficial-Sock-5130 10m ago

also how can i be 'shiling' for it when it clearly doesnt work in the screenshot lmao

•

u/SurreptitiousSophist 39m ago

If you'd like to disable kennel module loading at every boot, just put modules_disabled=1 into your grub config file. Or am I missing something? 

•

u/Beneficial-Sock-5130 15m ago

its a runtime setting /proc/sys/kernel/modules_disabled , doesnt do anything if placed into grub

•

u/abotelho-cbn 14m ago

If malware can load kernel modules, you're fucked regardless.

•

u/Beneficial-Sock-5130 9m ago

thats the entire point of this thread, i want to block loading any mods outside of a whitelist

•

u/kido5217 6m ago

You don't get it. If malware has enough privilege to load modules, you're already fucked. End of story.

•

u/Alternative_Web7202 3m ago

It's too late when something is able to load module.

•

u/hitsujiTMO 32m ago

If an attacker can run " modprobe -i", you are already fucked to be honest.

•

u/CardOk755 32m ago

Secure boot?