標籤:
OpenVAS漏洞掃描基礎教程之OpenVAS概述及安裝及配置OpenVAS服務OpenVAS基礎知識
OpenVAS(Open Vulnerability Assessment System)是開放式漏洞評估系統,其核心部分是一個伺服器。該伺服器包括一套網路漏洞測試程式,可以檢測遠程系統和應用程式中的安全問題。OpenVAS不同與傳統的漏洞掃描軟體。所有的OpenVAS軟體都是免費的,而且還採用了Nessus(一款強大的網路掃描工具)較早版本的一些開放外掛程式。雖然Nessus很強大,但是該工具不開源,而且免費版的功能又比較局限。所以,本章將對OpenVAS工具進行詳細介紹。
OpenVAS概述
OpenVAS是開放式漏洞評估系統,也可以說它是一個包含著相關工具的網路掃描器。本節將對OpenVAS的概念及架構做一個簡單介紹。
什麼是OpenVAS
OpenVAS是一款開放式的漏洞評估工具,主要用來檢測目標網路或主機的安全性。該工具是基於C/S(用戶端/伺服器),B/S(瀏覽器/伺服器)架構進行工作,使用者通過瀏覽器或者專用用戶端程式來下達掃描任務,伺服器端負載授權,執行掃描操作並提供掃描結果。
OpenVAS的架構
一套完整的OpenVAS系統包括伺服器端和連接埠端的多個組件,1.1所示。
圖1.1 OpenVAS的架構
就是OpenVAS系統的一個架構。下面分別介紹伺服器層和客戶層,分別所需安裝的組件。如下所示:
1.伺服器層組件(建議都安裝)
- q openvas-scanner(掃描器):負責調用各種漏洞檢測外掛程式,完成實際的掃描操作。
- 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作業系統中。但是,用戶端安裝在Windows和Linux系統均可。
安裝及配置OpenVAS服務
當對OpenVAS工具瞭解後,就可以來使用該工具了。在使用該工具之前,首先介紹下它的安裝方法。
安裝OpenVAS
OpenVAS工具的安裝比較簡單,而且在OpenVAS官網提供了在各種作業系統中的安裝方法。其為http://www.openvas.org/install-packages.html。但是,如果使用者在安裝時,可能會出現很多依賴包需要手動解決。如果不能夠很好的解決依賴關係包,將無法成功安裝OpenVAS工具。所以,為了方便使用者使用,Kali Linux系統中已經預設安裝了該工具,使用者可以直接使用。
如果使用者發現自己系統中安裝的OpenVAS不是最新版本的話,可以通過以下方法安裝最新版的OpenVAS工具。具體方法如下所示:
(1)更新軟體包列表。執行命令如下所示:
- [email protected]:~# apt-get update
執行以上命令後,將會擷取最近的軟體包列表。
(2)擷取到最新的軟體包,。執行命令如下所示:
- [email protected]:~# apt-get dist-upgrade
執行以上命令後,將會對有更新的包進行下載並安裝。
(3)重新安裝OpenVAS工具。執行命令如下所示:
- [email protected]:~# 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庫。執行命令如下所示:
- [email protected]:~# 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 [email protected]
- 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命令修改該密碼。其中,執行命令如下所示:
- [email protected]:~# openvasmd --user=admin --new-password=123456
執行以上命令後,將不會輸出任何資訊。以上命令中,--user選項指定的是修改密碼的使用者為admin,--new-password選項指定將admin使用者的密碼修改為“123456”。
(3)為了確認OpenVAS是否安裝完成,可以使用openvas-check-setup對該服務進行檢查。如下所示:
- [email protected]:~# 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人!
OpenVAS漏洞掃描基礎教程之OpenVAS概述及安裝及配置OpenVAS服務