小白记录
安装openvas,安装过程中遇到了很多问题,记录一下
- 更新kali源为国内源,会快一些,打开软件源文件
leafpad /etc/apt/sources.list
- 将官方源替换成如下任意一个即可:
#中科大
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
#阿里云
deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
#清华大学
deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
#浙大
deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
- 更新的软件包列表信息
如果想更新一下系统就再输入apt-get upgrade
apt--get update
- 输入命令安装openvas
apt-get install openvas
报错:
root@kali:~# apt-get install openvas
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
openvas : Depends: openvas-manager (>= 7.0.2-4) but it is not going to be installed
Depends: openvas-scanner (>= 5.1.1-4) but it is not going to be installed
Depends: greenbone-security-assistant (>= 7.0.0) but it is not going to be installed
Depends: openvas-cli (>= 1.4.5) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
- 由于Linux下经常需要安装不同类型的库,很多库之间存在依赖关系,即要安装这个就必须安装那个。有时候,类库之间依赖关系无法满足,你所要安装的程序就不能安装。
这类问题大多是由于相互依赖的几个库中一个或多个的版本已经更新,而用户要安装的库依赖于这几个库的较低的版本,这时候可以试试使用“sudo aptitude install ”(尖括号内为你要安装的程序的名字)
apt-get install aptitude
aptitude install openvas
- 检查是否更新成功,输出installation is OK即可
openvas-check-setup
- 如果像我一样报错,openvas未安装完全
$ ERROR: The NVT collection is very small.
$ FIX: RUN A synchronization script like green-nvt-sync
- 根据FIX提示去更新
sudo green-nvt-sync
报错
tar: Child returned status 2
tar: Error is not recoverable: exiting now
- 安装解压缩软件
apt-get install file-roller
- 建立本地scapdata数据库
sudo greenbone-scapdata-sync
- 获得证书文件 (此过程较长)
sudo greenbone-certdata-sync
- 创建需要的目录
sudo mkdir -p /var/lib/openvas/openvasmd/gnupg/
- 启动scanner
sudo openvassd
- 重建数据库(时间较长)
sudo openvasmd --rebuild
- 创建用户admin
sudo openvasmd --create-user=admin --role=Admin
- 前面的admin是我们创建的,后面是指定管理员类型,设置admin的密码
sudo openvasmd --user=admin --new-password=*******
*******处自己设置密码
- 生成证书
sudo openvas-manage-certs -a
- 启动greenbone security assistant
sudo gsad --listen=127.0.0.1 --port=9392
-
监听本地,端口一般都为9392
-
运行openvas管理器
sudo openvasmd
- 最后使用命令再次检测是安装正常
openvas-check-setup
出现下面信息即为正常
It seems like your OpenVAS-9 installation is OK.