第二章 信息收集和掃描-續(xù)
我們將學(xué)習(xí)以下內(nèi)容
與Nessus
結(jié)合使用
與NeXpose
結(jié)合使用
與OpenVAS
結(jié)合使用
接上篇:第二章 信息收集與掃描
14悔耘、與Nessus結(jié)合
到目前為止颈将,我們已經(jīng)了解了端口掃描的基礎(chǔ)知識(shí),以及學(xué)會(huì)了Nmap
的使用。通過其他一些工具的學(xué)習(xí),進(jìn)一步提高了掃描和信息收集的技術(shù)。在接下來的小節(jié)中曲伊,我們將介紹其他幾種掃描目標(biāo)可用服務(wù)和端口的工具,這些工具還可以幫助我們確定特定服務(wù)和端口可能存在的漏洞類型捣炬。讓我們開始漏洞掃描之旅熊昌。
Nessus
是使用最廣泛的漏洞掃描器之一绽榛,它可用通過掃描目標(biāo)發(fā)現(xiàn)漏洞并生成詳細(xì)的報(bào)告湿酸。Nessus
是滲透測(cè)試中非常有用的工具。你可用使用它的GUI版本灭美,也可以在Metasploit
控制臺(tái)中使用它推溃。本書主要介紹在msfconsole
中使用它。
準(zhǔn)備工作
要使用Nessus
需要先去Nessus
官網(wǎng)注冊(cè)并取得Licenses
届腐。你可以使用Nessus
家庭版铁坎,此授權(quán)是免費(fèi)的,它允許你掃描個(gè)人家庭網(wǎng)絡(luò)(小于16個(gè)IP地址)犁苏。然后下載軟件安裝包進(jìn)行安裝硬萍。在Kali中需要
下載.deb
格式的包,然后使用dpkg -i
進(jìn)行安裝围详。
家庭版密鑰申請(qǐng)地址:https://www.tenable.com/products/nessus-home
填寫注冊(cè)信息朴乖,完成注冊(cè)祖屏,然后會(huì)跳轉(zhuǎn)到下載頁(yè)面
根據(jù)自己的系統(tǒng)版本,下載32bit
或者64bit
版本
激活密鑰會(huì)發(fā)到你的郵箱里面买羞,請(qǐng)保存下來袁勺。
下載完成之后進(jìn)行安裝:
root@osboxes:~# cd ~/Downloads/
root@osboxes:~/Downloads# ls
bettercap bettercap_linux_amd64_2.2.zip libpcap-1.8.1 libpcap-1.8.1.tar.gz Nessus-8.3.1-debian6_amd64.deb
root@osboxes:~/Downloads# dpkg -i Nessus-8.3.1-debian6_amd64.deb //安裝
Selecting previously unselected package nessus.
(Reading database ... 435326 files and directories currently installed.)
Preparing to unpack Nessus-8.3.1-debian6_amd64.deb ...
Unpacking nessus (8.3.1) ...
Setting up nessus (8.3.1) ...
Unpacking Nessus Scanner Core Components...
- You can start Nessus Scanner by typing /etc/init.d/nessusd start
- Then go to https://osboxes:8834/ to configure your scanner
Processing triggers for systemd (241-1) ...
root@osboxes:~/Downloads#
安裝完成之后,啟動(dòng)Nessus
服務(wù)
root@osboxes:~/Downloads# systemctl start nessusd.service
根據(jù)提示畜普,使用瀏覽器打開網(wǎng)址https://osboxes:8834/
或者https://127.0.0.1:8834
進(jìn)行配置
1期丰、設(shè)置用戶名和密碼:
2、選擇Home,Professional or Manager
吃挑,填寫激活密鑰進(jìn)行授權(quán)激活钝荡。
3、激活完成后舶衬,Nessus
還會(huì)安裝一系列組件化撕,等待安裝完成(需要一段時(shí)間,請(qǐng)耐心等待)
安裝完成后约炎,就可以進(jìn)行下一步操作了植阴。
怎么做
1、在msfconsole
里面載入nessus
組件圾浅。
msf5 > load nessus //載入nessus組件
[*] Nessus Bridge for Metasploit
[*] Type nessus_help for a command listing
[*] Successfully loaded plugin: Nessus
msf5 >
2掠手、輸入nessus_help
命令,可以查看可用參數(shù)和幫助信息
msf5 > nessus_help
Command Help Text
------- ---------
Generic Commands
----------------- -----------------
nessus_connect Connect to a Nessus server
nessus_logout Logout from the Nessus server
nessus_login Login into the connected Nesssus server with a different username and password
nessus_save Save credentials of the logged in user to nessus.yml
nessus_help Listing of available nessus commands
nessus_server_properties Nessus server properties such as feed type, version, plugin set and server UUID.
nessus_server_status Check the status of your Nessus Server
nessus_admin Checks if user is an admin
nessus_template_list List scan or policy templates
nessus_folder_list List all configured folders on the Nessus server
nessus_scanner_list List all the scanners configured on the Nessus server
Nessus Database Commands
3狸捕、連接到Nessus
服務(wù)喷鸽,使用nessus_connect NessusUser:NessusPassword@127.0.0.1
命令。
msf5 > nessus_connect nessusroot:Passw0rd@127.0.0.1 //連接到 Nessus 服務(wù)
[*] Connecting to https://127.0.0.1:8834/ as nessusroot
[*] User nessusroot authenticated successfully.
msf5 >
4灸拍、使用nessus_policy_list
可用列出Nessus
服務(wù)上的所有掃描策略做祝。如果沒有,需要先在WebUI
界面中創(chuàng)建策略鸡岗。
msf5 > nessus_policy_list
[-] No policies found
msf5 >
提示沒有策略混槐,我們?nèi)?chuàng)建一個(gè)
我們選擇新建一個(gè)Basic Network Scan
策略
配置好相關(guān)的參數(shù),然后點(diǎn)保存
回到msfconsole
里面再次執(zhí)行nessus_policy_list
就看看到了
msf5 > nessus_policy_list
Policy ID Name Policy UUID
--------- ---- -----------
4 PenTest01 731a8e52-3ea6-a291-ec0a-d2ff0619c19d7bd788d6be818b65
msf5 >
5轩性、創(chuàng)建nessus
掃描声登,使用nessus_scan_new --help
查看命令幫助信息:
msf5 > nessus_scan_new --help
[*] Usage:
[*] nessus_scan_new <UUID of Policy> <Scan name> <Description> <Targets>
[*] Use nessus_policy_list to list all available policies with their corresponding UUIDs
msf5 >
6、創(chuàng)建掃描
msf5 > nessus_scan_new 731a8e52-3ea6-a291-ec0a-d2ff0619c19d7bd788d6be818b65 Metasploitable3 Windows_Machine 192.168.177.144
[*] Creating scan from policy number 731a8e52-3ea6-a291-ec0a-d2ff0619c19d7bd788d6be818b65, called Metasploitable3 - Windows_Machine and scanning 192.168.177.144
[*] New scan added
[-] Error while running command nessus_scan_new: undefined method `[]' for nil:NilClass
Call stack:
/usr/share/metasploit-framework/plugins/nessus.rb:979:in `cmd_nessus_scan_new'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:522:in `run_command'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:473:in `block in run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:467:in `each'
/usr/share/metasploit-framework/lib/rex/ui/text/dispatcher_shell.rb:467:in `run_single'
/usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:151:in `run'
/usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
/usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
/usr/bin/msfconsole:49:in `<main>'
msf5 >
此次會(huì)報(bào)錯(cuò):Error while running command nessus_scan_new: undefined method []' for nil:NilClass
揣苏。這是由于Nessus 7
開始對(duì)遠(yuǎn)程調(diào)用進(jìn)行認(rèn)證悯嗓,從而導(dǎo)致Metasploit
調(diào)用失敗。現(xiàn)在正在等待修復(fù)卸察。
解決辦法:Nessus Plugin unable to create new scan · Issue #11117 · rapid7/metasploit-framework · GitHub https://github.com/rapid7/metasploit-framework/issues/11117
成功創(chuàng)建掃描:
msf5 > nessus_scan_new 731a8e52-3ea6-a291-ec0a-d2ff0619c19d7bd788d6be818b65 test test 192.168.177.144
[*] Creating scan from policy number 731a8e52-3ea6-a291-ec0a-d2ff0619c19d7bd788d6be818b65, called test - test and scanning 192.168.177.144
[*] New scan added
[*] Use nessus_scan_launch 6 to launch the scan
Scan ID Scanner ID Policy ID Targets Owner
------- ---------- --------- ------- -----
6 1 5 192.168.177.144 nessusroot
msf5 >
7脯厨、使用nessus_scan_list
可用查看掃描列表,以及它們的狀態(tài)
msf5 > nessus_scan_list
Scan ID Name Owner Started Status Folder
------- ---- ----- ------- ------ ------
6 test nessusroot empty 3
msf5 >
8坑质、啟動(dòng)掃描合武,使用nessus_scan_launch <Scan ID>
啟動(dòng)掃描
msf5 > nessus_scan_launch 6
[+] Scan ID 6 successfully launched. The Scan UUID is 67d8e87c-17a6-7693-0b41-666f40291e1464ae15bc02832ca3
msf5 >
再次查看狀態(tài):
msf5 > nessus_scan_list
Scan ID Name Owner Started Status Folder
------- ---- ----- ------- ------ ------
6 test nessusroot running 3
msf5 >
9个少、查看掃描的詳細(xì)信息,使用nessus_scan_details <Scan ID> <info/hosts/vulnerabilities/history>
msf5 > nessus_scan_details 6 info //查看掃描狀態(tài)
Status Policy Scan Name Scan Targets Scan Start Time Scan End Time
------ ------ --------- ------------ --------------- -------------
running Basic Network Scan test 192.168.177.144 1555301230
msf5 > nessus_scan_details 6 hosts //查看主機(jī)
Host ID Hostname % of Critical Findings % of High Findings % of Medium Findings % of Low Findings
------- -------- ---------------------- ------------------ -------------------- -----------------
2 192.168.177.144 1 0 0 0
msf5 > nessus_scan_details 6 vulnerabilities //查看漏洞信息
Plugin ID Plugin Name Plugin Family Count
--------- ----------- ------------- -----
10114 ICMP Timestamp Request Remote Date Disclosure General 1
10150 Windows NetBIOS / SMB Remote Host Information Disclosure Windows 1
10287 Traceroute Information General 1
10394 Microsoft Windows SMB Log In Possible Windows 1
10736 DCE Services Enumeration Windows 8
10785 Microsoft Windows SMB NativeLanManager Remote System Information Disclosure
.....
msf5 > nessus_scan_details 6 history //查看掃描歷史
History ID Status Creation Date Last Modification Date
---------- ------ ------------- ----------------------
7 running 1555301230
msf5 >
在WebUI
上也可以看到我們創(chuàng)建的掃描
10眯杏、當(dāng)完成掃描后夜焦,使用nessus_db_import <Scan ID>
將掃描結(jié)果導(dǎo)入到Metasploit
中。
msf5 > nessus_scan_details 6 info
Status Policy Scan Name Scan Targets Scan Start Time Scan End Time
------ ------ --------- ------------ --------------- -------------
completed Basic Network Scan test 192.168.177.144 1555301230 1555302154
msf5 > nessus_db_import 6
[*] Exporting scan ID 6 is Nessus format...
[+] The export file ID for scan ID 6 is 2110513949
[*] Checking export status...
[*] Export status: loading
[*] Export status: ready
[*] The status of scan ID 6 export is ready
[*] Importing scan results to the database...
[*] Importing data of 192.168.177.144
[+] Done
msf5 >
導(dǎo)入進(jìn)去之后岂贩,我們就能使用hosts
茫经、services
命令查看主機(jī)和目標(biāo)服務(wù)的信息了。
msf5 > hosts
Hosts
=====
address mac name os_name os_flavor os_sp purpose info comments
------- --- ---- ------- --------- ----- ------- ---- --------
192.168.177.1 Unknown device
192.168.177.144 00:0c:29:41:d2:48 METASPLOITABLE3 Windows 2008 Standard SP1 server
192.168.177.145 Unknown device
msf5 > services
Services
========
host port proto name state info
---- ---- ----- ---- ----- ----
192.168.177.1 21 tcp ftp open 220 Serv-U FTP Server v15.0 ready...\x0d\x0a
192.168.177.144 21 tcp ftp open 220 Microsoft FTP Service\x0d\x0a
192.168.177.144 22 tcp ssh open SSH-2.0-OpenSSH_7.1
192.168.177.144 80 tcp www open Microsoft IIS httpd 7.5
192.168.177.144 135 tcp epmap open
192.168.177.144 137 udp netbios-ns open
.....
查看掃描結(jié)果中的漏洞信息萎津,使用vulns
指令
msf5 > vulns
Vulnerabilities
===============
Timestamp Host Name References
--------- ---- ---- ----------
2019-04-12 07:52:51 UTC 192.168.177.144 MS17-010 SMB RCE Detection CVE-2017-0143,CVE-2017-0144,CVE-2017-0145,CVE-2017-0146,CVE-2017-0147,CVE-2017-0148,MSB-MS17-
010,URL-https://zerosum0x0.blogspot.com/2017/04/doublepulsar-initial-smb-backdoor-ring.html,URL-https://github.com/countercept/doublepulsar-detection-script,URL-htt
ps://technet.microsoft.com/en-us/library/security/ms17-010.aspx
2019-04-12 09:08:20 UTC 192.168.177.144 HTTP Writable Path PUT/DELETE File Access
OSVDB-397
2019-04-15 04:25:24 UTC 192.168.177.144 Elasticsearch Transport Protocol Unspecified Remote Code Execution CVE-2015-5377,NSS-105752,NSS-119499
2019-04-15 04:25:25 UTC 192.168.177.144 MySQL Server Detection NSS-10719
2019-04-15 04:25:25 UTC 192.168.177.144 Elasticsearch Detection NSS-109941
2019-04-15 04:25:25 UTC 192.168.177.144 ManageEngine Desktop Central 9 < Build 92027 Multiple Vulnerabilities CVE-2018-8722,NSS-108752
2019-04-15 04:25:25 UTC 192.168.177.144 Elasticsearch Unrestricted Access Information Disclosure NSS-101025
....
15卸伞、與NeXpose結(jié)合
在本節(jié),我們將介紹另一個(gè)極佳的漏洞掃描器:NeXpose
锉屈。NexPose
是領(lǐng)先的漏洞評(píng)估工具之一荤傲。NeXpose
是 Rapid7
常用的工具,它執(zhí)行漏洞掃描并將結(jié)果導(dǎo)入到 Metasploit
數(shù)據(jù)庫(kù)中颈渊。NeXpose
的用法與 Nessus
類似遂黍,讓我們快速了解一下如何使用 NeXpose
。至于深入探究就留給大家來完成了俊嗽。
準(zhǔn)備工作
NeXpose
社區(qū)版雾家,可申請(qǐng)免費(fèi)試用1年:https://www.rapid7.com/info/nexpose-community/
郵箱必須是獨(dú)立的個(gè)人、學(xué)校绍豁、企業(yè)芯咧、機(jī)構(gòu)等域名郵箱;第三方郵箱均無效V褡帷(如:gmail敬飒、新浪、網(wǎng)易芬位、126无拗、騰訊等都視為無效)。
注冊(cè)晶衷,然后下載安裝程序進(jìn)行安裝蓝纲。
注冊(cè)完成,然后下載安裝程序
安裝:安裝詢問過程晌纫,直接敲回車即可,然后填寫一個(gè)用戶信息永丝,設(shè)置密碼等
root@osboxes:~# chmod +x Rapid7Setup-Linux64.bin
root@osboxes:~# ./Rapid7Setup-Linux64.bin
....
Do you want to continue?
Yes [y, Enter], No [n]
Gathering system information....
Security Console with local Scan Engine
If you do not have a console installed yet, this option is recommended. The console manages scan engines and all administrative operations.
Scan Engine only
This distributed engine can start scanning after being paired with a Security Console.
Select only the set of components you want to install:
Security Console with local Scan Engine [1, Enter]
Scan Engine only [2]
1
Where should Rapid7 Vulnerability Management be installed?
[/opt/rapid7/nexpose]
....
Select any additional installation tasks.
Initialize and start after installation?
Yes [y], No [n, Enter]
y
...
If you chose to start the Security Console as part of the installation, then it will be started upon installer completion.
Using the credentials you created during installation, log onto Nexpose at https://localhost:3780.
To start the service run: sudo systemctl start nexposeconsole.service
To start the service run: sudo systemctl start nexposeconsole.service
The Security Console is configured to automatically run at startup. See the
installation guide if you wish to modify start modes.
[Enter]
Finishing installation...
我們?cè)O(shè)置的用戶名:nexpose
密碼:Faq3wANIK0
(根據(jù)自己喜好設(shè)置)
啟動(dòng)腳本锹漱,執(zhí)行/opt/rapid7/nexpose/nsc/nsc.sh
或者systemctl start nexposeconsole
,啟動(dòng)需要一段時(shí)間慕嚷,請(qǐng)耐心等待哥牍。
然后訪問https://localhost:3780
配置毕泌,等待啟動(dòng)完成,使用用戶名和密碼登錄嗅辣,然后輸入我們申請(qǐng)的Key
激活產(chǎn)品
在msfconsole
中載入nexpose
組件撼泛,然后連接到nexpose
服務(wù)
msf5 > load nexpose
▄▄▄ ▄▄ ▄▄▄ ▄▄▄
███ ██ ██ ▄██
██?█ ██ ▄████▄ ████ ██▄███▄ ▄████▄ ▄▄█████▄ ▄████▄
██ ██ ██ ██▄▄▄▄██ ██ ██? ?██ ██? ?██ ██▄▄▄▄ ? ██▄▄▄▄██
██ █▄██ ██?????? ████ ██ ██ ██ ██ ????██▄ ██??????
██ ███ ?██▄▄▄▄█ ██ ██ ███▄▄██? ?██▄▄██? █▄▄▄▄▄██ ?██▄▄▄▄█
?? ??? ????? ??? ??? ██ ??? ???? ?????? ?????
██
[*] Nexpose integration has been activated
[*] Successfully loaded plugin: nexpose
msf5 > nexpose_connect nexpose:Faq3wANIK0@127.0.0.1:3780
[*] Connecting to Nexpose instance at 127.0.0.1:3780 with username nexpose...
msf5 >
怎么做
與NeXpose
服務(wù)連接后,我們就可以掃描目標(biāo)生成報(bào)告澡谭。NeXpose
支持兩個(gè)掃描命令愿题,一個(gè)是nexpose_scan
,此命令會(huì)掃描目標(biāo)然后導(dǎo)入結(jié)果到metasploit
數(shù)據(jù)庫(kù)中蛙奖,另外一個(gè)是nexpose_discover
潘酗,此命令僅發(fā)現(xiàn)主機(jī)和服務(wù),不導(dǎo)入結(jié)果雁仲。
1仔夺、對(duì)目標(biāo)進(jìn)行快速掃描(執(zhí)行最小服務(wù)發(fā)現(xiàn)掃描)
msf5 > nexpose_discover 192.168.177.144
[*] Scanning 1 addresses with template aggressive-discovery in sets of 32
[*] Completed the scan of 1 addresses
msf5 >
2、查看nexpose_scan
幫助
msf5 > nexpose_scan -h
Usage: nexpose_scan [options] <Target IP Ranges>
OPTIONS:
-E <opt> Exclude hosts in the specified range from the scan
-I <opt> Only scan systems with an address within the specified range
-P Leave the scan data on the server when it completes (this counts against the maximum licensed IPs)
-c <opt> Specify credentials to use against these targets (format is type:user:pass
-d Scan hosts based on the contents of the existing database
-h This help menu
-n <opt> The maximum number of IPs to scan at a time (default is 32)
-s <opt> The directory to store the raw XML files from the Nexpose instance (optional)
-t <opt> The scan template to use (default:pentest-audit options:full-audit,exhaustive-audit,discovery,aggressive-discovery,dos-audit)
-v Display diagnostic information about the scanning process
msf5 >
3攒砖、要掃描目標(biāo)缸兔,使用nexpose_scan -t <template> <target_id>
msf5 > nexpose_scan -t full-audit 192.168.177.144
[*] Scanning 1 addresses with template full-audit in sets of 32
[*] Completed the scan of 1 addresses
msf5 >
4、掃描完成后吹艇,導(dǎo)入結(jié)果到數(shù)據(jù)庫(kù)中灶体,使用nexpose_site_import <site_id>
msf5 > nexpose_site_import 7
[*] Generating the export data file...
[*] Downloading the export data...
[*] Importing Nexpose data...
16、與OpenVAS結(jié)合
OpenVAS
( Open Vulnerability Assessment System)是Nessus
項(xiàng)目的分支掐暮。是一個(gè)免費(fèi)開源的漏洞掃描和漏洞管理工具蝎抽。也是當(dāng)前使用最為廣泛的漏洞掃描和管理開源解決方案。
怎么做
1路克、在Kali
上安裝 OpenVAS
root@osboxes:~# apt install openvas -y
2樟结、設(shè)置openvas
,包括下載規(guī)則精算,創(chuàng)建管理員用戶和服務(wù)瓢宦。
root@osboxes:~# openvas-setup //這一步會(huì)下載很多東西,請(qǐng)耐心等待
[>] Updating OpenVAS feeds
[*] [1/3] Updating: NVT
--2019-04-15 13:54:37-- http://dl.greenbone.net/community-nvt-feed-current.tar.bz2
Connecting to 192.168.1.91:1080... connected.
Proxy request sent, awaiting response... 200 OK
Length: 22288483 (21M) [application/octet-stream]
....
經(jīng)過漫長(zhǎng)的等待...
[*] Opening Web UI (https://127.0.0.1:9392) in: 5... 4... 3... 2... 1...
[>] Checking for admin user
[*] Creating admin user
User created with password 'dc63c468-3780-4e3c-b30c-1597f4b91623'.
[+] Done
3灰羽、配置完成后驮履,啟動(dòng)openvas
,其實(shí)在上一步中已經(jīng)啟動(dòng)了廉嚼。也可以用下面的命令啟動(dòng)
root@osboxes:~# openvas-start
訪問https://127.0.0.1:9392
可登錄WebUI
4玫镐、在msfconsole
中載入openvas
組件
msf5 > load openvas
[*] Welcome to OpenVAS integration by kost and averagesecurityguy.
[*]
[*] OpenVAS integration requires a database connection. Once the
[*] database is ready, connect to the OpenVAS server using openvas_connect.
[*] For additional commands use openvas_help.
[*]
[*] Successfully loaded plugin: OpenVAS
msf5 >
5、查看幫助信息
msf5 > help openvas
OpenVAS Commands
================
Command Description
------- -----------
openvas_config_list Quickly display list of configs
openvas_connect Connect to an OpenVAS manager using OMP
openvas_debug Enable/Disable debugging
openvas_disconnect Disconnect from OpenVAS manager
openvas_format_list Display list of available report formats
openvas_help Displays help
openvas_report_delete Delete a report specified by ID
openvas_report_download Save a report to disk
openvas_report_import Import report specified by ID into framework
openvas_report_list Display a list of available report formats
openvas_target_create Create target (name, hosts, comment)
openvas_target_delete Delete target by ID
openvas_target_list Display list of targets
openvas_task_create Create a task (name, comment, target, config)
openvas_task_delete Delete task by ID
openvas_task_list Display list of tasks
openvas_task_pause Pause task by ID
openvas_task_resume Resume task by ID
openvas_task_resume_or_start Resume task or start task by ID
openvas_task_start Start task by ID
openvas_task_stop Stop task by ID
openvas_version Display the version of the OpenVAS server
msf5 >
6怠噪、使用 openvas_connect <username> <password> <host> <port>
連接到OpenVAS
服務(wù)
msf5 > openvas_connect admin dc63c468-3780-4e3c-b30c-1597f4b91623 127.0.0.1 9390
[*] Connecting to OpenVAS instance at 127.0.0.1:9390 with username admin...
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeout.timeout instead.
[+] OpenVAS connection successful
msf5 >
7恐似、添加掃描目標(biāo),使用openvas_target_create <Name> <Hosts> <Comment>
指令傍念,參數(shù)包括描述信息矫夷,目標(biāo)的IP
msf5 > openvas_target_create "Metasploitable3" 192.168.177.144 "Windows Target"
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeout.timeout instead.
[*] 6455a780-092a-40dd-8c01-191a7612505a
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeout.timeout instead.
[+] OpenVAS list of targets
ID Name Hosts Max Hosts In Use Comment
-- ---- ----- --------- ------ -------
6455a780-092a-40dd-8c01-191a7612505a Metasploitable3 192.168.177.144 1 0 Windows Target
msf5 >
8葛闷、列出配置列表:openvas_config_list
msf5 > openvas_config_list
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeout.timeout instead.
[+] OpenVAS list of configs
ID Name
-- ----
085569ce-73ed-11df-83c3-002264764cea empty
2d3f051c-55ba-11e3-bf43-406186ea4fc5 Host Discovery
698f691e-7489-11df-9d8c-002264764cea Full and fast ultimate
708f25c4-7489-11df-8094-002264764cea Full and very deep
74db13d6-7489-11df-91b9-002264764cea Full and very deep ultimate
8715c877-47a0-438d-98a3-27c7a6ab2196 Discovery
bbca7412-a950-11e3-9109-406186ea4fc5 System Discovery
daba56c8-73ec-11df-a475-002264764cea Full and fast
msf5 >
9、創(chuàng)建任務(wù)双藕,使用如下指令
openvas_task_create <name> <Comment> <config_id> <target_id>
msf5 > openvas_task_create "Metasploitable3" "Windows" 698f691e-7489-11df-9d8c-002264764cea 6455a780-092a-40dd-8c01-191a7612505a
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeout.timeout instead.
[*] fb18cf93-a94b-4c9b-aadf-9408bd9a9186
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeout.timeout instead.
[+] OpenVAS list of tasks
ID Name Comment Status Progress
-- ---- ------- ------ --------
fb18cf93-a94b-4c9b-aadf-9408bd9a9186 Metasploitable3 Windows New -1
msf5 >
10淑趾、啟動(dòng)任務(wù),使用openvas_task_start <task_id>
msf5 > openvas_task_start fb18cf93-a94b-4c9b-aadf-9408bd9a9186
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeout.timeout instead.
[*] <X><authenticate_response status='200' status_text='OK'><role>Admin</role><timezone>UTC</timezone><severity>nist</severity></authenticate_response><start_task_response status='202' status_text='OK, request submitted'><report_id>7993d76a-43b3-48c6-ac94-ca630e20db68</report_id></start_task_response></X>msf5 >
11忧陪、查看進(jìn)度扣泊,使用openvas_task_list
msf5 > openvas_task_list
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeou
t.timeout instead.
[+] OpenVAS list of tasks
ID Name Comment Status Progress
-- ---- ------- ------ --------
fb18cf93-a94b-4c9b-aadf-9408bd9a9186 Metasploitable3 Windows Requested 1
msf5 >
12、使用openvas_format_list
可以查看OpenVAS
支持的報(bào)告格式赤嚼。
msf5 > openvas_format_list
/usr/share/metasploit-framework/vendor/bundle/ruby/2.5.0/gems/openvas-omp-0.0.4/lib/openvas-omp.rb:201: warning: Object#timeout is deprecated, use Timeout.timeout i
nstead.
[+] OpenVAS list of report formats
ID Name Extension Summary
-- ---- --------- -------
5057e5cc-b825-11e4-9d0e-28d24461215b Anonymous XML xml Anonymous version of the raw XML report
50c9950a-f326-11e4-800c-28d24461215b Verinice ITG vna Greenbone Verinice ITG Report, v1.0.1.
5ceff8ba-1f62-11e1-ab9f-406186ea4fc5 CPE csv Common Product Enumeration CSV table.
6c248850-1f62-11e1-b082-406186ea4fc5 HTML html Single page HTML report.
77bd6c4a-1f62-11e1-abf0-406186ea4fc5 ITG csv German "IT-Grundschutz-Kataloge" report.
9087b18c-626c-11e3-8892-406186ea4fc5 CSV Hosts csv CSV host summary.
910200ca-dc05-11e1-954f-406186ea4fc5 ARF xml Asset Reporting Format v1.0.0.
9ca6fe72-1f62-11e1-9e7c-406186ea4fc5 NBE nbe Legacy OpenVAS report.
9e5e5deb-879e-4ecc-8be6-a71cd0875cdd Topology SVG svg Network topology SVG image.
a3810a62-1f62-11e1-9219-406186ea4fc5 TXT txt Plain text report.
a684c02c-b531-11e1-bdc2-406186ea4fc5 LaTeX tex LaTeX source file.
a994b278-1f62-11e1-96ac-406186ea4fc5 XML xml Raw XML report.
c15ad349-bd8d-457a-880a-c7056532ee15 Verinice ISM vna Greenbone Verinice ISM Report, v3.0.0.
c1645568-627a-11e3-a660-406186ea4fc5 CSV Results csv CSV result list.
c402cc3e-b531-11e1-9163-406186ea4fc5 PDF pdf Portable Document Format report.
msf5 >
13旷赖、在WebUI
同樣可以看到我們創(chuàng)建的任務(wù)狀態(tài)信息
14、任務(wù)完成后更卒,使用openvas_report_list
查看報(bào)告列表等孵。
msf5 > openvas_report_list
[+] OpenVAS list of reports
ID Task Name Start Time Stop Time
-- --------- ---------- ---------
4ee7b572-a470-484c-962e-773d3a7eb7b1 Metasploitable3 2019-04-16T02:40:24Z 2019-04-16T03:07:15Z
7993d76a-43b3-48c6-ac94-ca630e20db68 Metasploitable3 2019-04-16T01:15:44Z
15、使用openvas_report_import
命令將報(bào)告導(dǎo)入到Metasploit
中蹂空,僅支持NBE
(legacy OpenVAS report)和XML
格式導(dǎo)入俯萌。
msf5 > openvas_report_import 4ee7b572-a470-484c-962e-773d3a7eb7b1 9ca6fe72-1f62-11e1-9e7c-406186ea4fc5
[*] Importing report to database.
但是這里我們使用的 Metasploit-5.0
直接這么導(dǎo)入會(huì)報(bào)錯(cuò),無法導(dǎo)入上枕,我們先導(dǎo)出為文件再用db_import
導(dǎo)入就可以了咐熙。
msf5 > openvas_report_download
[*] Usage: openvas_report_download <report_id> <format_id> <path> <report_name>
msf5 > openvas_report_download 4ee7b572-a470-484c-962e-773d3a7eb7b1 9ca6fe72-1f62-11e1-9e7c-406186ea4fc5 /tmp/ Metasploitable3
[*] Saving report to /tmp/Metasploitable3
msf5 > db_import /tmp/Metasploitable3
[*] Importing 'OpenVAS XML' data
[*] Successfully imported /tmp/Metasploitable3
msf5 >
16、查看OpenVAS
掃描的漏洞信息
msf5 > vulns
Vulnerabilities
===============
Timestamp Host Name References
--------- ---- ---- ----------
2019-04-16 08:15:22 UTC 192.168.177.144 ICMP Timestamp Detection CVE-1999-0524
2019-04-16 08:15:23 UTC 192.168.177.144 Microsoft Windows IIS CVE-2010-3972,BID-45542
2019-04-16 08:15:23 UTC 192.168.177.144 Microsoft Windows SMB Server Multiple Vulnerabilities-Remote (4013389) CVE-2017-0143,CVE-2017-0144,CVE-2017-0145,CVE-2017-0146,CVE-2017-0147,CVE-2017-0148,BID-96703,BID-96704,BID-96705,BID-96706,BID-96707,BID-96709
2019-04-16 08:15:23 UTC 192.168.177.144 MS15-034 HTTP.sys Remote Code CVE-2015-1635
2019-04-16 08:15:23 UTC 192.168.177.144 Oracle Glass Fish Server CVE-2017-1000028
2019-04-16 08:15:23 UTC 192.168.177.144 SSL/TLS: Report 'Anonymous' Cipher Suites .....
第三章 服務(wù)端漏洞利用(預(yù)告)
在本章中辨萍,我們將學(xué)習(xí)以下內(nèi)容
1棋恼、攻擊Linux服務(wù)器
2、SQL注入攻擊
3锈玉、shell類型
4爪飘、攻擊Windows服務(wù)器
5、利用公用服務(wù)
6拉背、MS17-010 永恒之藍(lán) SMB遠(yuǎn)程代碼執(zhí)行Windows內(nèi)核破壞
7师崎、MS17-010 EternalRomance/EternalSynergy/EternalChampion
8、植入后門
9椅棺、拒絕服務(wù)攻擊
說明
原書:《Metasploit Penetration Testing Cookbook - Third Edition》
本文由合天網(wǎng)安實(shí)驗(yàn)室編譯犁罩,轉(zhuǎn)載請(qǐng)注明來源。
關(guān)于合天網(wǎng)安實(shí)驗(yàn)室
合天網(wǎng)安實(shí)驗(yàn)室(www.hetianlab.com)-國(guó)內(nèi)領(lǐng)先的實(shí)操型網(wǎng)絡(luò)安全在線教育平臺(tái)
真實(shí)環(huán)境两疚,在線實(shí)操學(xué)網(wǎng)絡(luò)安全 床估; 實(shí)驗(yàn)內(nèi)容涵蓋:系統(tǒng)安全,軟件安全鬼雀,網(wǎng)絡(luò)安全顷窒,Web安全,移動(dòng)安全源哩,CTF鞋吉,取證分析,滲透測(cè)試励烦,網(wǎng)安意識(shí)教育等谓着。