
Nmap Development mailing list archives
Re: dns-ip6-arpa-scan
From: Indula Nayanamith <indula.mrt () gmail com>
Date: Sun, 5 May 2013 16:16:40 +0530
thanks for the feedback i change the code and this will check for "/" and if it is given will not take "mask" argument both syntax will work nmap -v --script dns-ip6-arpa-scan --script-args=prefix=2a01:238:42a8::/48 nmap -v --script dns-ip6-arpa-scan --script-args=prefix=2a01:238:42a8::,mask=48 i have attached the patch On Sat, May 4, 2013 at 9:59 PM, david <david () bamsoftware com> wrote:
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::/48i have attached the patch fileThere 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.nseb/scripts/dns-ip6-arpa-scan.nseindex 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
-- Regards, Indula
Attachment:
dns-ipv6-arpa-scan.patch
Description:
_______________________________________________ Sent through the dev mailing list http://nmap.org/mailman/listinfo/dev Archived at http://seclists.org/nmap-dev/
Current thread:
- dns-ip6-arpa-scan Indula Nayanamith (May 03)
- Re: dns-ip6-arpa-scan David Fifield (May 03)
- Re: dns-ip6-arpa-scan Indula Nayanamith (May 03)
- Re: dns-ip6-arpa-scan David Fifield (May 03)
- Re: dns-ip6-arpa-scan Indula Nayanamith (May 03)
- Re: dns-ip6-arpa-scan Dario Ciccarone (May 03)
- Re: dns-ip6-arpa-scan Indula Nayanamith (May 04)
- Re: dns-ip6-arpa-scan david (May 04)
- Re: dns-ip6-arpa-scan Indula Nayanamith (May 05)
- Re: dns-ip6-arpa-scan David Fifield (Jun 12)
- Re: dns-ip6-arpa-scan Indula Nayanamith (May 03)
- Re: dns-ip6-arpa-scan David Fifield (May 03)