您的位置:首页 > 其它

RKHunterr系统检测

2015-12-13 17:47 281 查看
RKHunter官网为:http://www.rootkit.nl/projects/rootkit_hunter.html

rkhunter是专业检测系统是否感染rootkit的一个工具,通过脚本来确认系统是否感染rootkit,rootkit可以实现的功能:
【1】MD5校验测试,检测文件是否有过改动
【2】检测rootkiit使用的二进制和系统工具文件
【3】检测特洛伊木马程序的特征码
【4】检测系统常用文件程序是否正常
【5】检测系统相关测试
【6】检测隐藏系统文件
【7】检测可疑的核心模块KVM
【8】检测系统已启动的监听端口

本次使用rootkit-1.4.2的版本,具体过程:
[root@server ~]# cd /usr/local/src
[root@server ~]# wget http://skylineservers.dl.sourcef ... hunter-1.4.2.tar.gz
[root@server ~]# tar zxf rkhunter-1.4.2.tar.gz -C .
[root@server ~]# cd rkhunter-1.4.2
[root@server ~]# ./installer.sh --layout default --install
这里采用默认安装方式。rkhunter默认安装到/usr/local/sbin/目录下

rkhunter工具参数较多,使用比较简单,直接运行rkhunter会显示命令用法,以下列出部分常用参数
-c,--check 检测当前系统
--configfile <file> 指定特定配置文件
--cronjob 作为计划任务运行
--sk,--skip-keypress 自动完成所有检测,跳过交互确认
--summary 显示检测结果统计信息
--update 检测更新内容
-V,--version 显示版本信息
--versioncheck 检测新版本

使用/usr/local/bin/rkhunter -c来对系统进行检测
下面是第一部分内容,先进行系统命令检测。主要是检测系的二进制文件,这些文件最容易被rootkit感染攻击。显示OK字样表示正常,显示Werning表示异常,显示Not found则不需太大注意
[ Rootkit Hunter version 1.4.2 ]

Checking system commands...

Performing 'strings' command checks
Checking 'strings' command [ OK ]

Performing 'shared libraries' checks
Checking for preloading variables [ None found ]
Checking for preloaded libraries [ None found ]
Checking LD_LIBRARY_PATH variable [ Not found ]

Performing file properties checks
Checking for prerequisites [ Warning ]
/usr/local/bin/rkhunter [ OK ]
/sbin/chkconfig [ OK ]
/sbin/depmod [ OK ]
/sbin/fsck [ OK ]
/sbin/fuser [ OK ]
>>>>>>>>>>>>>>
略<<<<<<<<<<<<<<<<<<<<<<<<<<

以下是第二部分,主要检测常见的rootkit程序。显示Not found表示系统未感染此rootkit

Checking for rootkits...

Performing check of known rootkit files and directories
55808 Trojan - Variant A [ Not found ]
ADM Worm [ Not found ]
AjaKit Rootkit [ Not found ]
Adore Rootkit [ Not found ]
aPa Kit [ Not found ]
Apache Worm [ Not found ]
Ambient (ark) Rootkit [ Not found ]
>>>>>>>>>>>>>>
略<<<<<<<<<<<<<<<<<<<<<<<<<<<

第三部分,主要一些特殊或附件检测,如针对rootkit文件及目录检测、对恶意软件检测及指定内核模块检测显示

Performing additional rootkit checks
Suckit Rookit additional checks [ OK ]
Checking for possible rootkit files and directories [ None found ]
Checking for possible rootkit strings [ None found ]

Performing malware checks
Checking running processes for suspicious files [ None found ]
Checking for login backdoors [ None found ]
Checking for suspicious directories [ None found ]
>>>>>>>>>>>>>>
略<<<<<<<<<<<<<<<<<<<<<<<<<<<

第四部分。对网络、系统端口,系统启动文件,系统用户和组配置、ssh配置、文件系统检测等

Checking the network...

Performing checks on the network ports
Checking for backdoor ports [ None found ]

Performing checks on the network interfaces
Checking for promiscuous interfaces [ None found ]
>>>>>>>>>>>>>>
略<<<<<<<<<<<<<<<<<<<<<<<<<<<

第五部分:主要针对应用程序版本进行检测
Checking the local host...

Performing system boot checks
Checking for local host name [ Found ]
Checking for system startup files [ Found ]
Checking system startup files for malware [ None found ]
>>>>>>>>>>>>>>
略<<<<<<<<<<<<<<<<<<<<<<<<<<<

第六部分:这部分输出是上面所有的检测一个总结,从此可以大概了解服务器目录安全状态

Checking application versions...

Checking version of GnuPG [ OK ]
Checking version of OpenSSL [ OK ]
Checking version of PHP [ OK ]
Checking version of Procmail MTA [ OK ]
Checking version of OpenSSH [ OK ]

System checks summary
=====================

File properties checks...
Required commands check failed
Files checked: 142
Suspect files: 5

>>>>>>>>>>>>>>
略<<<<<<<<<<<<<<<<<<<<<<<<<<<

在linux终端使用RKHunter检测,可直接显示问题。绿色表示正常,红色表示有问题的,那就需要关注了。以上RPHunter检测需要Enter来确认继续检测。要实现自动检测,需要执行以下命令:
[root@server ~]# /usr/local/bin/rkhunter --check --skip-keypress
如果想使用rkhunter计划任务运行,可加入/etc/crontab计划任务:
00 00 * * * /usr/local/bin/rhkunter --check --cronjob ##RHKunter会在每天0点0分运行一次

本文出自 “linux窝” 博客,谢绝转载!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: