mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 16:57:06 +00:00
replaced try/catch with silent failure
This commit is contained in:
parent
e5129cf8bf
commit
b14a8518a3
1 changed files with 8 additions and 9 deletions
|
|
@ -54,17 +54,16 @@ categories = {"discovery", "safe"}
|
|||
portrule = shortport.portnumber({5353,9100}, "udp")
|
||||
|
||||
action = function( host, port )
|
||||
|
||||
|
||||
local catch = function()
|
||||
stdnse.print_debug("lexmark-config failed to retrieve configuration")
|
||||
end
|
||||
|
||||
local try = nmap.new_try(catch)
|
||||
|
||||
local result = {}
|
||||
local response = try( dns.query( "", { port = port.number, host = host.ip, dtype="PTR", retPkt=true} ) )
|
||||
local txtrecords = try( dns.findNiceAnswer( dns.types.TXT, response, true ) )
|
||||
local status, response = dns.query( "", { port = port.number, host = host.ip, dtype="PTR", retPkt=true} )
|
||||
if ( not(status) ) then
|
||||
return
|
||||
end
|
||||
local status, txtrecords = dns.findNiceAnswer( dns.types.TXT, response, true )
|
||||
if ( not(status) ) then
|
||||
return
|
||||
end
|
||||
|
||||
for _, v in ipairs( txtrecords ) do
|
||||
if ( v:len() > 0 ) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue