Nmap Development mailing list archives
Re: [nmap-svn] r24784 - in nmap-exp/weilin/nmap-nd: . libdnet-stripped/include/dnet libdnet-stripped/src libnetutil
From: Djalal Harouni <tixxdz () opendz org>
Date: Wed, 20 Jul 2011 12:01:12 +0100
On Sun, Jul 10, 2011 at 09:49:00AM -0700, David Fifield wrote:
Weilin, I think this might be wrong. Unless I'm mistaken, libdnet is already getting IPv6 addresses for interfaces. You can see them with "nmap --iflist". I think they are typically stored in the intf_alias_addrs member. What might be the problem is that getInterfaceByName returns only the first matching interface, which only has a single (usually IPv4) address.
David, what do you think if we change the getInterfaceByName(), we can add a second argument that will take the address family type ? in order to return the correct interface information. getInterfaceByName() is used in libnetutil/netutil.cc: route_dst_netlink() function. route_dst_generic() function.
The problem might just be that the NSE code doesn't look far enough into the alias list. If you call nmap.list_interfaces, do you see the interfaces with IPv6 addresses?
If we do not change getInterfaceByName() behaviour we can improve the NSE code, define nmap.list_interfaces() in nse_dnet.cc file instead of nse_nmaplib.cc (of course register it in nse_nmaplib.cc), this way nmap.get_interface_info() will simply call list_interfaces() which will *construct* all the interfaces informations for us, iterate over it and return the appropriate interface information table according to the current address family type. I just found that dnet:ethernet_open() function which is registred in nse_dnet.cc file and loaded in nse_nmaplib.cc file also calls getInterfaceByName(), this is another bug, which confirms that we must update getInterfaceByName() function. -- tixxdz http://opendz.org _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- Re: [nmap-svn] r24784 - in nmap-exp/weilin/nmap-nd: . libdnet-stripped/include/dnet libdnet-stripped/src libnetutil David Fifield (Jul 10)
- Re: [nmap-svn] r24784 - in nmap-exp/weilin/nmap-nd: . libdnet-stripped/include/dnet libdnet-stripped/src libnetutil Djalal Harouni (Jul 20)