Nmap Development mailing list archives

Re: No results from asn-query.nse


From: Daniel Miller <bonsaiviking () gmail com>
Date: Tue, 6 Jun 2023 10:12:38 -0500

Mike,

Thanks for this fix! I committed a slightly smaller diff in r38705 and
credited you. This bug had been in here since 2018, so I added some tests
to dns.lua to catch similar issues in the future.

Dan

On Sun, Jun 4, 2023 at 6:26 PM Mike Pattrick <mkp () redhat com> wrote:

Restore TXT record decoding in nselib.dns
---
 nselib/dns.lua | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/nselib/dns.lua b/nselib/dns.lua
index ba00d0aec..c32e741fe 100644
--- a/nselib/dns.lua
+++ b/nselib/dns.lua
@@ -1169,8 +1169,10 @@ function (entry, data, pos)
     entry.TXT.text = {}
   end

-  while np < len do
-    txt, np = string.unpack("s1", data, np)
+  while len > 0 do
+    txt_len, np = string.unpack(">B", data, np)
+    txt, np = string.unpack("c" .. txt_len, data, np)
+    len = len - txt_len - 1
     table.insert( entry.TXT.text, txt )
   end

--
2.31.1

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at https://seclists.org/nmap-dev/

_______________________________________________
Sent through the dev mailing list
https://nmap.org/mailman/listinfo/dev
Archived at https://seclists.org/nmap-dev/

Current thread: