Nmap Development mailing list archives

Re: [nmap-svn] r24784 - in nmap-exp/weilin/nmap-nd: . libdnet-stripped/include/dnet libdnet-stripped/src libnetutil


From: Gorjan Petrovski <mogi57 () gmail com>
Date: Mon, 11 Jul 2011 11:00:55 +0200

I think you need to update your working repository. :-)
And as far as Patrik Karlsson said, nmap.list_interfaces() does return
IPv6 interfaces. I wrote that function, and it returns all the
interfaces that nmap --iflist returns.

Hope this helps,
Gorjan

On Mon, Jul 11, 2011 at 10:22 AM, Xu Weilin <mzweilin () gmail com> wrote:
On Mon, Jul 11, 2011 at 12:49 AM, David Fifield <david () bamsoftware com>wrote:

On Sun, Jul 10, 2011 at 05:36:03AM -0700, commit-mailer@insecure.orgwrote:
Author: weilin
Date: Sun Jul 10 05:36:02 2011
New Revision: 24784

Log:
nmap.get_interface_info() will give IPv6 address. If no address of global
scope is found, it gives a link-local IPv6 address.

Modified:
   nmap-exp/weilin/nmap-nd/libdnet-stripped/include/dnet/intf.h
   nmap-exp/weilin/nmap-nd/libdnet-stripped/src/intf.c
   nmap-exp/weilin/nmap-nd/libnetutil/netutil.cc
   nmap-exp/weilin/nmap-nd/libnetutil/netutil.h
   nmap-exp/weilin/nmap-nd/nse_dnet.cc

Modified: nmap-exp/weilin/nmap-nd/libdnet-stripped/include/dnet/intf.h

==============================================================================
--- nmap-exp/weilin/nmap-nd/libdnet-stripped/include/dnet/intf.h
 (original)
+++ nmap-exp/weilin/nmap-nd/libdnet-stripped/include/dnet/intf.h      Sun
Jul 10 05:36:02 2011
@@ -23,6 +23,7 @@
      u_short         intf_flags;                 /* interface flags */
      u_int           intf_mtu;                   /* interface MTU */
      struct addr     intf_addr;                  /* interface address */
+     struct addr     intf_addr6;                 /* interface IPv6
address */
      struct addr     intf_dst_addr;              /* point-to-point dst
*/
      struct addr     intf_link_addr;             /* link-layer address
*/
      u_int           intf_alias_num;             /* number of aliases */

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.

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?

David Fifield


Oh, you are right. "nmap --iflist" lists the interfaces and a mass
 addresses indeed.

But nmap.list_interfaces can't be called in my NSE environment.

33: interfaces,err = nmap.list_interfaces()

NSE: 'list_if' (thread: 0x855bdd8) threw an error!
...ilin/nmap-dev/weilin-svn/nmap-nd/scripts/list_if.nse:33: attempt to call
field 'list_interfaces' (a nil value)
stack traceback:
...ilin/nmap-dev/weilin-svn/nmap-nd/scripts/list_if.nse:33: in function
<...ilin/nmap-dev/weilin-svn/nmap-nd/scripts/list_if.nse:23>
(tail call): ?

Completed NSE at 16:19, 0.00s elapsed

--
Regards
Xu Weilin 许伟林
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/



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

Current thread: