metasploit + openvas

本文介绍了如何在Metasploit环境中使用OpenVAS漏洞扫描器。包括启动OpenVAS服务、连接到OpenVAS服务器、创建和管理目标、配置及任务等操作。

安装openvas后,使用命令openvas_start开启对应的服务。

root@gnu:~# openvas-start
Starting OpenVas Services
Starting Greenbone Security Assistant: gsad.
Starting OpenVAS Scanner: openvassd.
Starting OpenVAS Administrator: openvasad.
Starting OpenVAS Manager: ERROR.

开启服务后,开放端口 9390/9391/9392/9393, 9390 供metasploit的openvas插件使用, 9392可用https://localhost:9392/ 访问图形接口。

root@gnu:~# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 127.0.0.1:9390          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:9391          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:9392          0.0.0.0:*               LISTEN     
tcp        0      0 127.0.0.1:9393          0.0.0.0:*               LISTEN     

下面介绍如何在metasploit环境中使用openvas扫描器

root@gnu:~# msfconsole
 _                                                    _
/ \    /\         __                         _   __  /_/ __
| |\  / | _____   \ \           ___   _____ | | /  \ _   \ \
| | \/| | | ___\ |- -|   /\    / __\ | -__/ | || | || | |- -|
|_|   | | | _|__  | |_  / -\ __\ \   | |    | | \__/| |  | |_
      |/  |____/  \___\/ /\ \\___/   \/     \__|    |_\  \___\


Save your shells from AV! Upgrade to advanced AV evasion using dynamic
exe templates with Metasploit Pro -- type 'go_pro' to launch it now.

       =[ metasploit v4.8.2-2014010101 [core:4.8 api:1.0]
+ -- --=[ 1246 exploits - 678 auxiliary - 198 post
+ -- --=[ 324 payloads - 32 encoders - 8 nops

msf > 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
msf >

msf > openvas_help
[*] openvas_help                  Display this help
[*] openvas_debug                 Enable/Disable debugging
[*] openvas_version               Display the version of the OpenVAS server
[*]
[*] CONNECTION
[*] ==========
[*] openvas_connect               Connects to OpenVAS
[*] openvas_disconnect            Disconnects from OpenVAS
[*]
[*] TARGETS
[*] =======
[*] openvas_target_create         Create target
[*] openvas_target_delete         Deletes target specified by ID
[*] openvas_target_list           Lists targets
[*]
[*] TASKS
[*] =====
[*] openvas_task_create           Create task
[*] openvas_task_delete           Delete a task and all associated reports
[*] openvas_task_list             Lists tasks
[*] openvas_task_start            Starts task specified by ID
[*] openvas_task_stop             Stops task specified by ID
[*] openvas_task_pause            Pauses task specified by ID
[*] openvas_task_resume           Resumes task specified by ID
[*] openvas_task_resume_or_start  Resumes or starts task specified by ID
[*]
[*] CONFIGS
[*] =======
[*] openvas_config_list           Lists scan configurations
[*]
[*] FORMATS
[*] =======
[*] openvas_format_list           Lists available report formats
[*]
[*] REPORTS
[*] =======
[*] openvas_report_list           Lists available reports
[*] openvas_report_delete         Delete a report specified by ID
[*] openvas_report_import         Imports an OpenVAS report specified by ID
[*] openvas_report_download       Downloads an OpenVAS report specified by ID


msf > openvas_connect
[*] Usage:
[*] openvas_connect username password host port <ssl-confirm>
msf > openvas_connect admin password localhost 9390 openvas_test
[*] Connecting to OpenVAS instance at localhost:9390 with username admin...
[+] OpenVAS connection successful
msf > openvas_target_list
[+] OpenVAS list of targets

ID  Name       Hosts          Max Hosts  In Use  Comment
--  ----       -----          ---------  ------  -------
0   101        192.168.1.101  1          1       localhost-101
1   Localhost  localhost      1          0       


msf > openvas_config_list
[+] OpenVAS list of configs

ID  Name
--  ----
0   empty
1   Full and fast
2   Full and fast ultimate
3   Full and very deep
4   Full and very deep ultimate


msf > openvas_task_create
[*] Usage: openvas_task_create <name> <comment> <config_id> <target_id>
msf > openvas_task_create test001 test001 2 0
[*] OK, resource created: 4158e9ff-d115-4090-9d13-620e7120618b
[+] OpenVAS list of tasks

ID  Name     Comment        Status   Progress
--  ----     -------        ------   --------
0   101      localhost-101  Stopped  1
1   test001  test001        New      -1


关于 openvas 的主机管理、任务管理、配置管理、报告管理等,有待大家深入研究。


=================================================
参考链接:
http://resources.infosecinstitute.com/vulnerability-scanning-metasploit-part-2/
http://resources.infosecinstitute.com/vulnerability-scanning-metasploit-part-ii/

### Nmap - **特点**:开源免费,功能强大且灵活,支持多种扫描技术,能在不同操作系统上运行。 - **功能**:可进行主机发现、端口扫描、服务和版本检测、操作系统检测等。 - **使用方法**: ```bash # 简单的主机发现扫描 nmap -sn 192.168.1.0/24 # 进行全端口扫描 nmap -p- 192.168.1.100 # 服务和版本检测 nmap -sV 192.168.1.100 ``` ### Nessus - **特点**:界面友好,拥有庞大的漏洞库,能生成详细的报告。 - **功能**:全面的漏洞扫描,可检测操作系统、网络设备、应用程序等的安全漏洞。 - **使用方法**: 1. 安装并启动 Nessus 服务。 2. 打开浏览器,访问 Nessus 管理界面,创建扫描任务。 3. 配置扫描目标、扫描类型等参数。 4. 启动扫描并等待结果。 ### OpenVAS - **特点**:开源的漏洞扫描器,社区活跃,更新及时。 - **功能**:对网络资产进行漏洞扫描,提供漏洞详细信息和修复建议。 - **使用方法**: 1. 安装并配置 OpenVAS 服务。 2. 启动服务后,通过浏览器访问管理界面。 3. 创建扫描目标和扫描任务。 4. 执行扫描并查看结果。 ### Metasploit - **特点**:集成多种攻击模块,能快速进行漏洞利用和渗透测试。 - **功能**:漏洞扫描、漏洞利用、后渗透攻击等。 - **使用方法**: ```bash # 启动 Metasploit 控制台 msfconsole # 搜索漏洞模块 search ms17_010 # 使用漏洞模块 use exploit/windows/smb/ms17_010_eternalblue # 设置目标 set RHOSTS 192.168.1.100 # 执行攻击 exploit ``` ### AppScan - **特点**:专注于 Web 应用程序安全测试,支持多种技术栈。 - **功能**:检测 Web 应用中的 SQL 注入、XSS 等安全漏洞。 - **使用方法**: 1. 启动 AppScan。 2. 配置扫描目标和扫描策略。 3. 开始扫描,等待扫描完成后查看报告。 ### Wpscan - **特点**:专门针对 WordPress 网站的安全扫描工具。 - **功能**:检测 WordPress 核心、插件和主题的漏洞,枚举用户等。 - **使用方法**: ```bash # 扫描 WordPress 网站 wpscan --url https://example.com ``` ### Intruder - **特点**:是 Burp Suite 中的一个模块,可进行强力攻击、模糊测试等。 - **功能**:用于发现 Web 应用程序中的漏洞,如密码脆弱性、参数注入等。 - **使用方法**: 1. 在 Burp Suite 中捕获目标请求。 2. 将请求发送到 Intruder 模块。 3. 配置攻击类型、有效载荷等参数。 4. 启动攻击并分析结果。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值