mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Update dnssd.lua and related scripts
* Structured output * Fix adding new targets: was adding the multicast address, not the discovered unicast address. * Extract service name and host name from responses * broadcast-dns-service-discovery now lists services under each unicast address instead of under the single multicast/broadcast address.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
local dnssd = require "dnssd"
|
||||
local stdnse = require "stdnse"
|
||||
local oops = require "oops"
|
||||
|
||||
description=[[
|
||||
Attempts to discover hosts' services using the DNS Service Discovery protocol. It sends a multicast DNS-SD query and collects all the responses.
|
||||
@@ -50,8 +51,5 @@ action = function()
|
||||
local helper = dnssd.Helper:new( )
|
||||
helper:setMulticast(true)
|
||||
|
||||
local status, result = helper:queryServices()
|
||||
if ( status ) then
|
||||
return stdnse.format_output(true, result)
|
||||
end
|
||||
oops.output(helper:queryServices())
|
||||
end
|
||||
|
||||
@@ -61,7 +61,7 @@ action = function(host, port)
|
||||
if ( status ) then
|
||||
-- set port to open
|
||||
nmap.set_port_state(host, port, "open")
|
||||
return stdnse.format_output(true, result)
|
||||
return result
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user