1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 03:49:01 +00:00

Fix DNS TXT record parsing

This commit is contained in:
dmiller
2023-06-06 15:10:48 +00:00
parent 4a4253cc95
commit 9adda8c0f3
2 changed files with 6 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
#Nmap Changelog ($Id$); -*-text-*-
o [NSE] Fixed DNS TXT record parsing which caused asn-query to fail in Nmap
7.80 and later. [David Fifield, Mike Pattrick]
Nmap 7.94 [2023-05-19]
o Zenmap and Ndiff now use Python 3! Thanks to the many contributors who made

View File

@@ -1160,9 +1160,8 @@ decoder[types.PTR] = decDomain
decoder[types.TXT] =
function (entry, data, pos)
local len = entry.data:len()
local np = pos - #entry.data
local txt_len
local len = #entry.data
local np = pos - len
local txt
if len > 0 then
@@ -1170,7 +1169,7 @@ function (entry, data, pos)
entry.TXT.text = {}
end
while np < len do
while np < pos do
txt, np = string.unpack("s1", data, np)
table.insert( entry.TXT.text, txt )
end