Metasploit中的NeXpose漏洞扫描
Metasploit / NeXpose集成并不局限于简单地导入扫描结果文件。您可以通过首先使用' nexpose '插件直接从msfconsole运行NeXpose扫描。
msf > load nexpose
▄▄▄ ▄▄ ▄▄▄ ▄▄▄
███ ██ ██ ▄██
██▀█ ██ ▄████▄ ████ ██▄███▄ ▄████▄ ▄▄█████▄ ▄████▄
██ ██ ██ ██▄▄▄▄██ ██ ██▀ ▀██ ██▀ ▀██ ██▄▄▄▄ ▀ ██▄▄▄▄██
██ █▄██ ██▀▀▀▀▀▀ ████ ██ ██ ██ ██ ▀▀▀▀██▄ ██▀▀▀▀▀▀
██ ███ ▀██▄▄▄▄█ ██ ██ ███▄▄██▀ ▀██▄▄██▀ █▄▄▄▄▄██ ▀██▄▄▄▄█
▀▀ ▀▀▀ ▀▀▀▀▀ ▀▀▀ ▀▀▀ ██ ▀▀▀ ▀▀▀▀ ▀▀▀▀▀▀ ▀▀▀▀▀
██
[*] Nexpose integration has been activated
[*] Successfully loaded plugin: nexpose
msf > help
Nexpose 命令
================
Command Description
------- -----------
nexpose_activity 在Nexpose实例上显示任何活动的扫描作业
nexpose_command 在Nexpose实例上执行一个控制台命令
nexpose_connect 连接到正在运行的Nexpose实例(user:pass @ host [:port])
nexpose_disconnect 从活动的Nexpose实例断开连接
nexpose_discover 启动扫描,但只执行主机和最小服务发现
nexpose_dos 启动包含可能使服务和设备崩溃的检查的扫描(警告)
nexpose_exhaustive 启动一个覆盖所有TCP端口和所有授权安全检查的扫描
nexpose_report_templates 列出所有可用的报告模板
nexpose_save 将凭据保存到Nexpose实例
nexpose_scan 针对特定IP范围启动Nexpose扫描并导入结果
nexpose_site_devices 列出站点内所有发现的设备
nexpose_site_import 从指定的站点ID导入数据
nexpose_sites 列出所有已定义的网站
nexpose_sysinfo 显示有关Nexpose实例的详细系统信息
... 略...
在针对目标运行扫描之前,我们首先需要使用' nexpose_connect '命令连同运行NeXpose的服务器以及NeXpose实例的凭证。请注意,您必须在连接字符串的末尾追加' ok '以确认SSL连接未验证。
msf > nexpose_connect -h
[*] Usage:
[*] nexpose_connect username:password@host[:port] >ssl-confirm>
[*] -OR-
[*] nexpose_connect username password host port >ssl-confirm>
msf > nexpose_connect loneferret:something@127.0.0.1:3780 ok
[*] Connecting to Nexpose instance at 127.0.0.1:3780 with username loneferret...
现在我们已连接到我们的服务器,我们可以在Metasploit中运行漏洞扫描。
msf> nexpose_scan -h
用法:
nexpose_scan [选项] <目标IP范围>
选项:
-E <opt> 从扫描中排除指定范围内的主机
-I <opt> 只扫描地址在指定范围内的系统
-P 当服务器完成时,将扫描数据保留在服务器上(这与计算最大许可IP数相关)
-c <opt> 指定用于这些目标的凭据(格式为type:user:pass)
-d 基于现有数据库的内容扫描主机
-h 这个帮助菜单
-n <opt> 一次扫描的最大IP数(默认值为32)
-s <opt> 存储Nexpose实例中原始XML文件的目录(可选)
-t <opt> 要使用的扫描模板(默认值:pentest-audit选项:full-audit,exhaustive-audit,discovery,aggressive-discovery,dos-auditdos)
full-audit:全面审计;
exhaustive-audit:彻底审计;
discovery:发现;aggressive-discovery:攻击发现;
dos-auditdos:dos审计;
-v 显示有关扫描过程的诊断信息
我们将为我们的扫描仪提供' ssh '服务的凭证,并使用' full-audit' 扫描模板。我们的扫描结果应该与我们之前导入的扫描结果非常相似。
msf > nexpose_scan -c ssh:msfadmin:msfadmin -t full-audit 172.16.194.172
[*] Scanning 1 addresses with template aggressive-discovery in sets of 32
[*] Completed the scan of 1 addresses
msf >
msf > hosts
Hosts
=====
address mac name os_name os_flavor os_sp purpose info comments
------- --- ---- ------- --------- ----- ------- ---- --------
172.16.194.172 METASPLOITABLE Ubuntu Linux device
再次,我们运行' services '和' vulns ',我们可以看到结果与我们通过XML文件导入的结果具有相同的质量。
msf > services
Services
========
host port proto name state info
---- ---- ----- ---- ----- ----
172.16.194.172 21 tcp ftp open vsFTPd 2.3.4
172.16.194.172 22 tcp ssh open OpenSSH 4.7p1
172.16.194.172 23 tcp telnet open
172.16.194.172 25 tcp smtp open Postfix
172.16.194.172 53 tcp dns-tcp open BIND 9.4.2
172.16.194.172 53 udp dns open BIND 9.4.2
172.16.194.172 80 tcp http open Apache 2.2.8
172.16.194.172 111 udp portmapper open
172.16.194.172 111 tcp portmapper open
172.16.194.172 137 udp cifs name service open
172.16.194.172 139 tcp cifs open Samba 3.0.20-Debian
172.16.194.172 445 tcp cifs open Samba 3.0.20-Debian
172.16.194.172 512 tcp remote execution open
172.16.194.172 513 tcp remote login open
172.16.194.172 514 tcp remote shell open
172.16.194.172 1524 tcp ingreslock (ingres) open
172.16.194.172 2049 tcp nfs open
172.16.194.172 2049 udp nfs open
172.16.194.172 3306 tcp mysql open MySQL 5.0.51a
172.16.194.172 5432 tcp postgres open
172.16.194.172 5900 tcp vnc open
172.16.194.172 6000 tcp xwindows open
172.16.194.172 8180 tcp http open Tomcat
172.16.194.172 41407 udp status open
172.16.194.172 44841 tcp mountd open
172.16.194.172 47207 tcp nfs lockd open
172.16.194.172 48972 udp nfs lockd open
172.16.194.172 51255 tcp status open
172.16.194.172 58769 udp mountd open
msf > vulns
[*] Time: 2017-06-20 16:34:21 UTC Vuln: host=172.16.194.172 name=NEXPOSE-cifs-nt-0001 refs=CVE-1999-0519,URL-http://www.hsc.fr/ressources/presentations/null_sessions/
[*] Time: 2017-06-20 16:34:21 UTC Vuln: host=172.16.194.172 name=NEXPOSE-generic-ip-source-routing-enabled refs=BID-646,CVE-1999-0510,CVE-1999-0909,MSB-MS99-038,URL-http://packetstormsecurity.nl/advisories/nai/nai.99-09-20.windows_ip_source_routing
[*] Time: 2017-06-20 16:34:21 UTC Vuln: host=172.16.194.172 name=NEXPOSE-unix-hosts-equiv-allows-access refs=
[*] Time: 2017-06-20 16:34:21 UTC Vuln: host=172.16.194.172 name=NEXPOSE-cifs-share-world-writeable refs=CVE-1999-0520
...省略...
[*] Time: 2017-06-20 16:34:22 UTC Vuln: host=172.16.194.172 name=NEXPOSE-vnc-password-password refs=
[*] Time: 2017-06-20 16:34:22 UTC Vuln: host=172.16.194.172 name=NEXPOSE-apache-tomcat-default-password refs=BID-38084,CVE-2009-3843,CVE-2010-0557
[*] Time: 2017-06-20 16:34:22 UTC Vuln: host=172.16.194.172 name=NEXPOSE-apache-tomcat-example-leaks refs=
[*] Time: 2017-06-20 16:34:22 UTC Vuln: host=172.16.194.172 name=NEXPOSE-apache-tomcat-default-install-page refs=
[*] Time: 2017-06-20 16:34:22 UTC Vuln: host=172.16.194.172 name=NEXPOSE-nfs-mountd-0002 refs=
扩展我们的NeXpose扫描方法
其他类型的扫描可以通过使用' nexpose_discover ',' nexpose_dos '和' nexpose_exhaustive '命令针对目标或目标进行。第一个执行最小的服务发现扫描,因为另一个会添加拒绝服务检查。
运行' nexpose_dos ' 时应该谨慎,因为它可能会很好地崩溃你的目标。
' nexpose_exhaustive '扫描将覆盖所有TCP端口和所有授权的安全检查。
msf > nexpose_discover -h
msf > nexpose_dos -h
msf > nexpose_exhaustive -h
NeXpose和Metasploit的整合随着时间的推移已经大大改善。使用所有NeXpose的特性直接从控制台运行扫描是Framework的一个很好的补充。此外,我们现在有可能将我们的发现与Metasploit的不同模块相关联。此功能是使用稍后模块中讨论的Community Edition提供的。