Nmap Development mailing list archives

RE: [NSE] nmap timing info for scripts


From: "Thomas Buchanan" <TBuchanan () thecompassgrp net>
Date: Thu, 10 Jan 2008 14:14:09 -0600

-----Original Message-----
From: nmap-dev-bounces () insecure org 
[mailto:nmap-dev-bounces () insecure org] On Behalf Of Eddie Bell
Sent: Thursday, January 10, 2008 1:59 PM
To: nmap-dev () insecure org
Cc: Thomas Buchanan
Subject: Re: [NSE] nmap timing info for scripts

Just hacked this up. Maybe we could add it to stdnes.lua along with
Thomas's patch. At least this way script could be uniform in their
timing policies with an option to deviate if needed.

-- Get standard timeout duration based on nmap's current timing level
-- Duration ranges from 20 seconds for T0 to 1 second for T5
function get_timeout()
        t = { 20000, 15000, 10000, 5000, 3000, 1000 }
        return t[nmap.timing()+1]
end

Called like this

sock:set_timeout(stdnse.get_timeout())

- eddie


This seems like a good idea to me.  Another thought I had regarding
timing was the ability to wait between socket connect attempts.  Lua
doesn't seem to have a built-in sleep() function, as far as I can tell.
Would there be value in adding something like that to the nmap NSE
library?

Thomas

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: