Nmap Development mailing list archives
Re: -6 and mass_dns and dns.lua
From: David Fifield <david () bamsoftware com>
Date: Fri, 31 Oct 2008 19:05:52 -0600
On Fri, Oct 31, 2008 at 01:45:17AM +0000, jah wrote:
On 30/10/2008 22:44, David Fifield wrote:I think I understand now. We can factor out the code that gets a list of servers, but we should return an empty list if --system-dns is used. Does the attached patch work for you? I've tested that continues to use system DNS for IPv6 lookups, and that get_dns_servers returns a list of servers even with -6 except when --system-dns is also present. I haven't tested it with ASN.nse. The patch builds on a few refactoring commits I made that didn't change any outward behavior. The main change is moving the decision of whether to run mass_dns from NmapOps.cc to nmap_dns.cc. As you noted, having -6 control o.mass_dns created a tricky bit of ambiguity.It only works for -6 when -n is specified because if we've already done an rdns lookup and we don't have a list of dns servers when get_dns_servers() is called at script scanning time then this test fails: if(servs.size() == 0 && firstrun) {...} Also, some debugging output is incorrectly selected when -6 scans do rdns lookups and it prints out info meant for mass_dns resolving rather than system resolving:
Thanks for the testing and the good analysis. Can you give this new patch a try? It uses the idea from your patch, but I put the static variable inside init_servs rather than get_dns_servers, so that it is initialized only once between nmap_mass_rdns_core and get_dns_servers. David Fifield
Attachment:
ipv6-dns-list-2.diff
Description:
_______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://SecLists.Org
Current thread:
- -6 and mass_dns and dns.lua jah (Oct 05)
- Re: -6 and mass_dns and dns.lua jah (Oct 06)
- Re: -6 and mass_dns and dns.lua jah (Oct 07)
- Re: -6 and mass_dns and dns.lua David Fifield (Oct 19)
- Re: -6 and mass_dns and dns.lua jah (Oct 20)
- Re: -6 and mass_dns and dns.lua David Fifield (Oct 30)
- Re: -6 and mass_dns and dns.lua jah (Oct 30)
- Re: -6 and mass_dns and dns.lua David Fifield (Oct 31)
- Re: -6 and mass_dns and dns.lua jah (Oct 31)
- Re: -6 and mass_dns and dns.lua jah (Oct 07)
- Re: -6 and mass_dns and dns.lua jah (Oct 06)