i’ve a problem with an OSP-Wrapper Skript. I’ve tried that example here for OSP.: https://python-gvm.readthedocs.io/en/latest/
I have python3.4 and installed the gvm-tools 1.41 and python-gvm 1.0.0b2 modules. Unfortunately the modules aren’t been recognized. I’m getting this error:
ImportError: No module named osp.connections
Hi, you should use supported recent versions. gvm-tools 1.4.1 is heavily outdated and from a pre python-gvm area. No current script will work with this version. python-gvm 1.0.0b2 is beta version before the initial first release. So you shouldn’t use that version too.
Yes it should but you are using an unsupported and outdated version of Python too. Python 3.4 is not developed by the Python community anymore. The minimum version should be 3.6. See https://endoflife.date/python
ok, thanks. I’ve upgraded python and pip to 3.6 and 20.2.4. I was able to install the newer packets of python-gvm and gvm-tools (version 20.xx). Now i have the same problem: I’m trying to execute a sample script from https://python-gvm.readthedocs.io/en/latest/
It shows me an error at line:
from osp.connections import UnixSocketConnection
ModuleNotFoundError: No module named osp.connections
Oh I am sorry. You have run into a copy and paste mistake in the docs. It must be gvm.connections and gvm.protocols.latest. I’ve fixed the docs which should be up-to-date in some minutes.
You tried to use some code from https://python-gvm.readthedocs.io/en/latest/usage.html#using-osp
This code used a wrong module from osp.connections import UnixSocketConnection instead of from gvm.connections import UnixSocketConnection. python-gvm provides the gvm python package.
Not sure what you are doing. This is a very basic Python thing that has nothing to do with python-gvm itself. Please try to test importing gvm by opening a Python3 shell and running import gvm. If that fails your setup is incorrect.
ok, now it works. That was strange, i found out that python3.6 took another scriptfile for interpreting. Now it gets the right one. Also there was a gvm.pyc file which had to be deleted because of the ImportError: bad magic number in ‘gvm’: b’\x03\xf3\r\n’
Now i’m getting an socket error: gvm.errors.GvmError: Socket /tmp/ospd-wrapper.sock does not exist
I’ve also changed the socket-path: path=’/var/run/ospd-wrapper.sock’
But it’s the same error message which i get.
I use the UnixSocketConnection Method
I think there is more information missing like where does the socket connect to ( ipadresse, port) or is the UnixSocketConnection Method only for local systems ?
The script is not on the openvas sensor or the gsm. It has to open a connection to that systems. Thanks for helping.
If you are attempting to use /var/run/ospd-wrapper.sock, it must exist on your local system. If the error is telling you it doesn’t exist, then I can only assume that file does not exist at the path you specified.
If you want to connect to a remote host, you cannot use unix sockets.
Ok, thanks for the infos. I have another problem: I have used the “check_gmp.py” skript on my monitoring system for the GSM-Master to recall the scan-infos and tasks from the hosts. Now after the Upgrade to Version 20.0.0.8 it doesn’t work anymore. I assume that’s because the GSM-Master now uses the OSP-Protocol.
Is there any alternative to get this working again ?
Thanks for helping
Greetings
A.Zaki