mirror of
https://github.com/nmap/nmap.git
synced 2025-12-15 12:19:02 +00:00
Patch to firewalk.nse from Henri Doreau; avoids an error when giving a
timespec.
This commit is contained in:
@@ -337,6 +337,18 @@ local function setregs(host, ports)
|
||||
|
||||
end
|
||||
|
||||
--- wrapper for stdnse.parse_timespec() to get specified value in milliseconds
|
||||
-- @param spec the time specification string (like "10s", "120ms"...)
|
||||
-- @return the equivalent number of milliseconds or nil on failure
|
||||
local function parse_timespec_ms(spec)
|
||||
local t = stdnse.parse_timespec(spec)
|
||||
if t then
|
||||
return t * 1000
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
--- set scan parameters using user values if specified or defaults otherwise
|
||||
local function getopts()
|
||||
|
||||
@@ -804,18 +816,6 @@ local function generate_initial_probes(scanner)
|
||||
end
|
||||
end
|
||||
|
||||
--- wrapper for stdnse.parse_timespec() to get specified value in milliseconds
|
||||
-- @param spec the time specification string (like "10s", "120ms"...)
|
||||
-- @return the equivalent number of milliseconds or nil on failure
|
||||
local function parse_timespec_ms(spec)
|
||||
local t = stdnse.parse_timespec(spec)
|
||||
if t then
|
||||
return t * 1000
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
--- firewalk entry point
|
||||
action = function(host)
|
||||
local saddr = packet.toip(host.bin_ip_src)
|
||||
|
||||
Reference in New Issue
Block a user