3 ms·
> This is a useful post. I'm going to nerd out at you though and point out that disabling LKMs doesn't really do anything to disable kernel-resident rootkits; .
by jlgaddis 10y ago
> This is a useful post. I'm going to nerd out at you though and point out that disabling LKMs doesn't really do anything to disable kernel-resident rootkits; ...
I really hate to question you but... are you sure?
The particular case that I'm thinking of was probably ~15 years ago. There was some 0-day or worm or something (details are a little vague now, obviously) that would install a kernel module and then loaded it to hide itself.
I can recall a discussion at the time and this was a recommendation. It wasn't just disabling individual modules -- it was actually disabling support for loading kernel modules. That is, whatever the kernel itself needed in order to support dynamic loading of modules at run-time was needed; the kernel was not able to load a module.
Like I said, it's been probably 15 years ago and I'm sure I'm not remembering everything 100% correctly so you may very well be correct... but I'm almost certain you could entirely disable loading of kernel modules (the kernel itself didn't support loading them).
Googling "amodload" now, thanks for the pointer...
- tedunangst 10y agoThe kernel has function pointers and dynamic memory. You can "build" a module if you need to.
- jlgaddis 10y agoInteresting. Thanks.
- tptacek 10y agoCheck out amodload; that was what was so interesting about it at the time: it built its own module loader back into a kernel compiled without loadable modules. If course: table stakes for modern rootkits!
- jlgaddis 10y agoThanks for the replies and pointers, Thomas. You've given me even more to read and learn about.
- shawnz 10y agoSurely if you can write to /dev/mem, it doesn't matter whether your kernel has support for modules or not. You could just create a rootkit which is not in the form of a loadable module. EDIT: Here's an example of this very thing. https://www.blackhat.com/presentations/bh-europe-09/Lineberry/BlackHat-Europe-2009-Lineberry-code-injection-via-dev-mem.pdf https://www.blackhat.com/presentations/bh-europe-09/Lineberr...