Probably would be good to understand and handle the logic in the nasl
scripts that still rely on the "default" values...

hm, which ones are these?



nmap.nasl, amap.nasl, portbunny.nasl, portscan-strobe.nasl, pnscan.nasl

In short, after you dig through code, it seems with a setting of
default, invoking scanner_get_ports eventually finds it's way to
the "getpts" function call, to get_tcp_svcs, which reads the
openvas file /usr/local/var/lib/openvas/services.tcp, specifically
to be able to get a list of ports.

So there's still a whole bunch of infrastructure, afaik, that is
designed to support the concept of a 'default' scan, which would
appear to be controlled by what is defined in these files.

nmap.nasl:
 port_range = get_preference("port_range");
 if (port_range) # Null for command line tests only
 {
  argv[i++] = "-p";
  if (port_range == "default" )
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  {
   n = 0;
   str = "";


amap.nasl:
 pr = get_preference("port_range");

 if (! pr) pr = "1-65535";

  if (pr == "default" )
     ^^^^^^^^^^^^^^^^^^
  {
   n = 0;
   pr = "";

portbunny.nasl:
argv[i++] = ip;
 pr = get_preference("port_range");
 if (! pr) pr = "1-65535";
 if (pr == "default" )
 {
         n = 0;
         str = "";


portscan-strobe.nasl:
prange = get_preference("port_range");
if (! prange) prange = "1-65535";
if (prange == "default" )
{
        n = 0;
        str = "";
        while ( port = scanner_get_port(n) )
        {
                if ( n > 0 ) str += "," + string(port);
                else str = string(port);
                n ++;
        }
        prange=str;

pnscan.nasl:
prange = get_preference("port_range");
if (! prange) prange = "1-65535";
if (prange == "default" )
{
        n = 0;
        str = "";
        while ( port = scanner_get_port(n) )


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

Reply via email to