Activating the GMP Protocol?


#1

I want to access the OpenVAS server from another server via gvm-cli.

gvm-cli ssh --gmp-username admin --gmp-password passwd --hostname 192.168.xx.yy --xml “<get_version/>”

Traceback (most recent call last):
File “/usr/local/bin/gvm-cli”, line 11, in
sys.exit(main())
File “/usr/local/lib/python3.5/dist-packages/gvmtools/cli.py”, line 57, in main
args = parser.parse_args()
File “/usr/local/lib/python3.5/dist-packages/gvmtools/parser.py”, line 196, in parse_args
args = self._parser.parse_args(args)
File “/usr/lib/python3.5/argparse.py”, line 1735, in parse_args
args, argv = self.parse_known_args(args, namespace)
File “/usr/lib/python3.5/argparse.py”, line 1767, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File “/usr/lib/python3.5/argparse.py”, line 1955, in _parse_known_args
positionals_end_index = consume_positionals(start_index)
File “/usr/lib/python3.5/argparse.py”, line 1932, in consume_positionals
take_action(action, args)
File “/usr/lib/python3.5/argparse.py”, line 1841, in take_action
action(self, namespace, argument_values, option_string)
File “/usr/lib/python3.5/argparse.py”, line 1138, in call
subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
File “/usr/lib/python3.5/argparse.py”, line 1767, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File “/usr/lib/python3.5/argparse.py”, line 1955, in _parse_known_args
positionals_end_index = consume_positionals(start_index)
File “/usr/lib/python3.5/argparse.py”, line 1932, in consume_positionals
take_action(action, args)
File “/usr/lib/python3.5/argparse.py”, line 1825, in take_action
argument_values = self._get_values(action, argument_strings)
File “/usr/lib/python3.5/argparse.py”, line 2266, in _get_values
value = self._get_value(action, arg_string)
File “/usr/lib/python3.5/argparse.py”, line 2295, in _get_value
result = type_func(arg_string)
FileNotFoundError: [Errno 2] No such file or directory: ‘admin’

In the manual, I found the hint that gmp must first be activated in order to use it over the network. https://docs.greenbone.net/GSM-Manual/gos-4/en/omp.html?highlight=gvm

The above error message does not necessarily fit, but still my question

How can I activate the GMP protocol in the Source Edition?


#2

Hi,

to be able to debug issues it is always necessary to know the exact version of the tools you are using. In this case could you please paste the output of gvm-cli --version?

From the traceback it’s very likely you just hit https://github.com/greenbone/gvm-tools/issues/182


#3

gvm-cli --version

gvm-cli 2.0.0b1 (API version 1.0.0.beta2)


#4

You are using a non released version from the master branch. Therefore you might always expect broken and unexpected behavior. But nevertheless it is definitively https://github.com/greenbone/gvm-tools/issues/182


#5

Of course you are right, had overlooked the note. I’m sorry about it.
Next try, other mistake.

  1. Authentication failed
  2. SSH Connection failed

# gvm-cli --gmp-username admin --gmp-password passwd ssh --hostname 192.168.xx.yy --xml '<get_version/>'
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/gvm/connections.py”, line 206, in connect
look_for_keys=False)
File “/usr/local/lib/python3.5/dist-packages/paramiko/client.py”, line 437, in connect
passphrase,
File “/usr/local/lib/python3.5/dist-packages/paramiko/client.py”, line 749, in _auth
raise saved_exception
File “/usr/local/lib/python3.5/dist-packages/paramiko/client.py”, line 736, in _auth
self._transport.auth_password(username, password)
File “/usr/local/lib/python3.5/dist-packages/paramiko/transport.py”, line 1436, in auth_password
return self.auth_handler.wait_for_response(my_event)
File “/usr/local/lib/python3.5/dist-packages/paramiko/auth_handler.py”, line 250, in wait_for_response
raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/local/bin/gvm-cli”, line 11, in
sys.exit(main())
File “/usr/local/lib/python3.5/dist-packages/gvmtools/cli.py”, line 98, in main
protocol.authenticate(args.gmp_username, args.gmp_password)
File “/usr/local/lib/python3.5/dist-packages/gvm/protocols/gmpv7.py”, line 210, in authenticate
self._send(cmd.to_string())
File “/usr/local/lib/python3.5/dist-packages/gvm/protocols/base.py”, line 62, in _send
self.connect()
File “/usr/local/lib/python3.5/dist-packages/gvm/protocols/base.py”, line 98, in connect
self._connection.connect()
File “/usr/local/lib/python3.5/dist-packages/gvm/connections.py”, line 214, in connect
raise GvmError(‘SSH Connection failed’, e)
gvm.errors.GvmError: (‘SSH Connection failed’, AuthenticationException(‘Authentication failed.’,))


#6

That error is very clear. It wasn’t possible to authenticate with your username/password combination.

Getting back on this. Easiest solution is to run gvm-tools on the same host via unix domain socket connection type. Otherwise you have to setup TLS or SSH.


#7

For my scenario, it is better if the gvm tools run on a different Computer.

Is there a manual to set up the communication via ssh or tls?