Nmap Development mailing list archives

Re: No results from asn-query.nse


From: David Fifield <david () bamsoftware com>
Date: Sun, 4 Jun 2023 22:53:58 -0600

Thanks, this patch works for me.

On Sun, Jun 04, 2023 at 06:40:24PM -0400, Mike Pattrick 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/


Current thread: