Install OpenVAS 6 on Ubuntu

When I was installing OpenVAS 6 on Ubuntu via sources, I noticed that it wasn’t like just making a walk in the park. So I made some notes and hope that other people might find this useful. Here we go:

Installation

Install dependencies:

apt-get install pkg-config libssh-dev libglib2.0-dev libpcap-dev libgpgme11-dev uuid-dev bison libksba-dev cmake make doxygen autoconf libgnutls-dev

Download sources:

mkdir downloads
cd downloads
wget http://wald.intevation.org/frs/download.php/1303/openvas-libraries-6.0.0.tar.gz
wget http://wald.intevation.org/frs/download.php/1307/openvas-scanner-3.4.0.tar.gz
wget http://wald.intevation.org/frs/download.php/1331/openvas-manager-4.0.1.tar.gz
wget http://wald.intevation.org/frs/download.php/1319/openvas-administrator-1.3.0.tar.gz
wget http://wald.intevation.org/frs/download.php/1323/openvas-cli-1.2.0.tar.gz
wget http://www.openvas.org/download/wmi/wmi-1.3.14.tar.bz2
wget http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch
wget http://www.openvas.org/download/wmi/openvas-wmi-1.3.14.patch2

Unpack everything:

tar zxvf openvas*
tar jxf wmi-1.3.14.tar.bz2

Copy and patch wmi-client

cp openvas-wmi-1.3.14.patch wmi-1.3.14
cp openvas-wmi-1.3.14.patch2 wmi-1.3.14
cd wmi-1.3.14
patch -p1 < openvas-wmi-1.3.14.patch
patch -p1 < openvas-wmi-1.3.14.patch2

Install wmi-client

cd Samba/source
./autogen.sh
./configure
make proto all
make libraries

bash install-libwmiclient.sh

Export the right locales:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales

Export the right path to pkgconfig:

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/share/pkgconfig

Install openvas-libraries:

cd openvas-libraries-6.0.0
mkdir build
cd build
cmake ..
cd ..

Create a patch:

vim openvas_file.patch
Modified: trunk/openvas-libraries/base/openvas_file.c
===================================================================
--- openvas-libraries/base/openvas_file.c   2013-05-16 13:58:40 UTC (rev 16368)
+++ openvas-libraries/base/openvas_file.c   2013-05-16 17:29:09 UTC (rev 16369)
@@ -164,7 +164,9 @@
   GFile *sfile, *dfile;
   GError *error;

+#if !GLIB_CHECK_VERSION(2, 35, 0)
   g_type_init ();
+#endif
   sfile = g_file_new_for_path (source_file);
   dfile = g_file_new_for_path (dest_file);
   error = NULL;
@@ -200,7 +202,9 @@
   GFile *sfile, *dfile;
   GError *error;

+#if !GLIB_CHECK_VERSION(2, 35, 0)
   g_type_init ();
+#endif
   sfile = g_file_new_for_path (source_file);
   dfile = g_file_new_for_path (dest_file);
   error = NULL;
patch -p1 < openvas_file.patch

cd build
make
make install

Install openvas-manager

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/share/pkgconfig
apt-get install sqlite3 libsqlite3-dev
cd openvas-manager-4.0.1
mkdir build
cd build
cmake ..
make
make install

Install openvas-administrator

cd openvas-administrator-1.3.0

mkdir build
cd build
cmake ..
make
make install

Install openvas-cli

cd openvas-cli-1.2.0
mkdir build
cd build
cmake ..
make
make install

Install openvas-scanner

cd openvas-scanner-3.4.0
mkdir build
cd build
cmake ..
make
make install

Make some symlinks or you’ll get errors:

ln -s /usr/local/lib/libopenvas_misc.so.6 /usr/lib/libopenvas_misc.so.6
ln -s /usr/local/lib/libopenvas_nasl.so.6 /usr/lib/libopenvas_nasl.so.6
ln -s /usr/local/lib/libopenvas_omp.so.6 /usr/lib/libopenvas_omp.so.6
ln -s /usr/local/lib/libopenvas_base.so.6 /usr/lib/libopenvas_base.so.6
ln -s /usr/local/lib/libopenvas_hg.so.6 /usr/lib/libopenvas_hg.so.6

Creating a user and start OpenVAS

First create a user and password with openvas-manager.

openvas-adduser

Sync to get the latest set of plugins

sudo openvas-nvt-sync

Start the openVAS server

sudo openvassd

References:

https://svn.wald.intevation.org/svn/openvas/trunk/openvas-libraries/doc/wmi-howto.txt

https://lists.wald.intevation.org/pipermail/openvas-commits/2013-May/016420.html