使用chkrootkit工具检查linux服务器是否被攻击

    在检查linux是否被攻击的时候,可以通过如下几个简单方法:
1) ps awuxf 查看进程
2) rpm -V SysinitV检查关键系统包
  
但是,如果ps和rpm命令本身都被替换掉了,则无法检查出问题。
这里可以使用chkrootkit的工具检查,这是一个开放源代码的安全检测工具
他的官方网站是www.chkrootkit.org 。

首先下载chkrootkit工具(这里提供的是for redhat as4 linux 的版本)
 
 wget http://www.swsoft.com.cn/downloads/Prima/Tools/chkrootkit-0.47-2.i386.rpm

安装这个rpm包
rpm -ivh chkrootkit-0.47-2.i386.rpm

运行
chkrootkit

查看输出的结果:
root@3.5.5Biz-46 ~]# chkrootkit
ROOTDIR is `/'
Checking `amd'... not found
Checking `basename'... not infected
Checking `biff'... not found
Checking `chfn'... not infected
  Checking `chsh'... not infected
Checking `cron'... not infected
Checking `crontab'... not infected
Checking `date'... not infected
Checking `du'... not infected
Checking `dirname'... not infected
Checking `echo'... not infected
Checking `egrep'... not infected
Checking `env'... not infected
Checking `find'... not infected
Checking `fingerd'... not found
Checking `gpm'... not infected
Checking `grep'... not infected

其中not infected就表示没有被感染。

注意,在prima for linux的服务器上,可能会出现误报:
Checking `scalper'... Warning: Possible Scalper Worm installed
  这是因为,prima for linux的功能服务器安装了acasd后台服务
  而acasd占用的端口正好是2001,和名为Scalper Worm的蠕虫占用的端口相同
  所以可能会被误报为病毒。
  关于Scalper Worm的信息,可查看Symantec的官方报告:
  http://www.symantec.com/security_response/writeup.jsp?docid=2002-062814-5031-99
  
  Symantec的官方报告中提到:
  * Distribution Level: Low
  * Ports: 2001
  * Target of Infection: unpatched Apache Webservers on the FreeBSD operating system
  
  就是其中的port 2001引起误报。
  
  在chkrootkit中的chkrootkit的源代码中,也可以找到如下代码:
  scalper (){
  SCALPER_FILES="${ROOTDIR}tmp/.uua ${ROOTDIR}tmp/.a"
  SCALPER_PORT=2001
  OPT=-an
  STATUS=0
  
  if ${netstat} "${OPT}" | ${egrep} "0.0:${SCALPER_PORT} "> /dev/null 2>&1; then
  STATUS=1
  fi
  for i in ${SCALPER_FILES}; do
  if [ -f ${i} ]; then
  STATUS=1
  fi
  done
  if [ ${STATUS} -eq 1 ] ;then
  echo "Warning: Possible Scalper Worm installed"
  else
  if [ "${QUIET}" != "t" ]; then echo "not infected"; fi
  return ${NOT_INFECTED}
  fi
  }

  

本文转自 linuxpp 51CTO博客,原文链接:http://blog.51cto.com/1439337369/1743202,如需转载请自行联系原作者

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值