Linux: chkrootkit daily scanning
As a security for your server, or your company server, checking with chkrootkit if the system wasn’t compromised is a very good idea. On the net you can find a lot of small scripts which can detect 1-2 rootkit or something similar to rootkits, but none of this can detect and remove so many rootkits as chkrootkit can.
Chkrootkit can be found at chkrootkit.org, from where you can download it or read related documentation about it and so on.
Now lets pretend that you already have chkrootkit on your server and its working, but to be able to scan you need to do this manually, which means you need to login into the system every time.
For me it was the same, I had chkrootkit on the system, was running and doing its job, but that meant for me to be login and run it myself. For this I created a small script which will enable me and now you of course to run this in crontab and sent the output to a certain email address.
The code:
#!/bin/bash
PWD=/path/to/chkrootkit/folder
MAIL=somemail@domain.org
DATE=$(date +%d-%m-%Y” “%H:%M)
HOST=$(hostname -f)test -d $PWD && cd $PWD || exit 1
./chkrootkit 2>&1 | mail -s “chkrootkit scan on $HOST – $DATE” $MAIL
Save this script anywhere you want, run chmod +x scriptname and then we need to add it to crontab. So here it is:
0 3 * * * ( /path/to/the/script/scriptname ) >/dev/null 2>&1
“0 3 * * *” means that this script will run everynight at 3AM
For me this works every night and I am receiving in mail all of the output where I can nicely check it and if in case there is something, but only then, I will login into the server and do the necesary changes.
Try it out and let me know how it will work for you…
| Print article | This entry was posted by robert on January 13, 2009 at 09:47, and is filed under Linux. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
No comments yet.
No trackbacks yet.
Kernel 2.6.34.1-blackjack released for Debian/Ubuntu (Blackjack)
about 3 weeks ago - 5 comments
I haven’t been writing on my blog for quite a while and I guess now I should, well actually The Kernel Development just released kernel 2.6.34.1, so I have a good reason for adding a new post .
This kernel really stayed in the cooker for some time, as version 2.6.34 was release two months ago. I
Kernel 2.6.34-final is here!
about 2 months ago - 4 comments
After a couple of days of waiting for BFS scheduler patch and rebuilding the patch for ureadahead, kernel 2.6.34-final is here. I know, again, it’s with a certain delay, but some parts are not in my control and it’s not much that I can do about it.
As usual, the same stuff are included in this
Kernel 2.6.33.3-soultrain released for Debian/Ubuntu (Soultrain)
about 2 months ago - 8 comments
Well first of all, sorry for this late release, but had some stuff to handle which at that point in time where more important. Kernel 2.6.33.3 was released last week and it comes like always with a bunch of bug fixes, improvements and new stuff added. I’m not gonna go into them, because there are
Kernel 2.6.33.2-coolcat released for Debian/Ubuntu (Coolcat)
about 3 months ago - 12 comments
A couple of days ago Kernel 2.6.33.2 was released. Due to the Easter holidays, I didn’t have the time to build this kernel, but yesterday evening somehow I get around it and now the packages are ready for use.
There are no major stuff added in this kernel from my side, besides the removal of PAE
Kernel 2.6.33.1-beetlejuice released for Debian/Ubuntu (Beetlejuice)
about 4 months ago - 2 comments
Another day, another kernel, another kernel package. To be damn honest, I can’t keep up with the kernel development team. They are releasing kernels like on a production line. It’s almost impossible for a single person to keep the the releases on time, but I’m trying
Anyway, I will keep this short and tell
Brain Fuck Scheduler and Kernel 2.6.33 (2.6.33-final-bfs)
about 4 months ago - 5 comments
A couple of days ago, I discovered, thanks to PCLinuxOS, a new kernel scheduler, Brain Fuck Scheduler or BFS. The name of this kernel scheduler is not very attractive, but what this scheduler does, is. It seems that this scheduler is more simple and fast, especially when it comes to low spec computers.
Because I’ve tried
Kernel 2.6.33-final is here!
about 5 months ago - No comments
A couple of days ago kernel 2.6.33 was released. Due to some personal issues which I had to deal with, I couldn’t actually release the packages sooner than now.
Because I don’t wanna carry too much about this and that and plus I don’t really have much time, I will just say that this final release
Kernel 2.6.32.8-pharox released for Debian/Ubuntu (Pharox)
about 5 months ago - 4 comments
Today seems a good day to release a new kernel package. It’s Friday, it’s almost weekend and why not have some fun with a new kernel release. The kernel was release a couple of days ago, but to be honest, I couldn’t build it due to not having a machine working on some older Ubuntu.
Kernel 2.6.32.7-firefly released for Debian/Ubuntu (Firefly)
about 6 months ago - No comments
Now I know I’m gonna repeat myself, but this is the 4th release in 2 weeks. I’m not sure how come there are so many release out of the door, but seems there are a lot of fixes added to each release. So this release is 2.6.32.7 which seems to bring more improvements and fixes
Kernel 2.6.32.6-jackson released for Debian/Ubuntu (Jackson)
about 6 months ago - 1 comment
Just a couple of days ago, kernel.org developers have release kernel 2.6.32.4, then soon after 2.6.32.5 and now 2.6.32.6. Seems something has change or a lot of bugs where fixed, because in less then 5 days (well +/-) they release tree version. One thing I have noticed in 2.6.32.6 is that the i915 module and
