greenbone / gvmd

Greenbone Vulnerability Manager - The database backend for the Greenbone Community Edition
GNU Affero General Public License v3.0
286 stars 153 forks source link

Could not connect to scanner on Kali 2024.1(Virtual Box) #2246

Closed Bosson015 closed 4 months ago

Bosson015 commented 4 months ago

Expected behavior

After installing gvm and subsequent configuration using the gvm-setup script and checking using gvm-chek-setup, I got a positive result. I went to the Greenbone web interface. I checked Feed status, everything was OK. You can start a test scan.

Actual behavior

I created a task via Scans--->Tasks--->Task Wizard to quickly create a task. To my regret, I received a 0% interrupt with the error Could not connect to Scanner.

error

I checked the Scanner on the web interface via Configuration--->Scanners--->Verify Scanner and got this...

error2

In the gvmd.log file I noticed that the scanner is accessing a socket called ospd-openvas.sock. Having checked the directory /run/ospd/, I found that the socket file names did not match between the actual value of the name and the name in the log file.

logfile 2024-07-01_22-25-47

The solution is as follows...

Steps to reproduce

  1. Go to the /run/ospd/ directory cd /run/ospd

  2. Rename the socket file mv ospd.sock ospd-openvas.sock

  3. Next, edit the configuration file ospd-openvas.conf. This is necessary because after the first two steps the scanning started, but after receiving the Running status it ended with an error. In the log file gvmd.log I found that the Scanner now wants to connect to a socket named ospd.sock, that is, by the old name. Therefore, open the /etc/gvm/ospd-openvas.conf file with any editor and change the unix_socket line as in the screenshot confFile

  4. If gvm was running before, then stop it gvm-stop

  5. Be sure to restart the computer in any case, even if gvm was not running

  6. I hope, like me, after the work done, you will get a positive result like here fix1

fix2

GVM versions

gsa: Greenbone Security Assistant 22.9.1~git

gvm: Greenbone Vulnerability Manager 23.6.2

openvas-scanner: OpenVAS 23.4.1

gvm-libs: 22.10.0

Environment

Operating system: Linux kali 6.6.15-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.15-2kali1 (2024-05-17) x86_64 GNU/Linux

Installation method / source: (packages, source installation) apt-get install gvm

Logfiles

cfi-gb commented 4 months ago

@Bosson015 Kali packages as well as gvm-check-setup and gvm-setup are not provided / maintained by Greenbone. Could you thus please close this issue and raise a new one over here for the Kali maintainers: https://bugs.kali.org

cfi-gb commented 4 months ago

Refs to the relevant Bug reports: