Yes, that makes the problem go away, but my bigger concern is that hung scripts 
are not terminated on OpenVAS 8 based on the plugins_timeout value.

I tried (using the original script) with 2 other instances of OpenVAS 7, and 
they both timed out after 320 seconds, which is what I would expect given the 
"plugins_timeout" value.  I don't know why I got 120 seconds before.

The attached .c file demonstrates this.  Just build and run it on your target 
and run a full and fast scan.  (Restart after each scan -- it doesn't reap its 
zombies).  It simulates the behavior of the service that confused the script (a 
port used by Logitech Media Server).

-----Original Message-----
From: Openvas-discuss [mailto:[email protected]] On 
Behalf Of Michael Meyer
Sent: Wednesday, April 15, 2015 10:24 AM
To: [email protected]
Subject: Re: [Openvas-discuss] OpenVAS 8: scans not finishing

*** Kent Fritz wrote:

> More information:: In response to the probe "0x00, 0x00,0x27, 0x29",
> the port in question returns "0x00, 0x00", which is less than the
> minimum of 4 bytes requested by the script.  If I run the script
> alone: # openvas-nasl -X -t <target> -d gb_sap_router_detect.nasl And,
> on the target, I run:
> $ ncat -kl 3299
> Then the script times out after 5 seconds.  But if I press  "enter"
> on ncat when probed, the script hangs forever.  I think this is
> expected.
>
> When running from OpenVAS 7/Greenbone using the "Full and fast"
> configuration, the TCP connection is terminated after 120 seconds.
> I don't know why this times out -- the "plugins_timeout" is 320
> seconds.
>
> When running on OpenVAS 8, it never times out, and needs to be stopped 
> manually.
>
> I have tcpdumps of both scans, but it doesn't tell much beyond the
> above.  I'll see if I can find a simple way to reproduce this.

Does it help to change:

buf = recv( socket:soc, min:4, length:4 );

to

buf = recv( socket:soc, length:4 );
if( strlen( buf ) < 4 ) exit( 0 );

?

Micha

--
Michael Meyer                  OpenPGP Key: 0xAF069E9152A6EFA6
http://www.greenbone.net/
Greenbone Networks GmbH, Neuer Graben 17, 49074 Osnabrück | AG Osnabrück, HR B 
202460
Geschäftsführer: Lukas Grunwald, Dr. Jan-Oliver Wagner 
_______________________________________________
Openvas-discuss mailing list
[email protected]
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss

________________________________

This e-mail and any attachments are confidential. If it is not intended for 
you, please notify the sender, and please erase and ignore the contents.

Attachment: scanstop.c.gz
Description: scanstop.c.gz

_______________________________________________
Openvas-discuss mailing list
[email protected]
https://lists.wald.intevation.org/cgi-bin/mailman/listinfo/openvas-discuss

Reply via email to