From 80605e3e09645a844c18b58378069b1187e7b1da Mon Sep 17 00:00:00 2001 From: david Date: Tue, 2 Nov 2010 19:03:35 +0000 Subject: [PATCH] In firewalk.nse, bail out if we have neither of the scripts args firewalk.ttl and firewalk.gateway. Otherwise we would get a nil dereference when running with --script=firewalk --traceroute Ron reported this. --- scripts/firewalk.nse | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/firewalk.nse b/scripts/firewalk.nse index 94e04109d..b5ed24352 100644 --- a/scripts/firewalk.nse +++ b/scripts/firewalk.nse @@ -259,6 +259,13 @@ local function ttlmetric(host) -- if no ttl is supplied, the script requires the gateway IP address and the -- nmap traceroute resutls to find out the tt value to use local gateway = stdnse.get_script_args("firewalk.gateway") + if not gateway then + if nmap.verbosity() > 0 then + nmap.log_write("stdout", "FIREWALK: can't run without one of the script args firewalk.gateway or firewalk.ttl") + return nil + end + end + if not host.traceroute then if not nmap.registry['firewalk'] then nmap.registry['firewalk'] = {}