mirror of
https://github.com/nmap/nmap.git
synced 2025-12-17 13:09:02 +00:00
Remove redundant "Result:" label from dns-brute.nse output. Use the
"name" feature of format_output instead of inserting putative data rows for labels.
This commit is contained in:
@@ -15,8 +15,7 @@ Attempts to enumerate DNS hostnames by brute force guessing.
|
|||||||
-- @output
|
-- @output
|
||||||
-- Pre-scan script results:
|
-- Pre-scan script results:
|
||||||
-- | dns-brute:
|
-- | dns-brute:
|
||||||
-- | Result:
|
-- | DNS Brute-force hostnames
|
||||||
-- | DNS Brute-force hostnames:
|
|
||||||
-- | www.foo.com - 127.0.0.1
|
-- | www.foo.com - 127.0.0.1
|
||||||
-- | mail.foo.com - 127.0.0.2
|
-- | mail.foo.com - 127.0.0.2
|
||||||
-- | blog.foo.com - 127.0.1.3
|
-- | blog.foo.com - 127.0.1.3
|
||||||
@@ -252,22 +251,25 @@ action = function(host)
|
|||||||
end
|
end
|
||||||
|
|
||||||
response = {}
|
response = {}
|
||||||
response['name'] = "Result:"
|
t_dns = {}
|
||||||
table.insert(response,"DNS Brute-force hostnames:")
|
t_dns['name'] = "DNS Brute-force hostnames"
|
||||||
if(#results==0) then
|
if(#results==0) then
|
||||||
table.insert(response,"No results.")
|
table.insert(t_dns,"No results.")
|
||||||
end
|
end
|
||||||
for _, res in ipairs(results) do
|
for _, res in ipairs(results) do
|
||||||
table.insert(response, res['hostname'].." - "..res['address'])
|
table.insert(t_dns, res['hostname'].." - "..res['address'])
|
||||||
end
|
end
|
||||||
|
response[#response + 1] = t_dns
|
||||||
if(dosrv) then
|
if(dosrv) then
|
||||||
table.insert(response,"SRV results:")
|
t_srv = {}
|
||||||
|
t_srv['name'] = "SRV results"
|
||||||
if(#srvresults==0) then
|
if(#srvresults==0) then
|
||||||
table.insert(response,"No results.")
|
table.insert(t_srv,"No results.")
|
||||||
end
|
end
|
||||||
for _, res in ipairs(srvresults) do
|
for _, res in ipairs(srvresults) do
|
||||||
table.insert(response, res['hostname'].." - "..res['address'])
|
table.insert(t_srv, res['hostname'].." - "..res['address'])
|
||||||
end
|
end
|
||||||
|
response[#response + 1] = t_srv
|
||||||
end
|
end
|
||||||
return stdnse.format_output(true, response)
|
return stdnse.format_output(true, response)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user