网站的发展需要你贡献一份力量!希望你能每天坚持看贴1小时,并回答网友的问题!祝你在浏览论坛的过程中取得进步!谢谢!linuxtone加油!大家加油! 友情提示: 你今天学习了吗?你今天进步了吗?Life is short ! Why not linuxtone ?   [防垃圾注册] 申请邀请码,请发邮件致:active@linuxtone.org 同时请论坛会员互相赠送邀请码给新人,谢谢!

Linux快速入门之命令及课件下载 LinuxTone命令一句话 Pxe+dhcp+nfs+tftp网络安装centos
apache2+tomcat5.5集群+session同步 LEMP构建高性能WEB服务器(第三版) Nginx 常见应用技术指南[Nginx Tips] 第二版
Apache常见问题汇总 基于CentOS构建高性能的LAMP平台 初次体验:LEMP+Openx
<数据库服务器>->导读<-> Bind主从配置(Master/Slave) <网站服务器>->导读<->
LVS+Heartbeat实施案例及经验分享 LVS高可用方案汇总{精} 利用LVS+Keepalived实现高可用集群
Nagios 3.x 实战解决方案相关贴 LVS 负载均衡相关文档汇总 利用红帽Piranha方案实现WEB负载均衡
Squid/Varnish/Memcached/Cache Cacti相关文档汇总 [流量监控] 性能调优 | 架构研究 |
利用Awstats分析网站日志 {日志分析} Nagios监控相关资料汇总 基于bsd watch监控用户操作记录
[Linux 每日小技巧] 5、显示10条最常用的命令:sed -e "s/| /\n/g" ~/.bash_history | cut -d ' ' -f 1 | sort | uniq -c | sort -nr | head

[LinuxTone官方学习交流MSN群]:mgroup49073@hotmail.com linuxtone超级QQ2群: 47664138 (请先在论坛注册,积级参加互动,再加入此群,来者报论坛ID,最好 论坛昵称+公司名,需要审核通过) (欢迎linuxtone站内的朋友加入拒绝闲聊![需要正确回答问题才能加入该群:你是从那个网站得知本群号的?答案:linuxtone ]) 感谢您对linuxtone的支持!共建良好技术分享社区! 本站RSS订阅地址:http://bbs.linuxtone.org/rss.php

返回列表 发帖

[系统安全] 使用Chkrootkit 检测系统木马

本文来自: IT运维专家网(LinuxTone.Org) 作者: NetSeek 日期: 2008-6-8 11:04 阅读: 1559打印 收藏
原文链接:http://bbs.linuxtone.org/thread-314-1-1.html IT运维专家网--"自由平等,互助分享!"
Chkrootkit is a powerful tool to scan your *nux server for trojans. Here i explain how to install it, scan your server and setup a daily automated scanning job that emails you the report.


#Change to root
su -

#Download latest source
wget ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz

#Unpack the source file using the command
tar xvzf chkrootkit.tar.gz

#Change to chkrootkit source directory
cd chkrootkit

#Compile chkrootkit
make sense

#To run chkrootkit, type
./chkrootkit


A clean system should return many 'nothing found" or not infected. A comprised system may return 'INFECTED" or vulnerable.

Lastly, chkrootkit should run once a day to ensure system safety. The following script created in /etc/cron.daily will scan system one per day and report detected trojan to specified persons via emails:


# cat /etc/cron.daily/chkrootkit.sh
#!/bin/bash

SYSADMIN1=admin1@email.com
SYSADMIN2=admin2@email.com

TMPDIR=/tmp
HOSTNAME=`hostname`
DATE=`date "+%d/%m/%Y %H:%M"`
CHKROOTKIT=/usr/local/chkrootkit-0.46a/chkrootkit
MAIL=mail

# Clean up before its runs
rm -f $TMPDIR/chkrootkit.$$
if [ -f $TMPDIR/chkrootkit.$$ ]; then
echo "Checkroot kit temp files exist in $TMPDIR directory that cannot be removed. This may be an attempt to spoof the checker." | $MAIL -s "$HOSTNAME $DATE ACTIVE SYSTEM ATTACK!" -c $SYSADMIN1 $SYSADMIN2
exit 1
fi

# Check for root kits
$CHKROOTKIT | grep INFECTED > $TMPDIR/chkrootkit.$$
if [ -s $TMPDIR/chkrootkit.$$ ]; then
cat $TMPDIR/chkrootkit.$$ | $MAIL -s "$DATE - ROOTKIT DETECTED ON $HOSTNAME!" -c $SYSADMIN1 $SYSADMIN2
fi

# Clean Up
rm -f $TMPDIR/chkrootkit.$$
收藏 分享
LinuxTone.Org IT运维专家(系统服务|集群架构|安全监控|性能优化|程序设计)
最专业的Linux集群架构网,IT运维人员的乐园!  mail:netseek@linuxtone.org  
分享才能进步!帮助他人就是在帮助自己! 共同学习探讨Linux! 感谢社区的朋友们!
常常帮助别人的人,更容易得到帮助! LinuxTone技术分享社区!

不错不错,受用了

TOP

返回列表

IT运维专家网感谢红之盟网络提供带宽支持

合作联系: QQ:67888954/MSN:cnseek@msn.com/mail:netseek@linuxtone.org