openvas9源码下载网址:https://community.greenbone.net/t/gvm-9-stable-initial-release-2017-03-07/211
依赖包下载网址:https://centos.pkgs.org
参见文档 https://elatov.github.io/2014/06/compile-openvas-7-on-centos-6/
一、预备
yum install bison flex cmake28 pkgconfig glib2-devel gnutls-devel libpcap-devel gpgme-devel libuuid-devel doxygen libksba-devel libssh-devel
1、安装gcc4.8.2
详见编译gcc4.8.2 https://blog.csdn.net/xiadeliang1111/article/details/85561767
2、安装hiredis
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
https://centos.pkgs.org/7/atomic-x86_64/hiredis-0.12.1-1.el7.art.x86_64.rpm.html
3、编译pcre
tar -jxvf pcre-8.42.tar.bz2
cd pcre-8.42
./configure --enable-utf8 --enable-unicode-properties --prefix=/usr/local/openvas/
make
make install
4、编译glib2.4.0
详见glib2.40编译 https://blog.csdn.net/xiadeliang1111/article/details/85645428
5、安装nettle2.7.1
./configure --prefix=/usr/local/openvas/
make
make install
6、安装libtasn1
tar -xzvf libtasn1-4.13.tar.gz
./configure --prefix=/usr/local/openvas/
make
make install
7、安装p11-kit
tar -xzvf p11-kit-0.23.13.tar.gz
./configure --prefix=/usr/local/openvas/
make
make install
8、安装gmp
xz -d gmp-6.1.2.tar.xz
tar -xvf gmp-6.1.2.tar
cd gmp-6.1.2
./configure --prefix=/usr/local/openvas/
make
make install
9、编译cmake3.12.1
tar -xzvf cmake-3.12.1.tar.gz
cd cmake-3.12.1
./configure --prefix=/usr/local/openvas/
make
make install
编译完成后,cmake安装在/usr/local/openvas/bin下,加入环境变量。PATH=/usr/local/openvas/bin:$PATH
10、编译ncurse
tar -xzvf ncurses.tar.gz
cd ncurses-6.1
./configure --prefix=/usr/local/openvas/
make
make install
11、安装libasn1.so
rpm -ivh heimdal-libs-1.6.0-0.9.20140621gita5adc06.el7.art.x86_64.rpm
12、安装openvas-smb
https://centos.pkgs.org/7/atomic-x86_64/openvas-smb-1.0.1-0.2.el7.art.x86_64.rpm.html
rpm -ivh openvas-smb-1.0.2-1980.el7.art.x86_64.rpm
13、安装libgcrypt
http://mirrors.dotsrc.org/gcrypt/libgcrypt/
tar -xzvf libgcrypt-1.6.0.tar.gz
cd libgcrypt-1.6.0
./configure --prefix=/usr/local/openvas/
make
make install
14、安装libg'pg-error
tar -jxvf libgpg-error-1.33.tar.bz2
cd libgpg-error-1.33
./configure --prefix=/usr/local/openvas/
make
make install
15、安装sqlite3
yum install sqlite-devel.x86_64
二、编译openvas-lib
1. tar -xzvf openvas-libraries-9.0.3.tar.gz
2. cd gvm-libs-9.0.3/
3. mkdir build
4. cd build
5. export PKG_CONFIG_PATH=/usr/local/openvas/lib/pkgconfig/
6. export LD_LIBRARY_PATH=/usr/local/openvas/lib:/usr/local/openvas/lib64/
7. 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 ..
8. make
9. make install
三、编译openvas-scanner
1. tar -xzvf openvas-scanner-5.1.3.tar.gz
2. cd openvas-scanner-5.1.3
3. mkdir build
4. cd build
5. export PKG_CONFIG_PATH=/usr/local/openvas/lib64/pkgconfig/
6. 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 ..
7. make
8. make install
四、编译openvas-md
1. tar -xzvf gvmd-7.0.3.tar.gz
2. cd gvmd-7.0.3
3. mkdir build
4. cd build
5. 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 ..
6. make
7. make install
至此,openvas9库,扫描器,管理器编译完毕。由于整理的匆忙,编译过程中可能有重复安装的地方。编译时注意库路径,添加相应的库,注意库的不同版本的影响。
欢迎交流。
openvas9源码及各种依赖包下载: