LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-10-2003, 12:28 AM   #1
m00
LQ Newbie
 
Registered: Nov 2003
Posts: 2

Rep: Reputation: 0
Arrow monolithic kernel, avoiding lkms?


Hi,

I'm trying to gather information about what is absolutely necessary to be built into a static
kernel for my specific hardware and box's role(bare firewall - no services)

Been using dmesg output, lsmod and have been trying to wade though /proc/ksyms -which is
apparently a list of all the symbols this kernel is aware of ..so likely way more than necessary,
just what happens to be prebuilt,right? not whats actually in-use?

Its a stock slackware-current kernel, only diffrence between -current and 9.1 kernel is an xfs
diff I think

I'm vaguely aware of loadable kernel module exploits, but they seem to all be custom modules
- not unused stock modules that are hanging around on the system to get remotely loaded for
exploiting some vuln they might contain.. is this accurate?

I hear once a box is in a state where an attacker can load modules, its already compromised
anyway, so lkms arent what actually gains the attacker their access.. just what they install
afterwards to gain long-term control/go un-noticed?

The most detailed kernel info I've seen is in the kernel programming howto and the lfs docs..
but I'm still unclear on a few of these issues (attacker still need to first compromise a service
to gain intial access, or..?)

On a side note, has anyone gotten SELinux(Mandatory Access Control/Linux Secure Modules)
to work with slackware? I know debian and definately redhat are known to work, otherwise
the PaX kernel patches that are part of grsecurity seem nice.. some opinion on these?

Any help would be great, thanks in advance
 
Old 11-10-2003, 05:56 AM   #2
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
If you want to avoid lkm's, don't use the modules feature in the kernel,
so no module can be loaded.
As for what's essential to be built in: everything that makes your hardware run ok.
 
Old 11-10-2003, 07:00 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I'm vaguely aware of loadable kernel module exploits, but they seem to all be custom modules
- not unused stock modules that are hanging around on the system to get remotely loaded for
exploiting some vuln they might contain.. is this accurate?

Yes. Using LKM's requires root capabilities (like CAP_SYS_MODULE), and (provided you don't run a vulnerable kernel version) so you need to exploit another condition on the box to gain root caps, so you wouldn't load stock modules unless you know there's a vulnerability to exploit.


I hear once a box is in a state where an attacker can load modules, its already compromised
anyway, so lkms arent what actually gains the attacker their access.. just what they install
afterwards to gain long-term control/go un-noticed?

Yes. LKM's aren't used to exploit the system but to hide processes, resources and files to hide the crackers presence and allow the cracker to keep control and return. If you have an integrity checker running (with databases on ro media) and do remote syslogging (and the syslog box can't be subverted) then it's impossible for the cracker to hide in the "noise".


On a side note, has anyone gotten SELinux(Mandatory Access Control/Linux Secure Modules)
to work with slackware? I know debian and definately redhat are known to work, otherwise
the PaX kernel patches that are part of grsecurity seem nice.. some opinion on these?

PAX is good but it doesn't cover everything (nothing can, OK) and you should look for additional measures beyond that feature. IMHO hardening the system (you already made a start by not running services) and hardening the running kernel, hardening processes, access restrictions, reducing capabilities, advanced logging etc etc should be mandatory on any server box that interacts with users (hell, all boxen). Both Grsecurity and LIDS provide those caps, and I would recommend adding any of them.


A temporary solution, and it doesn't prevent system subversion due to lack of hardening, but you can use "lcap" to take a way capabilities on a system wide scale if for some reason using Grsecurity or LIDS doesn't work for you. It's best done directly after all necessary system modules are loaded.
 
Old 11-11-2003, 02:08 AM   #4
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
I can underline what unSpawn said. Uninstall all required services/software, set restrictive permissions to sensitve data like log files also to specific tools (dmesg & co).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is the Linux kernel a monolithic one? LinuxSeeker Linux - General 4 10-27-2004 07:58 PM
Any Drawbacks for building Monolithic Kernel linuxboy69 Linux - Software 5 08-26-2004 02:41 PM
building a monolithic kernel corbis_demon Linux - Newbie 1 07-14-2004 12:35 PM
linux is a monolithic kernel, but doesn't it have servers like a microkernel? sunowww Linux - General 4 03-15-2004 11:43 PM
Kernel 2.6: Problems loading LKMs... ugenn Linux - Software 1 10-19-2003 06:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration