首先感谢一下
https://blog.csdn.net/xiadeliang1111/article/details/85956982
https://blog.csdn.net/xiadeliang1111/article/details/85645428 这篇文章的作者,给了很大帮助,但是依然给的不全我在他的基础上尽量把完整安装的方法给全,openvas 的yum安装有很多坑,比如任务跑多了不行b段不支持,c段跑完崩了,等等一系列的问题,用源码更可控一点,大不了自己改
首先要关闭防火墙和selinux 并且reboot
yum install zip unzip git wget gcc gcc-c++ bzip2 libxslt net-tools -y #后边需要用的包 有的文章说源码装gcc,尽量有yum就别源码装,前提是好用的情况下
yum install bison flex cmake28 pkgconfig glib2-devel gnutls-devel libpcap-devel gpgme-devel libuuid-devel doxygen libksba-devel libssh-devel #依赖包
rpm -ivh hiredis-0.12.1-1.el7.art.x86_64.rpm
rpm -ivh hiredis-devel-0.12.1-1.el7.art.x86_64.rpm
tar -jxvf pcre-8.42.tar.bz2
cd pcre-8.42
./configure --enable-utf8 --enable-unicode-properties --prefix=/usr/local/openvas/
make
make install
zlib-1.2.11.tar.gz 如果下载去官网需要翻墙,我回头会放到压缩包里
tar -xzvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=/usr/local/openvas/
make
make install
wget sourceware.org:/pub/libffi/libffi-3.2.1.tar.gz
tar -xzvf libffi-3.2.1.tar.gz
cd libffi-3.2.1
./configure --prefix=/usr/local/openvas/
make
make install
export PKG_CONFIG_PATH=/usr/local/openvas/lib/pkgconfig/:$PKG_CONFIG_PATH
wget ftp://ftp.gnome.org/pub/gnome/sources/glib/2.40/glib-2.40.0.tar.xz
xz -d glib-2.40.0.tar.xz
tar -xvf glib-2.40.0.tar
cd glib-2.40.0
./configure --prefix=/usr/local/openvas/
make
make install
tar -zxvf nettle-2.7.1.tar.gz
cd nettle-2.7.1
./configure --prefix=/usr/local/openvas/
make
make install
tar -xzvf libtasn1-4.13.tar.gz
./configure --prefix=/usr/local/openvas/
make
make install
tar -xzvf p11-kit-0.23.13.tar.gz
./configure --prefix=/usr/local/openvas/
make
make install
tar -xzvf cmake-3.12.1.tar.gz
cd cmake-3.12.1
./configure --prefix=/usr/local/openvas/
make
make install
为了使用cmake 加入到环境变量里,PATH=/usr/local/openvas/bin:$PATH
tar -xzvf ncurses.tar.gz
cd ncurses-6.1
./configure --prefix=/usr/local/openvas/
make
make install
rpm -ivh heimdal-libs-1.6.0-0.9.20140621gita5adc06.el7.art.x86_64.rpm
rpm -ivh openvas-smb-1.0.2-1980.el7.art.x86_64.rpm
tar -xzvf libgcrypt-1.6.0.tar.gz
cd libgcrypt-1.6.0
./configure --prefix=/usr/local/openvas/
make
make install
tar -jxvf libgpg-error-1.33.tar.bz2
cd libgpg-error-1.33
./configure --prefix=/usr/local/openvas/
make
make install
yum install sqlite-devel.x86_64
编译openvas-lib
tar -xzvf openvas-libraries-9.0.3.tar.gz
cd gvm-libs-9.0.3/
mkdir build
cd build
export PKG_CONFIG_PATH=/usr/local/openvas/lib/pkgconfig/ #放到/etc/profile 下
export LD_LIBRARY_PATH=/usr/local/openvas/lib:/usr/local/openvas/lib64/ #放到/etc/profile 下
cmake -DCMAKE_C_FLAGS="-I/usr/local/openvas/include/glib-2.0/ -I/usr/local/openvas/include/ -L/usr/local/openvas/lib" -DCMAKE_INSTALL_PREFIX=/usr/local/openvas/ -DCMAKE_INSTALL_RPATH=/usr/local/openvas/lib ..
make
make install
编译openvas-scanner
tar -xzvf openvas-scanner-5.1.3.tar.gz
cd openvas-scanner-5.1.3
mkdir build
cd build
export PKG_CONFIG_PATH=/usr/local/openvas/lib64/pkgconfig/
cmake -DCMAKE_C_FLAGS="-I/usr/local/openvas/include/glib-2.0/ -I/usr/local/openvas/include/ -L/usr/local/openvas/lib" -DCMAKE_INSTALL_PREFIX=/usr/local/openvas/ -DCMAKE_INSTALL_RPATH=/usr/local/openvas/lib ..
make
make install
编译openvas-md
tar -xzvf gvmd-7.0.3.tar.gz
cd gvmd-7.0.3
mkdir build
cd build
cmake -DCMAKE_C_FLAGS="-I/usr/local/openvas/include/glib-2.0/ -I/usr/local/openvas/include/ -L/usr/local/openvas/lib -L/usr/lib64 -lgpg-error" -DCMAKE_INSTALL_PREFIX=/usr/local/openvas/ -DCMAKE_INSTALL_RPATH=/usr/local/openvas/lib ..
make
make install
安装redis
yum install epel-release -y
yum install redis -y
redis的配置文件在/etc/redis.conf 要把sock打开,并放在/tmp.redis.sock下,否则openvas找不到