且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

linux系统rootkit恶意软件安全检测工具rkhunter安装部署、使用

更新时间:2021-09-22 04:04:59

Rootkit Hunter

    中文名叫”Rootkit猎手”, 可以发现大约58个已知的rootkits和一些嗅探器和后门程序. 它通过执行一系列的测试脚本来确认你的机器是否已经感染rootkits. 比如检查rootkits使用的基本文件, 可执行二进制文件的错误文件权限, 检测内核模块等等. Rootkit Hunter由Michael Boelen开发, 是开源(GPL)软件.目前最新版本1.4.2
官方现在地址:http://sourceforge.net/projects/rkhunter/
一.rkhunter安装
下载的是最新版本的1.4.2
#wget -S http://downloads.sourceforge.net/project/rkhunter/rkhunter/1.4.2/rkhunter-1.4.2.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Frkhunter%2F&ts=1397456404&use_mirror=jaist
现在完成后只需要解压,运行./install.sh即可
#tar zxvf rkhunter-1.4.2.tar.gz
#cd  rkhunter-1.4.2
# ./installer.sh --install   #一般没有错误很快会完成

点击(此处)折叠或打开

  1. Checking system for:
  2.  Rootkit Hunter installer files: found
  3.  A web file download command: wget found
  4. Starting update:
  5.  Checking installation directory "/usr/local": it exists and is writable.
  6.  Checking installation directories:
  7.   Directory /usr/local/share/doc/rkhunter-1.4.2: exists and is writable.
  8.   Directory /usr/local/share/man/man8: exists and is writable.
  9.   Directory /etc: exists and is writable.
  10.   Directory /usr/local/bin: exists and is writable.
  11.   Directory /usr/local/lib64: exists and is writable.
  12.   Directory /var/lib: exists and is writable.
  13.   Directory /usr/local/lib64/rkhunter/scripts: exists and is writable.
  14.   Directory /var/lib/rkhunter/db: exists and is writable.
  15.   Directory /var/lib/rkhunter/tmp: exists and is writable.
  16.   Directory /var/lib/rkhunter/db/i18n: exists and is writable.
  17.   Directory /var/lib/rkhunter/db/signatures: exists and is writable.
  18.  Installing check_modules.pl: OK
  19.  Installing filehashsha.pl: OK
  20.  Installing stat.pl: OK
  21.  Installing readlink.sh: OK
  22.  Installing backdoorports.dat: OK
  23.  Installing mirrors.dat: OK
  24.  Installing programs_bad.dat: OK
  25.  Installing suspscan.dat: OK
  26.  Installing rkhunter.8: OK
  27.  Installing ACKNOWLEDGMENTS: OK
  28.  Installing CHANGELOG: OK
  29.  Installing FAQ: OK
  30.  Installing LICENSE: OK
  31.  Installing README: OK
  32.  Installing language support files: OK
  33.  Installing ClamAV signatures: OK
  34.  Installing rkhunter: OK
  35.  Installing rkhunter.conf in no-clobber mode: OK
  36.  >>>
  37.  >>> PLEASE NOTE: inspect for update changes in "/etc/rkhunter.conf.6525",
  38.  >>> and apply to either "/etc/rkhunter.conf" or your local configuration
  39.  >>> file before running Rootkit Hunter.
  40.  >>>
  41. Update complete

二.检测系统是否感染后门或恶意软件
安装完成后运行rkhunter会出现帮助信息
1.为基本系统程序建立校对样本,建议系统安装完成后就建立。
 执行命令:
 rkhunter --propupd
 ls /var/lib/rkhunter/db/rkhunter.dat #样本文件位置
2.查杀后门执行命令:
 rkhunter --check
只显示报警信息可以运行
rkhunter -c --rwo (report-warnings-only,只显示报警信息)
扫描完成后会生成一份日志存放在/var/log/rkhunter.log
3.在线升级rkhunter
 rkhunter是通过一个含有rootkit名字的数据库来检测系统的rootkits漏洞, 所以经常更新该数据库非常重要, 你可以通过下面命令来更新该数据库:
 执行命令:
 rkhunter --update
4.检测最新版本
让 rkhunter 保持在最新的版本;
执行命令:
rkhunter --versioncheck