Linux系统扼杀恶意软件的三款应用软件

1.chkrootkit

我使用chkrootkit有多年。简而言之,它可扫描系统中的重要文件以查找rootkit。 rootkit是一堆恶意程序,旨在危及root用户帐户,并长时间访问系统。rootkit很难检测,也很难从系统中删除。我听好多系统管理员这么说:如果系统是rootkit的受害者,应为系统重建映像(格式化并从存储介质重新安装),然后从干净备份还原所有数据。

是的,这是一种解决方案,但是你是否曾为系统重建映像,能够让系统恢复到感染之前的状态?反正我从来没有过。新系统总是遗漏一些东西,这些总是“关键”的东西。我花了无数时间寻找旧版软件、搜索旧文档,并寻找存储介质来重新安装再也没人支持、可能再也没有合法许可证的一些必要软件。话题扯远了。

你可以使用chkrootkit扫描许多类型的rootkit,并检测某些日志删除。虽然它无法删除任何受感染的文件,但确实会告诉你具体哪些文件被感染,以便你可以删除/重装/修复文件或软件包。

请遵照以下简单过程,使用chkrootkit下载、安装和扫描系统。使用sudo或su成为root用户。


  1. # yum update  
  2. # yum install wget gcc-c++ glibc-static  
  3. # wget -c ftp://ftp.pangeia.com.br/pub/seg/pac/chkrootkit.tar.gz  
  4. # tar –zxvf chkrootkit.tar.gz  
  5. # mkdir /usr/local/chkrootkit  
  6. # mv chkrootkit-0.xx/* /usr/local/chkrootkit  
  7. # cd /usr/local/chkrootkit  
  8. # make sense  
  9. << compile output >>  
  10. # /usr/local/chkrootkit/chkrootkit  
  11. ROOTDIR is `/'  
  12. Checking `amd'… not found  
  13. Checking `basename'… not infected  
  14. Checking `biff'… not found  
  15. Checking `chfn'… not infected  
  16. Checking `chsh'… not infected  
  17. Checking `cron'… not infected  
  18. Checking `crontab'… not infected  
  19. Checking `date'… not infected  
  20. Checking `du'… not infected  
  21. Checking `dirname'… not infected  
  22. Checking `echo'… not infected  
  23. << more output >> 

chkrootkit脚本报告受感染的文件。我从未遇到过误报,但你碰到的情况可能不一样。我在管理的每个Linux系统上都安装了chkrootkit。我还设置了计划任务(cron job),执行上述所有步骤(除安装依赖项之外),以便我始终拥有更新后的集合。我还将输出重定向到用户帐户主目录中的一个文件。可以选择在脚本末尾通过电子邮件将文本报告发送给你。

chkrootkit脚本仅需几秒钟即可扫描和报告,因此使用它并不浪费时间或精力。

2.rkhunter

RootKit Hunter(rkhunter)是一个rootkit检测脚本,可以自动扫描许多不同的rootkit及其他本地漏洞。我爱rkhunter,用它也已有多年。与chkrootkit不同,rkhunter在/var/log/rkhunter/rkhunter.log中提供了记录发现结果的完整日志。如果你只安装和运行一款恶意软件扫描应用软件,它可能应该是rkhunter。

以下是在系统上安装和运行rkhunter的方法。使用sudo或su成为root用户。


  1. # yum -y install epel-release  
  2. # yum -y install rkhunter  
  3. # rkhunter -c  
  4. [ Rootkit Hunter version 1.4.6 ]  
  5. Checking system commands…  
  6. Performing 'strings' command checks  
  7. Checking 'strings' command [ OK ]  
  8. Performing 'shared libraries' checks  
  9. Checking for preloading variables [ None found ]  
  10. Checking for preloaded libraries [ None found ]  
  11. Checking LD_LIBRARY_PATH variable [ Not found ]  
  12. << lots of output >>  
  13. System checks summary  
  14. =====================  
  15. File properties checks…  
  16. Required commands check failed  
  17. Files checked: 129  
  18. Suspect files: 4  
  19. Rootkit checks…  
  20. Rootkits checked : 494  
  21. Possible rootkits: 0  
  22. Applications checks…  
  23. All checks skipped  
  24. The system checks took: 1 minute and 38 seconds  
  25. All results have been written to the log file: /var/log/rkhunter/rkhunter.log  
  26. One or more warnings have been found while checking the system.  
  27. Please check the log file (/var/log/rkhunter/rkhunter.log) 

rkhunter有时会标记你手动更改的文件。我的四个“可疑”文件中有两个是passwd和group,这两个都是我手动更改的文件。它还会通过touch、vi或者更改原始访问或修改日期的另外某个程序,标记你有意或无意修改的文件。ifup和ifdown是我系统上被标为可疑的另外两个文件。我还没有搞清楚原因,但觉得这两个都不是问题。

就算你认为自己知道情况,也要核查所有被标记的文件。

【声明】:芜湖站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。

相关文章