- 论坛徽章:
- 0
|
[分享]Nessus + Inprotect 安裝說明
http://phorum.study-area.org/index.php?topic=24392.0
【描述】
Nessus是一套免費及功能強大的弱點掃描系統,而搭配Inprotect可以達到以下功能
特色:
●Web Interface for Nessus & Nmap.
●Support for backend database for security scan results.
●Ability to schedule daily, weekly, monthly or manual scans.
●Automated Nessus plugins update.
●Multi-user.
●Ability to identify false positives within scan results.
●Report generation in PDF format.
●Support for SSL encryption.
●Advanced user management.
●Separation of privileges.
●Advanced reporting using Jpgraph.
●Support for multiple Nessus scanners to perform distributed ●vulnerability testing on large enterprise level networks.
=========================================
作者: zoob (
vincent@myunix.idv.tw
)
版權聲明:可以任意轉載,轉載時請務必標明原始出處和作者資訊
【安裝步驟】
測試環境:
Linux RH 9.0
apache 2.0.49
php 4.3.7
gd 2.0.26
mysql 4.0.20
nessus 2.0.10
inprotect 0.18
一、事前檢查事項:
(1)檢查PHP是否有支援GD2
PHP預設並未將GD2 Compile進去,故請重新Compile Apache + PHP + GD2 + MySQL
二、安裝
(1)安裝Nessus,並確認是否可正常執行Nessus Vulnerability Scan動作
註:此處我並不詳細說明Nesssu安裝步驟,請參閱以下網址說明
安裝及使用Nessus
(2)安裝Inprotect
(2-1)請下載
Inprotec 0.18a 主程式(including JpGraph files)
及
Patch-Install.sh
(2-2)解壓縮 inprotect_018a_jpgraph.tar.gz , 並請執行以下指令
程式碼:
patch -p2
請在 File to patch: 輸入 install.sh
(2-3)編輯console/sql/inprotec.sql,刪除以下敘述(約在 60~75 行間),此敘述會造成Import DB錯誤
程式碼:
CREATE TABLE inprotect_settings (
nessus_plugins_url varchar(255) NOT NULL default '',
nessus_plugins_file varchar(255) NOT NULL default '',
nessus_install_url varchar(255) NOT NULL default '',
nessus_install_file varchar(255) NOT NULL default '',
mailfrom varchar(255) NOT NULL default '',
inprotect_url varchar(255) NOT NULL default '',
inprotect_path varchar(255) NOT NULL default ''
) TYPE=MyISAM;
--
-- Dumping data for table 'inprotect_settings'
--
INSERT INTO inprotect_settings VALUES ('http://www.nessus.org/nasl/','all-2.0.tar.gz','http://install.nessus.org','nessus-installer.sh','root@localhost','http://192.168.1.37','/srv/www/htdocs');
(2-4)執行 install.sh,並選擇你想安裝的Componet選項(如果安裝Web Interface、Database、Scanner在同一台機器的話,請選擇 5)
Inprotect installation
======================
Please run this installation as root user
1 - Install web interface only
2 - Install database only
3 - install web & database components
4 - install scanner only
5 - install web, db & scanner
Q - Quit without installation
Make your selection [1-5]
接下來install.sh會問你一些問題,請依序輸入答案
(2-5)檢查Mysql是否有新增一DB,名稱為Inprotect,並且相關的使用者(Default: inprotect@localhost )是否有權限可存取
(2-6)複製 scanner/nessus_run.pl、scanner/inprotect_reset.pl、scanner/port_scan.pl、console/scripts/fetchupdates.pl、console/scripts/sched.pl ]、console/scripts/updateplugins.pl 至 /usr/local/bin目錄下
(2-7)複製 inprotect.cfg至 /usr/local/etc,並編輯 /usr/local/etc/inprotect.cfg
設定相關選項
#指定Nessus client 的絕對路徑
NESSUSPATH=
#Inprotect所使用的Database 名稱
DATABASENAME=inprotect
#Inprotect所使用的Database ip
DATABASEHOST=localhost
#Inprotect所存取的Database 的使用者名稱
DATABASEUSER=inprotect
#前一選項所提定的Inprotect所存取的Database 的使用者名稱之密碼
DATABASEPASSWORD=inprotect
#Nessus scan logfile存放位置及檔案名稱
NESSUSLOG=/var/log/nessus_scan.log
#Port scan log存放位置及檔案名稱
PORTSCANLOG=/var/log/portscan.log
#Update plugins log file存放位置及檔案名稱
UPDATEPLUGINSLOG=/var/log/updateplugins.log
(2-8)編輯/var/www/html/inprotect/config.php
設定相關選項
#指定dbtype
$dbtype="mysql"
#指定DB的ip
$dbhost="localhost"
#指定存取$dbname的使用者名稱
$dbuname="inprotect"
#指定存取$dbname使用者之密碼
$dbpass="inprotect"
#指定Inprotect的DB name
$dbname="inprotect"
(2-9)以上選項設定完畢後,請執行 updateplugins.pl ,並檢查 /var/log/updateplugins.log 是否有錯誤訊息,更新正常的話,會在 inprotect DB的nessus_plugins Table產生Plugins的相關Record
三、設定Inprotect
(1)開啟瀏覽器,並在網址列裡輸入
http://xxx.xxx.xxx.xxx/inprotect
(2)輸入Username/Password(預設Admin/password)
(3)設定 Settings\Inprotect Settings
設定以下選項
#指定E-mail Report時,寄件者名稱
Mail From Address
#指定Inprotect的FQDN(影響E-mail Report裡的url linke)
Inprotect URL
#指定Inprotect的WebRoot路徑(影響Download Plugins時的暫存路徑)
Inprotect Webroot
(4)設定Settings\Scanner Profiles
建立新Profile(請點選Create New Profile)
(5)設定Settings\Nessus Server
如果有多台Nessus Scanner的話,則請一一建立Nessus Server(請點選Add new Nessus Server)
(6)設定Settings\Network Zones Setup
請依規劃建立各網路區域設定,並指定該網路區域由哪一台Nessus Server來執行弱點掃描
(7)因為Admin權限滿大的,故建立另外建議新增一使用者來負責建立Security Scan(例如:新增一使用者-nessus,權限為Manage Profiles、Manage Zones and Servers、Run Nmap Scans、Run Nessus Scans)
(8)重新登入為該使用者(例如: nessus)
(9)設定Security Scan\Nessus Scan\New Schedule
(9-1)指定Schedules名稱->Save
(9-2)指定要被掃描伺服器Hostname/IP Address,輸入完畢後,請點選Add Host
(9-3)點選Manage Schedule,指定此Schedule要套用的弱點掃描Profile及進行掃描的時間
(10)掃描完畢後所產生的報告會出現在Reports
(11)設定root cron
請新增以下內容至root的cron
程式碼:
*/1 * * * * /usr/local/bin/nessus_run.pl
*/1 * * * * /usr/local/bin/port_scan.pl
*/1 * * * * /usr/local/bin/sched.pl
5 * * * * /usr/local/bin/fetchupdates.pl
註1:如要進行中文化,請自行修改 /var/www/html/inprotect 目錄下 相關的 php 檔案即可。
註2:如要修改 E-mail Report 主旨,請自行修改 /usr/local/etc/inprotect.conf
註3:如要修改 E-mail Report 內容,請自行修改 /usr/local/bin/sched.pl
註4:執行updateplugins.pl時,會出現「ERROR 1062 at line 1150: Duplicate entry "12007" for key 1」
請將/usr/local/etc/nessus/plugins目錄下所有的檔案全數刪除,並請清空 inprotect DB的nessus_plugins Table。並請重新執行 updateplugins.pl
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/504/showart_1804230.html |
|