1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-04 05:39:01 +00:00

o [NSE] Added a "times" table to the host table passed to scripts.

This table contains Nmap's timing data (srtt, the smoothed round
  trip time; rttvar, the rtt variance; and timeout), all represented
  as floating-point seconds.  The ipidseq and qscan scripts were
  updated to utilize the host's timeout value instead of the very
  conservative guess of 3 seconds for read timeouts. [Kris]
This commit is contained in:
kris
2010-08-05 01:55:05 +00:00
parent 02e612c596
commit 412fcbcca0
5 changed files with 34 additions and 2 deletions

View File

@@ -224,7 +224,7 @@ action = function(host)
pcap:pcap_open(host.interface, 104, 0, callback, "tcp and dst host " .. saddr .. " and src host " .. daddr .. " and src port " .. port)
pcap:set_timeout(3000)
pcap:set_timeout(host.times.timeout * 1000)
local tcp = genericpkt(host, port)

View File

@@ -382,7 +382,13 @@ action = function(host)
try = nmap.new_try(function() sock:ip_close() end)
pcap:set_timeout(3000)
-- Simply double the calculated host timeout to account for possible
-- extra time due to port forwarding or whathaveyou. Nmap has all
-- ready scanned this host, so the timing should have taken into
-- account some of the RTT differences, but I think it really depends
-- on how many ports were scanned and how many were forwarded where.
-- Play it safer here.
pcap:set_timeout(2 * host.times.timeout * 1000)
local tcp = genericpkt(host)