{"id":13239,"date":"2022-06-27T08:30:05","date_gmt":"2022-06-27T05:30:05","guid":{"rendered":"https:\/\/kifarunix.com\/?p=13239"},"modified":"2024-03-09T15:05:16","modified_gmt":"2024-03-09T12:05:16","slug":"install-gvm-21-4-on-kali-linux","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-gvm-21-4-on-kali-linux\/","title":{"rendered":"Install GVM 21.4\u00a0on Kali Linux"},"content":{"rendered":"\n
In this guide, you will learn how to install GVM 21.4 on Kali Linux. G<\/strong>reenbone V<\/strong>ulnerability M<\/strong>anagement (GVM), previously known as OpenVAS, is a network security scanner which provides a set of network vulnerability tests (NVTs) to detect security loopholes in systems and applications. As of this writing, GVM 21.4.4 is the current stable release<\/a>.<\/p>\n\n\n\n In this demo, we will install and setup GVM 21.4 on Kali Linux from source code. As such, below are the system requirements I would personally recommend.<\/p>\n\n\n\n These requirements will vary depending on your use cases, however. Just be sure to provide \u201cenough\u201d.<\/p>\n\n\n\n To begin with, update and upgrade your system packages;<\/p>\n\n\n\n In this demo, we will run GVM 21.08 as a non privileged system user. Thus, create Create the GVM user directory as specified by option In order to successfully build GVM 21.4 on Kali Linux, you need to install a number of required dependencies and build tools.<\/p>\n\n\n\n Next, install Yarn JavaScript package manager<\/p>\n\n\n\n GVM 21.4 uses PostgreSQL as the backend database. We use version 14 in this setup, which is already installed on Kali Linux 2022.2 which we are using.<\/p>\n\n\n\n To check the version;<\/p>\n\n\n\n Sample output;<\/p>\n\n\n\n Start and enable PostgreSQL service to run on system boot;<\/p>\n\n\n\n Confirm it is up by checking the ports opened;<\/p>\n\n\n\n Once the installation is done, create the PostgreSQL user and database for Greenbone Vulnerability Management Daemon (gvmd).<\/p>\n\n\n\n Note that the database and user should be created as PostgreSQL user, postgres<\/strong>.<\/p>\n\n\n\n Grant PostgreSQL GVM User DBA Roles<\/p>\n\n\n\n Once that is done, restart PostgreSQL;<\/p>\n\n\n\n Allow the user to run the installation with sudo rights;<\/p>\n\n\n\n There are different tools required to install and setup GVM 21.4 on Kali Linux. These include;<\/p>\n\n\n\n Every component has README.md<\/strong> and a INSTALL.md<\/strong> file that explains how to build and install it.<\/p>\n\n\n\n Switch to GVM user created above and create a directory where to download the source files to;<\/p>\n\n\n\n Navigate to temporary directory created above and run the subsequent commands to clone the GVM github branch files.<\/p>\n\n\n\n Once the source files are in place, proceed to build and install GVM on Kali Linux.<\/p>\n\n\n\n Note the current working directory;<\/p>\n\n\n\n To begin with, switch to GVM user account.<\/p>\n\n\n\n Next, set the From within the source directory, Open Vulnerability Assessment Scanner (OpenVAS) is a full-featured scan engine that executes a continuously updated and extended feed of Network Vulnerability Tests (NVTs).<\/p>\n\n\n\nInstall GVM 21.4 on Kali Linux<\/h2>\n\n\n\n
Prerequisites<\/h3>\n\n\n\n
\n
Run System Update<\/h3>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\n
Create GVM User on Ubuntu<\/h3>\n\n\n\n
gvm<\/strong><\/code> system user account.<\/p>\n\n\n\n
useradd -r -d \/opt\/gvm -c \"GVM User\" -s \/bin\/bash gvm<\/code><\/pre>\n\n\n\n
-d<\/code> in the command above and set the user and group ownership to
gvm<\/code>.<\/p>\n\n\n\n
mkdir \/opt\/gvm && chown gvm: \/opt\/gvm<\/code><\/pre>\n\n\n\n
Install Required Build Tools<\/h3>\n\n\n\n
apt install gcc g++ make bison flex libksba-dev \\\ncurl redis libpcap-dev cmake git pkg-config libglib2.0-dev libgpgme-dev \\\nnmap libgnutls28-dev uuid-dev libssh-gcrypt-dev libldap2-dev gnutls-bin \\\nlibmicrohttpd-dev libhiredis-dev zlib1g-dev libxml2-dev libnet-dev libradcli-dev \\\nclang-format libldap2-dev doxygen gcc-mingw-w64 xml-twig-tools libical-dev perl-base \\\nheimdal-dev libpopt-dev libunistring-dev graphviz libsnmp-dev python3-setuptools \\\npython3-paramiko python3-lxml python3-defusedxml python3-dev gettext python3-polib \\\nxmltoman python3-pip texlive-fonts-recommended libpq-dev postgresql-server-dev-all \\\ntexlive-latex-extra --no-install-recommends xsltproc sudo vim rsync -y\n<\/code><\/pre>\n\n\n\n
Install Yarn on Kali Linux<\/h4>\n\n\n\n
curl -sL https:\/\/dl.yarnpkg.com\/debian\/pubkey.gpg | gpg --dearmor | sudo tee \/usr\/share\/keyrings\/yarnkey.gpg >\/dev\/null<\/code><\/pre>\n\n\n\n
echo \"deb [signed-by=\/usr\/share\/keyrings\/yarnkey.gpg] https:\/\/dl.yarnpkg.com\/debian stable main\" | sudo tee \/etc\/apt\/sources.list.d\/yarn.list<\/code><\/pre>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\n
apt install yarn -y<\/code><\/pre>\n\n\n\n
Install PostgreSQL on Kali Linux<\/h4>\n\n\n\n
psql --version<\/code><\/pre>\n\n\n\n
psql (PostgreSQL) 14.2 (Debian 14.2-1+b3)<\/code><\/pre>\n\n\n\n
systemctl enable --now postgresql<\/code><\/pre>\n\n\n\n
ss -altnp | grep postgres<\/code><\/pre>\n\n\n\n
LISTEN 0 244 127.0.0.1:5432 0.0.0.0:* users:((\"postgres\",pid=26282,fd=6))\nLISTEN 0 244 [::1]:5432 [::]:* users:((\"postgres\",pid=26282,fd=5))<\/code><\/pre>\n\n\n\n
Create PostgreSQL User and Database<\/h4>\n\n\n\n
sudo -Hiu postgres createuser gvm<\/code><\/pre>\n\n\n\n
sudo -Hiu postgres createdb -O gvm gvmd<\/code><\/pre>\n\n\n\n
sudo -Hiu postgres psql gvmd -c 'create role dba with superuser noinherit;'<\/code><\/pre>\n\n\n\n
sudo -Hiu postgres psql gvmd -c 'grant dba to gvm;'<\/code><\/pre>\n\n\n\n
sudo -Hiu postgres psql gvmd -c 'create extension \"uuid-ossp\";'<\/code><\/pre>\n\n\n\n
sudo -Hiu postgres psql gvmd -c 'create extension \"pgcrypto\";'<\/code><\/pre>\n\n\n\n
systemctl restart postgresql<\/code><\/pre>\n\n\n\n
echo \"gvm ALL = NOPASSWD: $(which make) install\" > \/etc\/sudoers.d\/gvm<\/code><\/pre>\n\n\n\n
Building GVM 21.4 from Source Code<\/h3>\n\n\n\n
\n
Build and Install GVM on Kali Linux<\/h4>\n\n\n\n
su -Hiu gvm mkdir gvm-source<\/code><\/pre>\n\n\n\n
Download GVM 21.4 Source Files<\/h4>\n\n\n\n
sudo -Hiu gvm git clone -b stable --single-branch https:\/\/github.com\/greenbone\/gvm-libs.git gvm-source\/gvm-libs<\/code><\/pre>\n\n\n\n
sudo -Hiu gvm git clone -b main --single-branch https:\/\/github.com\/greenbone\/openvas-smb.git gvm-source\/openvas-smb<\/code><\/pre>\n\n\n\n
sudo -Hiu gvm git clone -b stable --single-branch https:\/\/github.com\/greenbone\/openvas.git gvm-source\/openvas<\/code><\/pre>\n\n\n\n
sudo -Hiu gvm git clone -b stable --single-branch https:\/\/github.com\/greenbone\/ospd.git gvm-source\/ospd<\/code><\/pre>\n\n\n\n
sudo -Hiu gvm git clone -b stable --single-branch https:\/\/github.com\/greenbone\/ospd-openvas.git gvm-source\/ospd-openvas<\/code><\/pre>\n\n\n\n
sudo -Hiu gvm git clone -b stable --single-branch https:\/\/github.com\/greenbone\/gvmd.git gvm-source\/gvmd<\/code><\/pre>\n\n\n\n
sudo -Hiu gvm git clone -b stable --single-branch https:\/\/github.com\/greenbone\/gsa.git gvm-source\/gsa<\/code><\/pre>\n\n\n\n
sudo -Hiu gvm git clone -b stable --single-branch https:\/\/github.com\/greenbone\/gsad.git gvm-source\/gsad<\/code><\/pre>\n\n\n\n
sudo -Hiu gvm ls -1 gvm-source<\/code><\/pre>\n\n\n\n
\ngsa\ngsad\ngvmd\ngvm-libs\nopenvas\nopenvas-smb\nospd\nospd-openvas\n<\/code><\/pre>\n\n\n\n
su - gvm\ncd gvm-source<\/code><\/pre>\n\n\n\n
PKG_CONFIG_PATH<\/code> environment variable to the location of your pkg-config files before configuring:<\/p>\n\n\n\n
echo \"export PKG_CONFIG_PATH=\/opt\/gvm\/lib\/pkgconfig:$PKG_CONFIG_PATH\" >> ~\/.bashrc<\/code><\/pre>\n\n\n\n
source ~\/.bashrc<\/code><\/pre>\n\n\n\n
Build and Install GVM 11 Libraries<\/h4>\n\n\n\n
\/opt\/gvm\/gvm-source<\/strong><\/code>, in this setup, change to GVM libraries directory;<\/p>\n\n\n\n
cd gvm-libs\nmkdir build && cd build\ncmake ..\nmake\nsudo make install<\/code><\/pre>\n\n\n\n
Build and Install OpenVAS scanner and OpenVAS SMB<\/h4>\n\n\n\n