mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Change the "name" member of a decoded NSEC record to be called
"next_dname" instead.
This commit is contained in:
@@ -980,7 +980,7 @@ end
|
||||
-- section 4.
|
||||
--
|
||||
-- <code>entry.NSEC</code> has the fields <code>dname</code>,
|
||||
-- <code>name</code>, and <code>types</code>.
|
||||
-- <code>next_dname</code>, and <code>types</code>.
|
||||
-- @param entry RR in packet.
|
||||
-- @param data Complete encoded DNS packet.
|
||||
-- @param pos Position in packet after RR.
|
||||
@@ -989,7 +989,7 @@ decoder[types.NSEC] = function (entry, data, pos)
|
||||
local block_num, type_bitmap
|
||||
entry.NSEC = {}
|
||||
entry.NSEC.dname = entry.dname
|
||||
np, entry.NSEC.name = decStr(data, np)
|
||||
np, entry.NSEC.next_dname = decStr(data, np)
|
||||
np, block_num, type_bitmap = bin.unpack(">Cp", data, np)
|
||||
entry.NSEC.types = {}
|
||||
for i in bit_iter(type_bitmap) do
|
||||
|
||||
@@ -268,10 +268,10 @@ end
|
||||
local function get_next_nsec(retPkt, domain)
|
||||
for _, nsec in ipairs(auth_filter(retPkt, "NSEC")) do
|
||||
-- The last NSEC record points backwards to the start of the subzone.
|
||||
if domain_lt(nsec.dname, domain) and not domain_lt(nsec.dname, nsec.name) then
|
||||
if domain_lt(nsec.dname, domain) and not domain_lt(nsec.dname, nsec.next_dname) then
|
||||
return nsec
|
||||
end
|
||||
if domain_lt(nsec.dname, domain) and domain_lt(domain, nsec.name) then
|
||||
if domain_lt(nsec.dname, domain) and domain_lt(domain, nsec.next_dname) then
|
||||
return nsec
|
||||
end
|
||||
end
|
||||
@@ -303,9 +303,9 @@ local function enum(host, port, domain)
|
||||
subdomain = nil
|
||||
break
|
||||
end
|
||||
last, remainder = remove_suffix(nsec.name, domain)
|
||||
last, remainder = remove_suffix(nsec.next_dname, domain)
|
||||
if #remainder > 0 then
|
||||
stdnse.print_debug("Result name %q doesn't end in %q.", nsec.name, domain)
|
||||
stdnse.print_debug("Result name %q doesn't end in %q.", nsec.next_dname, domain)
|
||||
subdomain = nil
|
||||
break
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user