介绍

OpenVAS(Open Vulnerability Assessment System)是一套开源的漏洞/弱点扫描系统,可以强力替代著名的Nessus漏洞检测系统(已经非开源)。OpenVAS集成了多个服务、组件,既提供大量的免费扫描插件(NVT,Network Vulnerability Tests),也提供商业化的增强扫描插件(GSF,Greenbone Security Feed)。

系统环境:
服务器 —— CentOs 5.4 [2.6.18-164.el5 X86_64]
客户机 —— WIN7 旗舰

Open Vas的工作结构

OpenVAS_第1张图片

Open Vas扫描插件来源

OpenVAS_第2张图片

软件环境
客户机端(用户接口)
(1) 专用软件:http://www.greenbone.net/download/Greenbone-Desktop-Suite-1.2.0.exe

1. 软件包安装

安装Open Vas:

Step 1: Configure Atomicorp Repository
(as user root, only once)

wget -q -O - http://www.atomicorp.com/installers/atomic |sh

Step 2: Quick-Install OpenVAS
(as user root, only once)

yum install openvas openvas-setup

Step 3: Quick-Start OpenVAS

( nothing to do, all is up and running directly after installation )

Step 4: Log into OpenVAS with user created in the step 2

依次安装基本依赖包、其他依赖包、OpenVAS主要组件(具体过程略)。
确认安装后的相关文件、脚本——
[root@localhost ~]# ls /usr/sbin/{gsad,openvas*} #//主要执行程序
/usr/sbin/gsad /usr/sbin/openvas-mkcert-client
/usr/sbin/openvasad /usr/sbin/openvas-nvt-sync
/usr/sbin/openvas-adduser /usr/sbin/openvas-nvt-sync-cron
/usr/sbin/openvasmd /usr/sbin/openvas-rmuser
/usr/sbin/openvas-mkcert /usr/sbin/openvassd
[root@localhost ~]# ls /etc/init.d/{gsad,openvas*} #//主要系统服务脚本
/etc/init.d/gsad /etc/init.d/openvas-manager
/etc/init.d/openvas-scanner /etc/init.d/openvas-administrator
[root@localhost ~]# ls /etc/openvas/ #//主要配置文件
gsad_log.conf openvasmd_log.conf openvassd.rules
openvasad_log.conf openvassd.conf
[root@localhost ~]# ls /etc/sysconfig/{gsad,openvas*} #//默认配置文件
/etc/sysconfig/gsad /etc/sysconfig/openvas-manager
/etc/sysconfig/openvas-scanner /etc/sysconfig/openvas-administrator
[root@localhost ~]# ls /var/log/openvas/ #//主要日志文件
greenbone-nvt-sync.log openvasmd.log
openvassd.log openvasad.log openvassd.dump
2. 启动OpenVAS各组件的服务器程序
安装后包括四个系统服务,各自承担不同的用途。
openvas-manager #//负责与客户端Greebone程序通信,完成扫描任务、检测报告的提交等工作,默认端口为9390
openvas-scanner #//实际执行扫描的主服务,默认端口为9391
gsad #//负责提供Web访问界面,默认监听地址为127.0.0.1,端口为9392
openvas-administrator #//负责与openvas-manager、gsad通信,完成用户和配置管理等操作,默认监听地址为127.0.0.1,端口为9393
其中openvas-manager、openvas-scanner会在安装后自动启用,其余两个服务根据需要手动启动。
gsad服务默认只监听127.0.0.1,若要从客户机的浏览器中访问,建议将其改为0.0.0.0后再启动服务。
[root@localhost ~]# vi /etc/sysconfig/gsad
……

GSA_ADDRESS=0.0.0.0
GSA_PORT=9392
[root@localhost ~]# /etc/init.d/gsad start
Starting greebone-security-assistant: [确定]
确认四个服务都启动后的监听状态。
[root@localhost ~]# netstat -anpt | grep ":939"
tcp 0 0 0.0.0.0:9390 0.0.0.0:* LISTEN 6981/openvasmd
tcp 0 0 0.0.0.0:9391 0.0.0.0:* LISTEN 6971/openvassd:wai
tcp 0 0 0.0.0.0:9392 0.0.0.0:* LISTEN 7319/gsad
tcp 0 0 127.0.0.1:9393 0.0.0.0:* LISTEN 7436/openvasad

3. 获取扫描插件(在线或离线方式均可)
(1) 在线同步最新插件,可及时获得最新版插件
[root@localhost ~]# openvas-nvt-sync
(2) 下载离线插件包进行安装
[root@localhost ~]# wget http://www.openvas.org/openvas-nvt-feed-current.tar.bz2
[root@localhost ~]# tar jxf openvas-nvt-feed-current.tar.bz2 -C /var/lib/openvas/plugins/nvt/
—— 更新插件内容后需重启openvas-scanner服务,由于插件数量众多(4万多个),再次启动此服务需耗费较长时间,请耐心等待。
[root@localhost ~]# /etc/init.d/openvas-scanner restart
Stopping openvas-scanner: [确定]
Starting openvas-scanner: [确定]
4. 创建扫描用户、管理员用户
(1) 创建普通扫描用户scanner,允许检测192.168.1.0/24、10.10.10.0/24网段
[root@localhost ~]# openvas-adduser
Using /var/tmp as a temporary file holder.
Add a new openvassd user
-------------------------
Login: admin #//输入要添加的扫描用户名称
Authentication (pass/cert)[pass]: #//直接回车使用默认的密码认证方式
Login password: #//设置密码
Login password(again): #//设置密码(确认)
User rules
------------
openvassd has a rules system which allows you to restrict the hosts that tsengyia has the right to test.
For instance, you may want him to be able to scan his own host only.
Please see the openvas-adduser(8) man page for the rules syntax.
Enter the rules for this user, and hit ctrl-D once you are done.
(the user can have an empty rules set)
accept 192.168.1.0/24 #//设置授权规则(允许扫描哪些网段或主机)
accept 10.10.10.0/24
default deny #//设置默认授权规则(若不指定任何规则,默认允许扫描任意主机、网络)
Login admin
Password ************
Rules
accept 192.168.1.0/24
accept 10.10.10.0/24
default deny
Is that ok? (y/n)[y]