RKHunterr系統檢測

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分運行一次

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章