Nmap Development mailing list archives

Re: dns-ip6-arpa-scan


From: david <david () bamsoftware com>
Date: Sat, 4 May 2013 09:29:44 -0700

On Sat, May 04, 2013 at 01:52:37PM +0530, Indula Nayanamith wrote:
Sorry my mistake :(
command should be

nmap -v --script dns-ip6-arpa-scan --script-args=prefix=2a01:238:42a8::/48

i have attached the patch file

There is a problem with the files you are sending. You have saved them
with Windows CRLF line endings, so in the diff it makes it look like the
entire file has been deleted and re-added. I managed to fix it, but you
should try to get your editor not to change line endings.

diff --git a/scripts/dns-ip6-arpa-scan.nse b/scripts/dns-ip6-arpa-scan.nse
index 580c554..b899424 100644
--- a/scripts/dns-ip6-arpa-scan.nse
+++ b/scripts/dns-ip6-arpa-scan.nse
@@ -20,7 +20,7 @@ http://7bits.nl/blog/2012/03/26/finding-v6-hosts-by-efficiently-mapping-ip6-arpa

 ---
 -- @usage
--- nmap --script dns-ip6-arpa-scan --script-args='prefix=2001:0DB8,mask=48'
+-- nmap --script dns-ip6-arpa-scan --script-args=prefix=2a01:238:42a8::/48
 --
 -- @output
 -- Pre-scan script results:
@@ -36,10 +36,11 @@ author = "Patrik Karlsson"
 license = "Same as Nmap--See http://nmap.org/book/man-legal.html";
 categories = {"intrusive", "discovery"}

+local prefix = stdnse.get_script_args(SCRIPT_NAME .. ".prefix")
+local spoint = string.find(prefix,'/')

-local arg_prefix = stdnse.get_script_args(SCRIPT_NAME .. ".prefix")
-local arg_mask = stdnse.get_script_args(SCRIPT_NAME .. ".mask")
-
+local arg_mask = string.sub(prefix,spoint+1,-1)
+local arg_prefix = string.sub(prefix,1,spoint-1)
 prerule = function() return (arg_prefix ~= nil and arg_mask ~= nil) end

 local function query_prefix(query, result)

This change is fine as far as it goes, but you must not break backwards
compatibility. The "prefix" and "mask" arguments must continue to work
as before. You can check for the presence of '/' and a mask in the
"prefix" argument, and if present make the "mask" argument optional, or
you can think of a new name for the argument taking the '/' that is
different from "prefix" and "mask".

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


Current thread: