1
0
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:
dmiller
2024-06-07 16:34:07 +00:00
parent 0671064cf9
commit f43878f0f5
3 changed files with 61 additions and 58 deletions

View File

@@ -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

View File

@@ -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