Openvas_scanner_read: Failed to read from scanner: Connection reset by peer


#1

I updated from openvas-9 to GVM-10. Some (not all!) of my scans fail almost immediately with:

openvas_scanner_read: Failed to read from scanner: Connection reset by peer

Log (gvmd.log):

event task:MESSAGE:2019-05-06 11h52.17 CEST:103755: Status of task Netz Server (4b7229d1-aadd-4064-b591-cd578b760684) has changed to Requested
event task:MESSAGE:2019-05-06 11h52.17 CEST:103755: Task Netz Server (4b7229d1-aadd-4064-b591-cd578b760684) has been requested to start by admin
event task:MESSAGE:2019-05-06 11h52.26 CEST:103760: Status of task Netz Server (4b7229d1-aadd-4064-b591-cd578b760684) has changed to Running
md   main:WARNING:2019-05-06 11h52.28 CEST:103760: openvas_scanner_read: Failed to read from scanner: Connection reset by peer
event task:MESSAGE:2019-05-06 11h52.28 CEST:103760: Status of task Netz Server (4b7229d1-aadd-4064-b591-cd578b760684) has changed to Interrupted

I’m using the PPA by mrazavi on Ubuntu bionic.


#2

I recreated the target used in the scan and recreated the task itself from scratch.
Symptom is the same, but now the scanner is logging something:

sd   main:MESSAGE:2019-05-06 10h06.27 utc:110542: Starts a new scan. Target(s) :..., with max_hosts = 20 and max_checks = 4
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname 
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname 
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname 
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname 
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname 
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname 
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname 
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname (null)
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname (null)
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname (null)
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname (null)
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname (null)
base hosts:WARNING:2019-05-06 10h06.27 utc:110542: Couldn't resolve hostname 
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: SIGSEGV occurred!
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: openvassd: Serving /var/run/openvassd.sock(sighand_segv+0x47) [0x56428217ec47]
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f57d8eabf20]
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: /usr/lib/x86_64-linux-gnu/libgvm_base.so.10(gvm_hosts_resolve+0x4a) [0x7f57d9d1f08a]
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: openvassd: Serving /var/run/openvassd.sock(attack_network+0x238) [0x5642821782e8]
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: openvassd: Serving /var/run/openvassd.sock(+0xb900) [0x56428217b900]
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: openvassd: Serving /var/run/openvassd.sock(create_process+0xb7) [0x56428217e9e7]
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: openvassd: Serving /var/run/openvassd.sock(main+0x440) [0x5642821765d0]
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f57d8e8eb97]
sd   main:WARNING:2019-05-06 10h06.27 utc:110542: openvassd: Serving /var/run/openvassd.sock(_start+0x2a) [0x56428217674a]

#3

Turns out that some of the targets’ hostnames did not resolve. I sanitized the list of targets to only contain target with DNS entries and now the scan works.

Still, the scanner shouldn’t crash when given an invalid hostname as target.


#4

Hi @hildeb,

Thanks for reporting this issue. A fix should be available in the next gvm-libs minor version.


#5

Reference to the related PR: