r/rootkit • • Jun 21 '13

Linux rootkit tutorial

http://beneathclevel.blogspot.co.uk/
13 Upvotes

15 comments sorted by

View all comments

Show parent comment

2

u/iheartrms Jun 23 '13

Good points about mem and kmem. I do keep them locked down. RedHat/Fedora/CentOS don't ship with /dev/kmem and I use puppet to ensure perms on /dev/mem are set correctly. Plus SELinux prevents anyone not in sysadm_r role from accessing it. Everything starts out in userland and SELinux is a significant barrier to escaping from it. You would have to change your role and your uid. SELinux also enables a lot of logging. Odds are good they will have a lot of avc denials while attempting their exploit. These get logged (to a remote log host if you really care about security) to be picked up during the daily log review (if you care about security). But yes, ultimately if someone gets access to ring0 it is game over. I try to at least log enough to places they can't touch to detect it. Security is all about prevention (SELinux), detection (auditd logging remotely with log reviews), and response (forensics, find root cause, fix it, wipe/reinstall affected systems).

2

u/TurboBorland123 Jun 23 '13

That's a pretty fun setup. I don't see much boxes that actually take the time to fine grain selinux. When I see shit like this, I just go old school and hope they're a sudo user. Aliasing sudo switches in .bashrc (so we can take advantage of it being sticky and setting privileges before launching the command/program given) as no one seems to really care about that.

By chance you running PaX/GrSecurity for protection from dying forks and such? This also gives off a lot of exploit attempt logs to export.