mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 17:09:02 +00:00
With debugging, NSE prints out the script-args string and the pretty printed
final script-args table. The rationale is, unfortunately shells interpret quotes differently and so it can be hard to tell exactly what NSE ends up seeing/producing. [Some discussion in #nmap on Freenode resulted in this addition.]
This commit is contained in:
@@ -1152,6 +1152,7 @@ end
|
||||
|
||||
do -- Load script arguments (--script-args)
|
||||
local args = cnse.scriptargs or "";
|
||||
print_debug(1, "Script Arguments seen from CLI: %s", args);
|
||||
|
||||
-- Parse a string in 'str' at 'start'.
|
||||
local function parse_string (str, start)
|
||||
@@ -1224,6 +1225,11 @@ do -- Load script arguments (--script-args)
|
||||
end
|
||||
nmap.registry.args = tmpargs
|
||||
end
|
||||
if debugging() >= 2 then
|
||||
local out = {}
|
||||
rawget(stdnse, "pretty_printer")(nmap.registry.args, function (s) out[#out+1] = s end)
|
||||
print_debug(2, concat(out))
|
||||
end
|
||||
end
|
||||
|
||||
-- Update Missing Script Database?
|
||||
|
||||
Reference in New Issue
Block a user