mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
Update smb-os-discovery to use structured output
This commit is contained in:
parent
6e57ab9606
commit
e11a5a7b34
1 changed files with 3 additions and 5 deletions
|
|
@ -89,13 +89,11 @@ function add_to_output(output_table, label, value, value_if_nil)
|
|||
value = value_if_nil
|
||||
end
|
||||
|
||||
if (value ~= nil) then
|
||||
table.insert(output_table, string.format("%s: %s", label, value) )
|
||||
end
|
||||
output_table[label] = value
|
||||
end
|
||||
|
||||
action = function(host)
|
||||
local response = {}
|
||||
local response = stdnse.output_table()
|
||||
local status, result = smb.get_os(host)
|
||||
|
||||
if(status == false) then
|
||||
|
|
@ -140,7 +138,7 @@ action = function(host)
|
|||
|
||||
add_to_output( response, "System time", time_string, "Unknown" )
|
||||
|
||||
return stdnse.format_output(true, response)
|
||||
return response
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue