首先感謝一下
https://blog.csdn.net/xiadeliang1111/article/details/85956982
??https://blog.csdn.net/xiadeliang1111/article/details/85645428 這篇文章的作者漓柑,給了很大幫助犹褒,但是依然給的不全我在他的基礎(chǔ)上盡量把完整安裝的方法給全坯癣,openvas 的yum安裝有很多坑,比如任務(wù)跑多了不行b段不支持拖刃,c段跑完崩了,等等一系列的問題,用源碼更可控一點(diǎn)耻姥,大不了自己改
首先要關(guān)閉防火墻和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 ?如果下載去官網(wǎng)需要翻墻琐簇,我回頭會(huì)放到壓縮包里
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 加入到環(huán)境變量里,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找不到