OpenVAS漏洞掃描基礎教程之OpenVAS概述及安裝及配置OpenVAS服務

OpenVAS漏洞掃描基礎教程之OpenVAS概述及安裝及配置OpenVAS服務

OpenVAS基礎知識

OpenVASOpen Vulnerability Assessment System)是開放式漏洞評估系統,其核心部分是一個服務器。該服務器包括一套網絡漏洞測試程序,能夠檢測遠程系統和應用程序中的安全問題。OpenVAS不一樣與傳統的漏洞掃描軟件。全部的OpenVAS軟件都是免費的,並且還採用了Nessus(一款強大的網絡掃描工具)較早版本的一些開放插件。雖然Nessus很強大,可是該工具不開源,並且免費版的功能又比較侷限。因此,本章將對OpenVAS工具進行詳細介紹。html

OpenVAS概述

OpenVAS是開放式漏洞評估系統,也能夠說它是一個包含着相關工具的網絡掃描器。本節將對OpenVAS的概念及架構作一個簡單介紹。python

什麼是OpenVAS

OpenVAS是一款開放式的漏洞評估工具,主要用來檢測目標網絡或主機的安全性。該工具是基於C/S(客戶端/服務器),B/S(瀏覽器/服務器)架構進行工做,用戶經過瀏覽器或者專用客戶端程序來下達掃描任務,服務器端負載受權,執行掃描操做並提供掃描結果。git

OpenVAS的架構

一套完整的OpenVAS系統包括服務器端和端口端的多個組件,如圖1.1所示。redis

1.1  OpenVAS的架構sql

上圖就是OpenVAS系統的一個架構。下面分別介紹服務器層和客戶層,分別所需安裝的組件。以下所示:瀏覽器

1.服務器層組件(建議都安裝)安全

  • q  openvas-scanner(掃描器):負責調用各類漏洞檢測插件,完成實際的掃描操做。ruby

  • q  openvas-manager(管理器):負責分配掃描任務,並根據掃描結果生產評估報告。服務器

  • q  openvas-administrator(管理者):負責管理配置信息,用戶受權等相關工做。網絡

2.客戶層組件(任選其一便可)

  • q  openvas-cli(命令行接口):負責提供從命令行訪問OpenVAS服務層程序。

  • q  greenbone-security-assistant(安裝助手):負責提供訪問OpenVAS服務層的Web接口,便於經過瀏覽器來創建掃描任務,是使用最簡便的客戶層組件。

  • q  Greenbone-Desktop-Suite(桌面套件):負責提供訪問OpenVAS服務層的圖形程序界面,主要容許在Windows客戶機中。

提示:OpenVAS服務器端僅支持安裝Linux操做系統中。可是,客戶端安裝在WindowsLinux系統都可。

安裝及配置OpenVAS服務

當對OpenVAS工具瞭解後,就能夠來使用該工具了。在使用該工具以前,首先介紹下它的安裝方法。

安裝OpenVAS

OpenVAS工具的安裝比較簡單,並且在OpenVAS官網提供了在各類操做系統中的安裝方法。其下載地址爲http://www.openvas.org/install-packages.html。可是,若是用戶在安裝時,可能會出現不少依賴包須要手動解決。若是不可以很好的解決依賴關係包,將沒法成功安裝OpenVAS工具。因此,爲了方便用戶使用,Kali Linux系統中已經默認安裝了該工具,用戶能夠直接使用。

若是用戶發現本身系統中安裝的OpenVAS不是最新版本的話,能夠經過如下方法安裝最新版的OpenVAS工具。具體方法以下所示:

1更新軟件包列表。執行命令以下所示:

  • root@Kali :~# apt-get update

執行以上命令後,將會獲取最近的軟件包列表。

2獲取到最新的軟件包,。執行命令以下所示:

  • root@Kali :~# apt-get dist-upgrade

執行以上命令後,將會對有更新的包進行下載並安裝。

3從新安裝OpenVAS工具。執行命令以下所示:

  • root@Kali :~# apt-get install openvas

執行以上命令後,若是沒有報錯,則說明已成功安裝OpenVAS工具。若是當前系統中已經安裝了最新版的OpenVAS軟件,將會顯示如下相似信息:

  • 正在讀取軟件包列表... 完成

  • 正在分析軟件包的依賴關係樹      

  • 正在讀取狀態信息... 完成      

  • openvas 已是最新的版本了。

下列軟件包是自動安裝的而且如今不須要了:

  •   firmware-mod-kit libafpclient0 libhackrf liblzma-dev libmozjs22d libnet-daemon-perl libnfc3 libplrpc-perl

  •   libruby libtsk3-3 libwireshark2 libwiretap2 libwsutil2 openjdk-7-jre-lib python-apsw python-utidylib

  •   ruby-crack ruby-diff-lcs ruby-rspec ruby-rspec-core ruby-rspec-expectations ruby-rspec-mocks ruby-simplecov

  •   ruby-simplecov-html unrar-free xulrunner-22.0

  • Use 'apt-get autoremove' to remove them.

  • 升級了 0 個軟件包,新安裝了 0 個軟件包,要卸載 0 個軟件包,有 20 個軟件包未被升級。

從以上輸出信息中,能夠看到OpenVAS已是最新版本了。

配置OpenVAS服務

OpenVAS工具安裝成功後,還須要進行一些配置纔可使用。例如,初始化服務、同步插件及啓動服務等。下面將介紹在Kali Linux中配置OpenVAS服務的方法。

【示例1-1】配置OpenVAS服務。具體操做步驟以下所示:

1下載並更新OpenVAS庫。執行命令以下所示:

  • root@Kali :~# openvas-setup

  • /var/lib/openvas/private/CA created

  • /var/lib/openvas/CA created                                                              #建立證書

  • [i] This script synchronizes an NVT collection with the 'OpenVAS NVT Feed'.

  • [i] The 'OpenVAS NVT Feed' is provided by 'The OpenVAS Project'.

  • [i] Online information about this feed: 'http://www.openvas.org/openvas-nvt-feed.html'.

  • [i] NVT dir: /var/lib/openvas/plugins

  • [w] Could not determine feed version.

  • [i] rsync is not recommended for the initial sync. Falling back on http.

  • [i] Will use wget

  • [i] Using GNU wget: /usr/bin/wget

  • [i] Configured NVT http feed: http://www.openvas.org/openvas-nvt-feed-current.tar.bz2

  • [i] Downloading to: /tmp/openvas-nvt-sync.QH0Vl5ckzd/openvas-feed-2015-07-28-23736.tar.bz2

  • --2015-07-28 09:53:24--  http://www.openvas.org/openvas-nvt-feed-current.tar.bz2

  • 正在解析主機 www.openvas.org (www.openvas.org)... 5.9.98.186

  • 正在鏈接 www.openvas.org (www.openvas.org)|5.9.98.186|:80... 已鏈接。

  • 已發出 HTTP 請求,正在等待迴應... 200 OK

  • 長度:17065793 (16M) [application/x-bzip2]

  • 正在保存至/tmp/openvas-nvt-sync.QH0Vl5ckzd/openvas-feed-2015-07-28-23736.tar.bz2

  • 100%[======================================================================>] 17,065,793   337K/s 用時 34s    

  • 2015-07-28 09:54:09 (484 KB/s) - 已保存 /tmp/openvas-nvt-sync.QH0Vl5ckzd/openvas-feed-2015-07-28-23736.tar.bz2 [17065793/17065793])

  • 2008/

  • 2008/deb_008_1.nasl                                                                        #同步NVT

  • ...... Please report synchronization problems to openvas-feed@intevation.de.

  • If you have any other questions, please use the OpenVAS mailing lists

  • or the OpenVAS IRC chat. See http://www.openvas.org/ for details.

  • receiving incremental file list

  • ./

  • COPYING

  •         1493 100%    1.42MB/s    0:00:00 (xfer#1, to-check=63/65)

  • COPYING.asc

  •          198 100%  193.36kB/s    0:00:00 (xfer#2, to-check=62/65)

  • nvdcve-2.0-2002.xml

  •     19454677 100%  224.29kB/s    0:01:24 (xfer#3, to-check=61/65)

  • nvdcve-2.0-2002.xml.asc

  •          198 100%    0.44kB/s    0:00:00 (xfer#4, to-check=60/65)

  • nvdcve-2.0-2003.xml

  •      5691998 100%  266.11kB/s    0:00:20 (xfer#5, to-check=59/65)

  • nvdcve-2.0-2003.xml.asc

  •          198 100%    7.73kB/s    0:00:00 (xfer#6, to-check=58/65)

  • ......

  • Country Name (2 letter code) [DE]:State or Province Name (full name) [Some-State]:Locality Name (eg, city) []:Organization Name (eg, company) [Internet Widgits Pty Ltd]:Organizational Unit Name (eg, section) []:Common Name (eg, your name or your server's hostname) []:Email Address []:Using configuration from /tmp/openvas-mkcert-client.24593/stdC.cnf

  • Check that the request matches the signature

  • Signature ok

  • The Subject's Distinguished Name is as follows

  • countryName           :PRINTABLE:'DE'                                                              #國家名

  • localityName          :PRINTABLE:'Berlin'                                                            #本地名

  • commonName            :PRINTABLE:'om'                                                         #普通名

  • Certificate is to be certified until Jul 27 03:02:02 2016 GMT (365 days)

  • Write out database with 1 new entries

  • Data Base Updated

  • Stopping OpenVAS Manager: openvasmd.

  • Stopping OpenVAS Scanner: openvassd.

  • Starting OpenVAS Scanner: openvassd.

  • Starting OpenVAS Manager: openvasmd.

  • Restarting Greenbone Security Assistant: gsad.                                                       #OpenVAS服務已啓動

  • User created with password '4b44aa5b-5535-4525-b1db-d87c9b5d81cd'.                #建立的用戶密碼

以上就是更新OpenVAS庫的一個過程。從輸出的信息中,能夠看到在該過程當中建立了證書、下載及更新了全部的掃描插件等。在該更新過程當中,將會建立一個名爲admin的用戶,而且自動生成了一個密碼。在本例中,生成的密碼爲4b44aa5b-5535-4525-b1db-d87c9b5d81cd。在該過程當中輸出的信息較多,因爲篇幅的緣由,中間部份內容使用省略號(......)取代了。因爲此過程會下載大量的插件,因此該過程大概須要半個小時的時間。不過,再次進行同步時,時間就快了。

提示:在更新插件時主要是看用戶的網速。若是網速好的話,可能不須要很長時間。可是,若是網速很差的話,須要的時間會很長,請用戶耐心等待。並且,在該過程當中用戶不須要進行任何操做。

2在更新OpenVAS庫時,自動爲admin用戶建立了一個密碼。可是,該密碼比較長,因此不容易記憶。爲了方便用戶記憶和輸入,可使用openvasmd命令修改該密碼。其中,執行命令以下所示:

  • root@Kali:~# openvasmd --user=admin --new-password=123456

執行以上命令後,將不會輸出任何信息。以上命令中,--user選項指定的是修改密碼的用戶爲admin--new-password選項指定將admin用戶的密碼修改成「123456」。

3爲了確認OpenVAS是否安裝完成,可使用openvas-check-setup對該服務進行檢查。以下所示:

  • root@Kali:~# openvas-check-setup

  • openvas-check-setup 2.3.0

  •   Test completeness and readiness of OpenVAS-8

  •   (add '--v6' or '--v7' or '--9'

  •    if you want to check for another OpenVAS version)

  •   Please report us any non-detected problems and

  •   help us to improve this check routine:

  •   http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss

  •   Send us the log-file (/tmp/openvas-check-setup.log) to help analyze the problem.

  •   Use the parameter --server to skip checks for client tools

  •   like GSD and OpenVAS-CLI.

  • Step 1: Checking OpenVAS Scanner ...

  •         OK: OpenVAS Scanner is present in version 5.0.1.

  •         OK: OpenVAS Scanner CA Certificate is present as /var/lib/openvas/CA/cacert.pem.

  •         OK: OpenVAS Scanner server certificate is valid and present as /var/lib/openvas/CA/servercert.pem.

  •         OK: NVT collection in /var/lib/openvas/plugins contains 40087 NVTs.

  •         WARNING: Signature checking of NVTs is not enabled in OpenVAS Scanner.

  •         SUGGEST: Enable signature checking (see http://www.openvas.org/trusted-nvts.html).

  •         OK: The NVT cache in /var/cache/openvas contains 40087 files for 40087 NVTs.

  •         OK: redis-server is present in version 2.4.14.

  •         OK: scanner (kb_location setting) is configured properly using the redis-server socket: /var/lib/redis/redis.sock

  •         OK: redis-server is running and listening on socket: /var/lib/redis/redis.sock.

  •         OK: redis-server configuration is OK and redis-server is running.

  • Step 2: Checking OpenVAS Manager ...

  •         OK: OpenVAS Manager is present in version 6.0.1.

  •         OK: OpenVAS Manager client certificate is valid and present as /var/lib/openvas/CA/clientcert.pem.

  •         OK: OpenVAS Manager database found in /var/lib/openvas/mgr/tasks.db.

  •         OK: Access rights for the OpenVAS Manager database are correct.

  •         OK: At least one user exists.

  •         OK: sqlite3 found, extended checks of the OpenVAS Manager installation enabled.

  •         OK: OpenVAS Manager database is at revision 146.

  •         OK: OpenVAS Manager expects database at revision 146.

  •         OK: Database schema is up to date.

  •         OK: OpenVAS Manager database contains information about 40087 NVTs.

  •         OK: OpenVAS SCAP database found in /var/lib/openvas/scap-data/scap.db.

  •         OK: OpenVAS CERT database found in /var/lib/openvas/cert-data/cert.db.

  •         OK: xsltproc found.

  • Step 3: Checking user configuration ...

  •         WARNING: Your password policy is empty.

  •         SUGGEST: Edit the /etc/openvas/pwpolicy.conf file to set a password policy.

  • Step 4: Checking Greenbone Security Assistant (GSA) ...

  •         OK: Greenbone Security Assistant is present in version 6.0.1.

  • Step 5: Checking OpenVAS CLI ...

  •         OK: OpenVAS CLI version 1.4.0.

  • Step 6: Checking Greenbone Security Desktop (GSD) ...

  •         SKIP: Skipping check for Greenbone Security Desktop.

  • Step 7: Checking if OpenVAS services are up and running ...

  •         OK: netstat found, extended checks of the OpenVAS services enabled.

  •         OK: OpenVAS Scanner is running and listening only on the local interface.

  •         OK: OpenVAS Scanner is listening on port 9391, which is the default port.

  •         WARNING: OpenVAS Manager is running and listening only on the local interface.

  •         This means that you will not be able to access the OpenVAS Manager from the

  •         outside using GSD or OpenVAS CLI.

  •         SUGGEST: Ensure that OpenVAS Manager listens on all interfaces unless you want

  •         a local service only.

  •         OK: OpenVAS Manager is listening on port 9390, which is the default port.

  •         OK: Greenbone Security Assistant is listening on port 9392, which is the default port.

  • Step 8: Checking nmap installation ...

  •         WARNING: Your version of nmap is not fully supported: 6.47

  •         SUGGEST: You should install nmap 5.51 if you plan to use the nmap NSE NVTs.

  • Step 10: Checking presence of optional tools ...

  •         OK: pdflatex found.

  •         OK: PDF generation successful. The PDF report format is likely to work.

  •         OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work.

  •         WARNING: Could not find rpm binary, LSC credential package generation for RPM and DEB based targets will not work.

  •         SUGGEST: Install rpm.

  •         WARNING: Could not find makensis binary, LSC credential package generation for Microsoft Windows targets will not work.

  •         SUGGEST: Install nsis.

  • It seems like your OpenVAS-8 installation is OK.

  • If you think it is not OK, please report your observation

  • and help us to improve this check routine:

  • http://lists.wald.intevation.org/mailman/listinfo/openvas-discuss

  • Please attach the log-file (/tmp/openvas-check-setup.log) to help us analyze the problem.

從以上輸出信息中,能夠看到以上過程進行了九步檢查。檢查完後,看到「It seems like your OpenVAS-7 installation is OK.」信息,則表示OpenVAS安裝成功。接下來,用戶就可使用OpenVAS工具實施掃描了。

本文選自:OpenVAS漏洞掃描基礎教程大學霸內部資料,轉載請註明出處,尊重技術尊重IT人!

相關文章
相關標籤/搜索