Nmap Development mailing list archives

Re: -6 and mass_dns and dns.lua


From: David Fifield <david () bamsoftware com>
Date: Sun, 19 Oct 2008 20:57:22 -0600

On Tue, Oct 07, 2008 at 04:05:03PM +0100, jah wrote:
Hi folks,

The attached patches nmapOps.cc and nmap_dns.cc:

o.mass_dns is not set to false for IPv6 targets.

system dns resolution is skipped for IPv6 targets when nmap_mass_rdns()
is called with zero num_targets allowing dns servers to be obtained from
the windows registry or /etc/resolv.conf if the dns servers aren't
already known (servs.size() is zero).  After doing this the function
returns immediately and without proceeding to /etc/hosts lookup etc.

--system-dns is respected.

Thanks for your observation, insightful as usual. This is certainly a
problem (may be considered a bug).

I don't like the way this patch solves the problem. There is too much
special casing on o.af() != AF_INET6, when the basic problem of getting
a list of the system's DNS only depends on being able to read
/etc/resolv.conf and /etc/hosts, not on the address family.

I would prefer to see the code that reads o.dns_servers and
/etc/resolv.conf (or the Windows registry) factored out into its own
function. That function, which would be independent of -n and -6, would
be called by nmap_mass_rdns_core and get_dns_servers. How does that
sound? Or if I'm off base and missing something obvious, just tell me.

David Fifield

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: