script_dependencie() problem

From: Matt (mrburnsat_private)
Date: Fri Feb 28 2003 - 07:25:52 PST

  • Next message: Renaud Deraison: "Re: script_dependencie() problem"

    I wrote a plugin to detect the presence of an AnalogX FTP proxy.  It works
    by checking for an ftp banner left in the KB by find_services.nes.  The
    relevant section of code looks like this:
    
    if(description)
    {
        ... snip ...
        script_dependencie("find_services.nes");
        script_require_keys("Services/ftp");
        exit(0);
    }
    
    port = get_kb_item("Services/ftp");
    if (port)
    {
            banner = get_kb_item(string("ftp/banner/", port));
            if(" FTP AnalogX Proxy " >< banner)
            {
                    security_hole(port:port, data:"AnalogX FTP proxy detected");
            }
    }
    
    I know find_services.nes is leaving the banner in the right spot because I
    can see it in the KB file:
    
    1046382383 1 Services/ftp=31641
    1046382383 1 ftp/banner/31641=220 X.X.X.X FTP AnalogX Proxy 4.12 (Release)
    ready\r
    
    Some debugging shows that both the "Services/ftp" and "ftp/banner/<port>"
    keys are empty at the time the script runs.  Checking the messages file, I
    see that the AnalogX plugin is running before find_services.nes is finished:
    
    [Fri Feb 28 10:17:47 2003][98564] user user_name starts a new attack.
    Target(s) : X.X.X.X, with max_hosts = 16 and max_checks = 10
    [Fri Feb 28 10:17:47 2003][98564] user user_name : testing X.X.X.X [98571]
    [Fri Feb 28 10:17:47 2003][98571] user user_name : new KB will be saved as
    /usr/local/var/nessus/users/user_name/kbs/X.X.X.X
    [Fri Feb 28 10:17:47 2003][98571] user user_name : launching
    nmap_wrapper.nes against X.X.X.X [98572]
    [Fri Feb 28 10:17:47 2003][98571] nmap_wrapper.nes (process 98572) finished
    its job in 0.300 seconds
    [Fri Feb 28 10:17:48 2003][98571] user user_name : launching
    find_service.nes against X.X.X.X [98574]
    [Fri Feb 28 10:17:48 2003][98571] user user_name : launching
    analogx_ftp_proxy.nasl against X.X.X.X [98576]
    [Fri Feb 28 10:17:48 2003][98571] analogx_ftp_proxy.nasl (process 98576)
    finished its job in 0.018 seconds
    [Fri Feb 28 10:18:15 2003][98571] find_service.nes (process 98574) finished
    its job in 27.820 seconds
    
    Shouldn't the 'script_dependencie("find_services.nes")' ensure that my
    plugin doesn't run until find_services.nes is done?  If not, how can I make
    that the case?
    
    - Matt
    



    This archive was generated by hypermail 2b30 : Fri Feb 28 2003 - 07:25:45 PST