0

I recently installed openvas9 following this guide. I can log into the web interface on port 4000 just fine, and I ran a scan on my metasploitable VM for testing, and it seems good. Now I wanted to import the results into metasploit.

The issue is that the service openvas-manager to which the openvas plugin of metasploit connects does use a unix-socket file instead of a listening port.
If I run sudo openvasmd --port=9390 -a 127.0.0.1 -f, then msf connects just fine to that instance.
I want to add the listening address and port in addition to the unix socket.

2

In the file /etc/init.d/openvas-manager, which manages the service, you will see that

  • it includes a file with parameters
  • and then uses the variables from that file as arguments.
# Read configuration variable file if it is present
[ -r /etc/default/$DESC ] && . /etc/default/$DESC

# Update DAEMON_ARGS with optional settings from /etc/default
[ -n "$LISTEN_ADDRESS" ] && DAEMON_ARGS="$DAEMON_ARGS --listen=$LISTEN_ADDRESS"
[ -n "$PORT_NUMBER" ] && DAEMON_ARGS="$DAEMON_ARGS --port=$PORT_NUMBER"

So in order to start the service with the listening ports active you must simply have a look at /etc/defaults/openvas-manager

There you can simply uncomment the lines for "LISTEN_ADDRESS" and "PORT_NUMBER" and set the values to your desires.

# Defaults for OpenVAS Manager initscript
# sourced by /etc/init.d/openvas-manager
# installed at /etc/default/openvas-manager by the maintainer scripts

# For more information see `man openvasmd`

# To set listening address:
# 
LISTEN_ADDRESS="127.0.0.1"

# To set listening port number:
#
PORT_NUMBER=9390

Then simply restart the service.

3
  • Note that the files above are distro-specific and might not exists on all installations. Furthermore on e.g. Debian or Kali Linux it contains a note like e.g. "NOTE: This file is not used if you are using systemd." – cfischer Sep 7 '19 at 6:19
  • @cfischer feel free to add the relevant information for those distributions by editing or providing another answer. This answer works specifically for Ubuntu Mate 18.04, but should work for other, similar systems as well. – FalcoGer Sep 10 '19 at 8:52
  • I can't because i don't have any knowledge what / how this should be configured in Kali or other/similar distros instead. That's why only a comment for the hint/note above was used and not an answer. Still it needs to be documented that the answer might not work for every installation out there. – cfischer Dec 2 '19 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.