Nmap Development mailing list archives

Re: [NSE] nmap timing info for scripts


From: "Eddie Bell" <ejlbell () gmail com>
Date: Thu, 10 Jan 2008 19:58:30 +0000

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

On 10/01/2008, Kris Katterjohn <katterjohn () gmail com> wrote:
Thomas Buchanan wrote:
Here is a quick little patch that exposes the nmap timing option to NSE
scripts.  A call to nmap.timing() will return a value of 0 - 5
corresponding to the nmap command line option -T0 through -T5
("Paranoid", "Sneaky", "Polite", "Normal", "Aggressive", "Insane").
Patch tested on Windows XP and Linux.

My thought in adding this is that scripts may want to adjust socket
timeout values (or other timing variables) based on the timing profile
selected by the user.  For example, a user that sets -T2 may be willing
to wait 20 or 30 seconds for a socket connect call to timeout, but a
user that sets -T5 probably wants to get things done a little quicker.

As always, questions or comments are welcome.


I think that's a great idea!

Thomas


Thanks,
Kris Katterjohn

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


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


Current thread: