Kali and Openvas GVM Setup

Cheat sheet:

# Start
sudo gvm-start
# Stop
sudo gvm-stop
# Update the feed
sudo gvm-feed-update

Hit the web UI at: https://your.ip.add.ress:9392/

Build-out:
Make a new Kali machine on libvirt VM, lxc, lxd, proxmox, whatever, just not docker (for Kali or Openvas, too many updates that get eaten/lost/etc. and OpenVas is HUGE). 

sudo su - 
apt update
apt upgrade
systemctl enable ssh.service


apt install openvas
apt install gvm
gvm-setup

(If it fails with ERROR: The default postgresql version is not 13 required by libgvmd) See fix below.

gvm-setup
(should work now and update the feed etc. takes a LONG time just let it go) GET THE PASSWORD AT THE END!

Make it listen on on more than 127.0.0.1:
gvm-stop
sed -ibak -e 's/127.0.0.1/0.0.0.0/g' /lib/systemd/system/greenbone-security-assistant.service
sed -ibak -e 's/127.0.0.1/0.0.0.0/g' /etc/default/greenbone-security-assistant
gvm-start
(Ignore the 127.0.0.1 there, it’s just in the script)
sudo gvm-feed-update
 to update the feed only
sudo gvm-start/stop 
to start or stop the service

Hit the web UI at: https://your.ip.add.ress:9392/
admin and the ong password it generated at the end of the setup

gvm-setup fix: edit:
vi /etc/postgresql/12/main/postgresql.conf
vi /etc/postgresql/13/main/postgresql.conf

Look for port = in both

Make v12 5433
Make v13 5432
systemctl restart postgresql

We aren’t using postgres for anything else here, so not being very careful with it
OR
FIX:
list your clusters
pg_lsclusters
and drop all clusters besides 13 cluster.
eg:
sudo pg_dropcluster 12 main –stop