mirror of
https://github.com/nmap/nmap.git
synced 2025-12-30 19:39:07 +00:00
Use dns.decStr in dns-zone-transfer.nse instead of a custom DNS decoder. This
avoids an infinite recursion bug present in the old decoder. I raised the number of compression pointers that dns.decStr will follow from 1 to 3 because I found a server that sent 2.
This commit is contained in:
@@ -479,14 +479,14 @@ end
|
||||
-- @param pos Starting position in packet.
|
||||
-- @return Position after decoding.
|
||||
-- @return Decoded domain, or <code>nil</code> on error.
|
||||
local function decStr(data, pos)
|
||||
function decStr(data, pos)
|
||||
local function dec(data, pos, limit)
|
||||
local partlen
|
||||
local parts = {}
|
||||
local part
|
||||
|
||||
-- Avoid infinite recursion on malformed compressed messages.
|
||||
limit = limit or 1
|
||||
limit = limit or 3
|
||||
if limit < 0 then
|
||||
return pos, nil
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user