Centos7安装Openvas(GVM-10)

  1. 云栖社区>
  2. 博客>
  3. 正文

Centos7安装Openvas(GVM-10)

Unicorn 2019-11-13 10:55:55 浏览1306
展开阅读全文

安装步骤

主要介绍GVM-10在CentOS 7 64位系统上的安装过程,在root账户下执行各项操作。

查看操作系统版本
cat /etc/redhat-release

操作步骤:
vi /etc/selinux/config
修改参数:
SELINUX=disabled

更新:
yum -y update

重启:
reboot

安装依赖:
yum install -y wget bzip2 texlive net-tools alien gnutls-utils
添加仓库:
wget -q -O - https://www.atomicorp.com/installers/atomic | sh
或者
wget -q -O – https://www6.atomicorp.com/installers/atomic | sh

安装:
yum install gvm -y

编辑文件:
vi /etc/redis.conf
修改配置:
unixsocket /tmp/redis.sock
unixsocketperm 700

重启redis:
systemctl enable redis && systemctl restart redis

启动openvas初始环境配置:
openvas-setup
注意:时间有点长这一步执行过程中可能会出现几次交互操作,执行完成之后,会出现系统使用的管理员账户默认为admin及其密码设置,不允许为空密码,这一步按要求设置密码即可,稍等片刻!

安装完成后需要重启
reboot

进程检查,正常应该为三个Active: active (running)
进程检查:
systemctl status gvmd # manager
systemctl status openvas-scanner # scanner
systemctl status gsad # web ui
示例如下:

systemctl status gvmd

● gvmd.service - OpenVAS Manager
Loaded: loaded (/usr/lib/systemd/system/gvmd.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2019-10-30 03:44:57 CST; 10s ago
Process: 10835 ExecStart=/usr/sbin/gvmd $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 10836 (gvmd)
CGroup: /system.slice/gvmd.service

       ├─10836 gvmd: Waiting for incoming connections
       ├─10858 gvmd: Reloading NVTs
       └─10859 gvmd: Syncing SCAP

Oct 30 03:44:57 VM_0_17_centos systemd[1]: Starting OpenVAS Manager...
Oct 30 03:44:57 VM_0_17_centos systemd[1]: Started OpenVAS Manager.

systemctl status openvas-scanner

● openvas-scanner.service - OpenVAS Scanner
Loaded: loaded (/usr/lib/systemd/system/openvas-scanner.service; disabled; vendor preset: disabled)
Active: active (running) since Wed 2019-10-30 03:44:30 CST; 47s ago
Process: 10771 ExecStart=/usr/sbin/openvassd $SCANNER_SOCKET $SCANNER_MODE $SCANNER_GROUP $SCANNER_OWNER (code=exited, status=0/SUCCESS)
Main PID: 10772 (openvassd)
CGroup: /system.slice/openvas-scanner.service

       ├─10772 /usr/sbin/openvassd
       ├─10773 openvassd: Waiting for incoming connections
       └─10774 openvassd: Reloaded 25350 of 53156 NVTs (47% / ETA: 00:50)

Oct 30 03:44:30 VM_0_17_centos systemd[1]: Starting OpenVAS Scanner...
Oct 30 03:44:30 VM_0_17_centos systemd[1]: Started OpenVAS Scanner.

systemctl status gsad

● gsad.service - Greenbone Security Assistant (OpenVAS)
Loaded: loaded (/usr/lib/systemd/system/gsad.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-10-30 03:38:10 CST; 7min ago
Process: 1248 ExecStart=/usr/sbin/gsad $OPTIONS (code=exited, status=0/SUCCESS)
Main PID: 1356 (gsad)
CGroup: /system.slice/gsad.service

       ├─1356 /usr/sbin/gsad
       └─1357 /usr/sbin/gsad

访问登录:
在浏览器中输入https://192.168.1.1(此处的IP为你部署OpenVAS的主机ip),输入账号admin,或者设置好的用户名及密码,登录成功!现在默认安装完openvas的gsad会监听443端口,也可以尝试访问https://192.168.1.1:9392

如果未响应可以进行端口检查:
查看TCP端口
netstat -ntlp
如果端口443为开启状态且被监听就需要设置防火墙端口放行

防火墙放行端口:(如果系统默认关闭可通过该命令开启)
firewall-cmd --permanent --add-port=443/tcp
firewall-cmd --reload
firewall-cmd --list-port


其他的一些操作

用户操作:
添加用户
sudo gvmd --create-user=unicorn
系统为默认生成密码:
User created with password '6sds652f-f43f-49e8-bc9d-a5s89d483'.
修改用户密码:
sudo gvmd --user=unicorn --new-password=unicorn2019
可通过以下命令删除已添加用户
sudo gvmd --delete-user=unicorn

库更新:
sudo greenbone-nvt-sync
sudo greenbone-scapdata-sync
sudo greenbone-certdata-sync

进程检查:
systemctl status gvmd # manager
systemctl status openvas-scanner # scanner
systemctl status gsad # web ui

启用引导服务:
sudo systemctl enable openvas-scanner
sudo systemctl enable gvmd
sudo systemctl enable gsad

重新启动OpenVAS:
sudo systemctl restart gvmd
sudo systemctl restart openvas-scanner
sudo systemctl restart gsad

WEB管理修改端口:
命令
gsad --http-only --listen=0.0.0.0 -p 5555
或者
echo 'OPTIONS="--listen=0.0.0.0 --port=5555"' > /etc/sysconfig/gsad
systemctl start gsad

服务文件目录
/lib/systemd/system/gvmd.service
/lib/systemd/system/gsad.service
/lib/systemd/system/openvas-scanner.service


报告PDF格式无法下载下载为0K,无法打开问题解决方式
首先,为CentOS 7安装其他texlive软件包。
sudo yum -y install texlive-collection-fontsrecommended texlive-collection-latexrecommended texlive-changepage texlive-titlesec
创建一个目录,下载comment.sty文件,更改对新下载文件的权限,然后使用texhash重新创建数据库。您可以使用以下命令
mkdir -p /usr/share/texlive/texmf-local/tex/latex/comment
cd /usr/share/texlive/texmf-local/tex/latex/comment
wget http://mirrors.ctan.org/macros/latex /contrib/comment/comment.sty
chmod 644 comment.sty
texhash


默认库为自动更新
离线更新
只需定期下载漏洞库压缩包解压覆盖到如下目录:
/var/lib/openvas/plugins/

网友评论

登录后评论
0/500
评论