Nmap - the Network Mapper. Github mirror of official SVN repository. https://svn.nmap.org/
Find a file
david 5898afd06b Canonicalize interface addresses returned from libdnet.
Mac OS X appears to have a new address convention that I can't find
documented. The link-local address fe80:4::X:X:X:X stands for
fe80::X:X:X:X%en0, if en0 is the interface with index 4. (I.e., it would
be fe80::X:X:X:X%4 on Windows.) The number 4 could be different numbers.

The interface addresses seem to be stored with these pseudo-zone IDs at
a low level, because they appear that way when they come from libdnet.
This is what "nmap --iflist" shows:

lo0  (lo0)   fe80:1::1/64                   loopback    up   16384
en0  (en0)   fe80:4::xxxx:xxxx:xxxx:xxxx/64 ethernet    up   1500  XX:XX:XX:XX:XX:XX

The OS X network tools seem to hide this. This is what "ifconfig" and
"netstat -rn -f inet6" show:

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
en0: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        inet6 fe80::xxxx:xxxx:xxxx:xxxx%en0 prefixlen 64 scopeid 0x4

fe80::1%lo0                             link#1                          UHLI            lo0
fe80::xxxx:xxxx:xxxx:xxxx%en0           XX:XX:XX:XX:XX:XX               UHLI            lo0

(Not the "scopeid 0x4".) Also, if you use one of these addresses, it
magically transforms into one without the pseudo-ID (getaddrinfo does
this):

$ ping6 fe80:4::1234
PING6(56=40+8+8 bytes) fe80::xxxx:xxxx:xxxx:xxxx%en0 --> fe80::1234%en0
$ ping6 fe80:1::1234
PING6(56=40+8+8 bytes) fe80::1%lo0 --> fe80::1234%lo0

This translation is messing up our netmask comparisons for the purpose
of routing. If you use a normal link-local address starting with fe80:0,
then it doesn't compare equal with the fe80:4/64 interface address. If
you try to use the 4, then getaddrinfo turns it into fe80:0 anyway, and
the comparison still fails.

So for this reason I added a canonicalize_address function, which calls
getnameinfo on an address, then calls getaddrinfo on the returned
string, to mangle an address the same way the OS would do it. One would
hope this is a no-op in cases other than the one I have described.

Now "nmap --iflist" shows:
lo0  (lo0)   fe80::1/64                   loopback    up   16384
en0  (en0)   fe80::xxxx:xxxx:xxxx:xxxx/64 ethernet    up   1500  XX:XX:XX:XX:XX:XX
2011-09-18 23:49:34 +00:00
docs Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
libdnet-stripped Use if_nametoindex instead of SIOCGIFINDEX. 2011-09-17 06:40:41 +00:00
liblua Remove quotes around the OutputFile element contents in liblua for the Release 2010-11-04 23:08:03 +00:00
libnetutil Canonicalize interface addresses returned from libdnet. 2011-09-18 23:49:34 +00:00
libpcap Added a note about the patch in r20315 2010-09-23 06:44:51 +00:00
libpcre Prevent pcre.h from being regenerated everytime configure is invoked and 2011-08-10 16:38:37 +00:00
macosx o [Ndiff] Fixed the Mac OS X packages to use the correct path for 2011-03-15 22:09:10 +00:00
mswin32 Use "cmd /c copy" rather than "cp" when copying OpenSSL DLLs. 2011-08-31 19:41:13 +00:00
ndiff Update svn version number to 5.59BETA3. There isn't an imminent release or anything, but I think bumping it will reduce confusion. Plus, I accidentally checked in a modified version number to some of the externals (when meaning to just modify a branch), so this will make the version consistent 2011-08-25 06:47:10 +00:00
nselib fixed wrong (global) variable name 2011-09-16 18:33:52 +00:00
scripts Don't redundantly list the NULL compressor in ssl-num-ciphers.nse. 2011-09-14 18:21:23 +00:00
todo Add to TODO: 2011-09-17 19:21:55 +00:00
acinclude.m4 Merge from /nmap-exp/david/nmap-ipv6. 2011-06-08 01:24:48 +00:00
aclocal.m4
BSDmakefile
CHANGELOG Add to CHANGELOG: 2011-09-18 05:18:33 +00:00
charpool.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
charpool.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
config.guess Update to the latest config.guess and config.sub from 2010-09-29 04:31:24 +00:00
config.sub Update to the latest config.guess and config.sub from 2010-09-29 04:31:24 +00:00
configure Merge from /nmap-exp/david/nmap-ipv6. 2011-06-08 01:24:48 +00:00
configure.ac Merge from /nmap-exp/david/nmap-ipv6. 2011-06-08 01:24:48 +00:00
COPYING Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
depcomp
FingerPrintResults.cc Remove some code that only applied to gen-1 OS detection. 2011-08-16 17:50:23 +00:00
FingerPrintResults.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
global_structures.h Remove the constructor from OS_Classification. 2011-09-15 18:41:46 +00:00
HACKING
idle_scan.cc Fix some [-Wunused-but-set-variable] warnings. 2011-07-19 21:40:32 +00:00
idle_scan.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
INSTALL
ltmain.sh
MACLookup.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
MACLookup.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
main.cc Move get/set_program_name from main.cc to nmap.cc. 2011-06-15 18:12:33 +00:00
Makefile.in Added xmpp-info.nse as a replacement for xmpp.nse (script from Vasily Kulikov). 2011-09-04 19:18:22 +00:00
missing
nmap-header-template.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nmap-mac-prefixes Update nmap-mac-prefixes to the latest data as of 2011-06-29 2011-06-29 08:33:42 +00:00
nmap-os-db Expand a Window 7 fingerprint. 2011-09-15 16:38:54 +00:00
nmap-payloads Turn the 6481/udp probe from servicetags.nse into a UDP payload. 2011-02-22 04:32:59 +00:00
nmap-protocols
nmap-rpc Regenerate (and manually merge) nmap-rpc from the master file at 2011-03-24 02:57:02 +00:00
nmap-service-probes Added application CPEs for Undernet IRCu 2011-09-13 10:13:42 +00:00
nmap-services change copyright date 2011-01-21 20:59:10 +00:00
nmap.cc Declare the 'new_targets' inside the NOLUA conditional directives. 2011-09-11 22:53:57 +00:00
nmap.h Update svn version number to 5.59BETA3. There isn't an imminent release or anything, but I think bumping it will reduce confusion. Plus, I accidentally checked in a modified version number to some of the externals (when meaning to just modify a branch), so this will make the version consistent 2011-08-25 06:47:10 +00:00
nmap.spec.in Use %{_target_cpu} to support both i386 and x86_64. 2011-06-08 23:01:31 +00:00
nmap_amigaos.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nmap_config.h.in Merge from /nmap-exp/david/nmap-ipv6. 2011-06-08 01:24:48 +00:00
nmap_dns.cc Removed Trailing Spaces 2011-05-21 01:30:50 +00:00
nmap_dns.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nmap_error.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nmap_error.h Fix MSVC compiler noreturn related warnings and add extra 2011-06-23 23:59:52 +00:00
nmap_rpc.cc Limit scope of recvfrom address. 2011-09-03 18:48:12 +00:00
nmap_rpc.h Use u32 rather than unsigned long to define RPC packet structure. 2011-09-03 18:08:20 +00:00
nmap_tty.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nmap_tty.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nmap_winconfig.h Show which libraries are the ones included with Nmap and which are from 2011-02-24 21:06:59 +00:00
NmapOps.cc Merging branch /nmap-exp/shinnok/nmap-options-parsing into trunk. 2011-07-29 23:50:28 +00:00
NmapOps.h Merging branch /nmap-exp/shinnok/nmap-options-parsing into trunk. 2011-07-29 23:50:28 +00:00
NmapOutputTable.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
NmapOutputTable.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nse_binlib.cc
nse_binlib.h
nse_bit.cc
nse_bit.h
nse_debug.cc Rearrange some headers to make sure that out nbase errno defines are seen early, 2010-11-04 22:43:00 +00:00
nse_debug.h
nse_dnet.cc Made getInterfaceByName() return IPv6 interface information. 2011-08-10 22:56:34 +00:00
nse_dnet.h o [NSE] Removed the nmap.get_interface_link function, which was 2011-04-22 22:47:28 +00:00
nse_fs.cc Add a new cnse.fetchscript, which first checks for an absolute path, 2011-03-26 06:48:29 +00:00
nse_fs.h Add a new cnse.fetchscript, which first checks for an absolute path, 2011-03-26 06:48:29 +00:00
nse_main.cc Just use srand on NSE startup in nse_main.cc. This removes the need 2011-05-24 02:48:39 +00:00
nse_main.h Change the way ScriptResult::get_id and ScriptResult::get_output work to avoid 2010-11-09 19:47:18 +00:00
nse_main.lua o [NSE] When the rule function failes include its type in the error message. 2011-08-16 01:24:46 +00:00
nse_nmaplib.cc Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
nse_nmaplib.h Remove get_target() and get_port() function declaration from the nse_nmaplib.h since they are already declared in the nse_utility.h 2011-02-10 08:45:50 +00:00
nse_nsock.cc Fixed a bug: use sockaddr_storage instead of sockaddr. 2011-06-09 17:38:04 +00:00
nse_nsock.h
nse_openssl.cc
nse_openssl.h
nse_pcrelib.cc
nse_pcrelib.h
nse_ssl_cert.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nse_ssl_cert.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
nse_utility.cc Since r20267 (NSE Nsock maintenance), failures in raw IP sends from NSE cause 2010-11-11 01:11:13 +00:00
nse_utility.h Since r20267 (NSE Nsock maintenance), failures in raw IP sends from NSE cause 2010-11-11 01:11:13 +00:00
osscan.cc Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
osscan.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
osscan2.cc Free TOps_AVs and TWin_AVs between OS rounds. 2011-09-09 08:24:47 +00:00
osscan2.h Reorganized source file so methods of the same class are grouped together 2011-07-26 12:03:18 +00:00
output.cc Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
output.h Remove some unused function parameters. 2011-06-14 02:29:39 +00:00
payload.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
payload.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
portlist.cc Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
portlist.h Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
portreasons.cc Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
portreasons.h Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
protocols.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
protocols.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
README-WIN32
scan_engine.cc Count ND probes in UltraScan::numProbesPerHost. 2011-08-30 23:55:12 +00:00
scan_engine.h Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
service_scan.cc Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
service_scan.h Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
services.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
services.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
shtool
Target.cc Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
Target.h Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
TargetGroup.cc Remove unused TargetGroup::rewind method. It was used for --exclude groups before that code was rewritten to use addrset. 2011-08-04 02:37:05 +00:00
TargetGroup.h Remove unused TargetGroup::rewind method. It was used for --exclude groups before that code was rewritten to use addrset. 2011-08-04 02:37:05 +00:00
targets.cc Keep a std::string in scope when accessing its c_str. 2011-07-29 20:43:31 +00:00
targets.h Merging from nmap-exp/colin/nmap-addrset, nmap-exp/colin/nbase-addrset, and /nmap-exp/colin/ncat-addrset 2011-06-20 20:46:41 +00:00
tcpip.cc In build_{icmp,igmp}_raw, fill with zeros when data is NULL. 2011-09-15 17:57:00 +00:00
tcpip.h Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
timing.cc Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
timing.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
traceroute.cc Make dummy struct operator() const. 2011-07-25 23:31:17 +00:00
traceroute.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
utils.cc Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
utils.h Merge r26341:26417 from /nmap-exp/david/nmap-cpe. 2011-09-09 23:24:14 +00:00
xml.cc Comment typo. 2011-06-14 19:46:43 +00:00
xml.h Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
zenmap.spec.in

Here is some documentation for Nmap, but these files are much less
comprehensive than what you'll find at the actual Nmap documentation
site ( http://nmap.org ).