If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Install Openvas 9 with Postgres on Kali linux Rolling

Inspired by 0x4E0x650x6Fˇ guide: Install Openvas 8 with Postgres on Kali linux Rolling
Sadly 0x4E0x650x6Fˇ guide doesn't work for the newest version of the OpenVAS-Mangager, as it have been changed with Openvas-9.
This guide is an updated version of 0x4E0x650x6Fˇ guide, and goes through the steeps needed to compile OpenVAS-manager to use PostgreSQL and how-to set up OpenVAS so that it runs using PostgreSQL as the database instead of SQLite.

This guide is made for Kali rolling, but it might work for other systems. Please also keep in mind that all versions number are from when this guide was made, so newer versions may have been released since then. So if a specific package can’t be found, it may because a newer version have replaced it.

All of the commands run in this guide is run as a superuser.

Install and setup PostgreSQL
First of PostgreSQL needs to be installed

Code:

apt-get install postgresql
service postgresql start

Next setup the user and database with is going to be used by the OpenVAS-manager. These commands needs to be run as the postgres user, as it is the default super user for PostgreSQL.

Building and install the OpenVAS-manager
First of find a place to download the OpenVAS-manager source code to. I create a folder openvas to keep all the files in.

Code:

cd /
mkdir -p openvas/debs
cd openvas/

Next up we need to configure apt-get to also include the Kali source repositories. Edit the file “/etc/apt/sources.list” and remove the out commenting of the line “deb-src http://http.kali.org/kali kali-rolling main non-free contrib”. I use nano for this.

Code:

nano /etc/apt/sources.list
# Enable deb-src by uncommenting it

Finally, we need the dpkg-dev package, to be able to build and install from the OpenVAS-manager source.

Code:

apt-get install dpkg-dev

We are now ready to retrieve the OpenVAS-manager source.

Code:

apt-get source openvas-manager

Before compiling the source, we need to check for any missing dependences and make some minor adjustment so that the OpenVAS-manager will use the PostgreSQL database. First we check for missing dependencies for the manager.

Code:

cd openvas-manager-7.0.2/
dpkg-checkbuilddeps

This returns a list of missing dependences needed for the OpenVAS-manager. If it didn’t return anything, you already got everything you need so everything’s great, if it did return missing dependences, you need to apt-get install each of them.
When you got all the dependences, we need to configure the source code to use PostgreSQL instead of SQLite. First of we need to change the Debian build rules located in “debain/rules” and add the following command "-DBACKEND=POSTGRESQL" to the “override_dh_auto_configure” command. Ones again I use nano for this.

The installation may fail, if any dependencies are found to be missing. In the case apt-get install the missing dependencies and rerun the dpkg command.
After installing the openvas-manager you should hold all its packages so it is not accidently overridden by a SQLite version in a later update (remember you have to manually update the openvas-manager from the source code).