1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 13:41:29 +00:00
Commit Graph

60 Commits

Author SHA1 Message Date
colin
fa7cc8e739 Removed Trailing Spaces 2011-05-21 01:30:50 +00:00
fyodor
86e59a8c4e Update copyright statements from 2010 to 2011 2011-01-21 00:04:16 +00:00
david
d4e49f1075 Rearrange some headers to make sure that out nbase errno defines are seen early,
avoiding warning about symbol redefinitions. This is mostly moving "nmap.h" to
the top of the list.
2010-11-04 22:43:00 +00:00
david
7653cf7d4a Move COPYING.OpenSSL to OpenSSL.txt, update copyright notices to match. 2010-10-30 03:01:50 +00:00
david
85d81f76ce Add another parameter to nsp_settrace that allows setting the FILE
stream to write to. It defaults to stdout like before if NULL is
provided. Ncat uses this to write to stderr instead.
2010-10-01 18:12:22 +00:00
luis
da126c8b78 Merged nmap-dedup branch from nmap-exp/luis/nmap-dedup. This completes the Nmap/Nping code de-duplication phase. 2010-06-22 17:24:34 +00:00
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +00:00
david
0ed416b8fd Fix these compiler warnings with a patch from Solar Designer:
ncat_proxy.c: In function `ncat_http_server':
ncat_proxy.c:163: warning: dereferencing type-punned pointer will break strict-aliasing rules

nmap_dns.cc: In function `void parse_resolvdotconf()':
nmap_dns.cc:951: warning: unsigned int format, different type arg (arg 4)

traceroute.cc: In member function `void TracerouteState::read_replies(long int)':
traceroute.cc:1031: warning: 'header_len' might be used uninitialized in this function
2010-01-28 18:55:08 +00:00
david
d04e2e825a Use a bigger buffer to read IP addresses from /etc/resolv.conf (to
acommonate IPv6 addresses) and make the sscanf format size match the
buffer size (to avoid smashing the stack). The format string is
constructed dynamically to the size of the buffer with Snprintf. Gunnar
Lindberg reported this problem; discussion starts at
http://seclists.org/nmap-dev/2010/q1/250.
2010-01-27 01:16:14 +00:00
jah
93f2e85aca Fixed a bug in get_dns_servers() where a sockaddr_storage was incorrectly
converted to a printable string causing invalid dns server addresses to be
returned.
2010-01-14 01:30:48 +00:00
david
904f655aca Keep track of the size of the sockaddr structure we get back when resolving DNS
servers. Pass that to nsock_connect_udp instead of using
sizeof(sockaddr_storage). Mac OS X return EINVAL if the length is not what's
expected for the address family.
2009-11-07 02:29:23 +00:00
david
cb8c8bd804 o Added support for connecting to nameservers over IPv6. IPv6 addresses
can be used in /etc/resolv.conf or with the --dns-servers option. The
  parallel reverse DNS resolver still only support IPv4 addresses, but
  it can look them up over IPv6. [Ankur Nandwani]
2009-11-06 18:45:48 +00:00
josh
df71e36084 Updated uses of the ctype function to support explict casting of the arguments
to (int)(unsigned char).
2009-08-06 15:10:00 +00:00
fyodor
d0e21e1d03 Suggest that people send patches to nmap-dev rather than to me directly 2009-04-15 00:37:03 +00:00
fyodor
eccc235d5a Increase copyright year to 2009, simplify/reword some derivative works text, and remove a confusing clause about selling proprietary front-ends to Nmap 2009-03-31 04:16:12 +00:00
david
4fc92b216c Tone down the Nsock trace level with --packet-trace, --version-trace,
and --script-trace. It was set at 5, now it's 2. That's enough to see
all the Nsock events and the contents of reads and writes. At 3 you
start to get messages like
	PCAP do_actual_pcap_read READ (IOD #%li) (EID #%li) size=%i
The message "wait_for_events" isn't printed until level 4. Getting rid
of that is the main reason for this change.
2009-03-27 21:37:14 +00:00
david
651cb6e486 Allow dns.get_servers to return a list of known DNS servers even when IPv6
scanning, when system DNS resolution is used. This makes ASN.nse work for IPv6.
See the thread at http://seclists.org/nmap-dev/2008/q4/0081.html.
2008-11-02 20:32:26 +00:00
david
aeae42ddc3 Add an assertion that l_get_dns_servers doesn't return any DNS servers is
!o.mass_dns. Simplify the loop that builds the server list.
2008-10-30 22:06:37 +00:00
david
fef3ba7f37 Factor out the mass_dns code that builds the list of servers. 2008-10-30 21:47:27 +00:00
david
c3b2b3dbed Split parallel DNS resolution and system DNS resolution into separate
functions. Previously system DNS resolution was encapulated inside the parallel
DNS function, inside a big if block. Now the if is on the outside and decides
which of the two functions to call.
2008-10-30 19:17:59 +00:00
pgpickering
a5b421e67c added get_dns_servers() to nmap_dns.cc/.h 2008-08-21 09:24:35 +00:00
kris
ffb3d8202d Documenting an earlier change and adding a new, related one:
o Nsock now supports binding to a local address and setting IPv4 options
  with nsi_set_localaddr() and nsi_set_ipoptions(), respectively. [Kris]

o Nmap's Nsock-utilizing subsystems (DNS, NSE, version detection) have been
  updated to support the -S and --ip-options flags. [Kris]
2008-07-14 19:52:31 +00:00
kris
9af737cd7f Changing --no_stylesheet to --no-stylesheet in the refguide, and changing
a few more long options with underscores in comments and output
2008-06-08 15:34:07 +00:00
fyodor
779b96a197 trivial copyright text tweak: filename nmap-os-fingerprints has changed to nmap-os-db 2008-05-22 20:45:32 +00:00
michael
47e4b7aee5 Fixed a bug in nmap_dns.cc where the endian of the platform that nmap ran on
might negitivly effect how efficiently nmap stores cache values in a hash 
table. Now ntohl is called to correctly reorder the values on little endian 
platforms before the hash calculation is preformed.
2008-05-15 22:41:49 +00:00
fyodor
10b54b773b minor license template updates from Kris--fix gnu.org link to GPLv2 (moved) and openssl license filename (COPYING.OpenSSL) 2008-05-05 04:10:00 +00:00
fyodor
5551c5a311 o Fixed a bunch of code to avoid compilation warning messages (at
least on some Linux machines) [Andrew J. Bennieston]
2008-04-09 02:11:20 +00:00
david
a03232981c Add comments, an assertion, and simplify the logic a bit in nmap_dns.cc. 2008-03-15 22:57:00 +00:00
david
a91c7f75e4 Fix an infinite loop in nmap_dns.cc.
This changes the DNS engine to use addto_etchosts to add entries from
/etc/hosts into the DNS cache, rather than just inserting them using
push_front.

The reason for this is that there is a static unsigned variable in
addto_etchosts that keeps track of how many entries there are in the
cache. Using push_front bypassed this variable, allowing the entries in
/etc/hosts to sneak in under the radar. Thus is was possible for the
cache to contain, say, 266 entries when it thought it only had 256.

When the cache size is greater than or equal to 256, addto_etchosts runs
a deletion pass aiming to reduce the number of entries to 126. But the
peculiar loop logic of that function means that more than 256 entries
can be deleted. (How many more depends in part on how many entries there
are in /etc/hosts. There must be at least one for the hang to occur.)
When this happens, the signed counter underflows and becomes large
positive, ~65000. The code empties the cache trying to get the counter
under 127, but it can never happen.

To reproduce the hang, make an /etc/hosts file like this:

1.0.0.1 host-1-1
1.0.0.2 host-1-2
1.0.0.3 host-1-3
1.0.0.4 host-1-4
1.0.0.5 host-1-5
1.0.0.6 host-1-6
1.0.0.7 host-1-7
1.0.0.8 host-1-8
1.0.0.9 host-1-9
1.0.0.10 host-1-10
2.0.0.1 host-2
3.0.0.1 host-3
...
254.0.0.1 host-254
255.0.0.1 host-255

The hang can occur with even one entry in /etc/hosts, but saturating the
cache like this makes the hang less dependent on network conditions.
Then list-scan a netblock that is greater in size than 256 and is dense
in DNS entries (at least 256 entries per 4096 IP addresses). For
example,

nmap -sL scanme.nmap.org/22

works for me currently.
2008-03-14 21:45:41 +00:00
fyodor
1accc12fb2 fix typo in legal header found by Leigh Zhao (missing word: of) 2008-02-28 18:52:06 +00:00
fyodor
29c912f394 URL change from http://insecure.org/nmap/* to http://nmap.org/* 2008-01-17 07:22:03 +00:00
ejlbell
9bc09ef2cc Fixed an integer overflow in the dns caching code that caused nmap to loop infinitely once it had expunging the cache of older entries. 2008-01-14 15:16:50 +00:00
fyodor
8220c8a42f update copyright line at the top of files from 1996-2006 to 1996-2008 2007-12-22 06:32:03 +00:00
kris
0b50c16b38 Adding Snprintf() and Vsnprintf() to nbase/nbase_str.c. This is because of Windows' stupid implementation where it doesn't write a NULL byte at the end of the buffer if the result is truncated. I would've just #defined snprintf and vsnprintf to some wrapper function for Windows, but this doesn't work as libdnet and libpcap (and libpcap includes under mswin32) define snprintf to _snprintf and vsnprintf to _vsnprintf like we do, and through the many defines they end up being available in the Nmap sources. Vsnprintf() uses vsnprintf() (and writes a NULL byte at the end if truncated), and Snprintf uses Vsnprintf(). 2007-08-14 06:46:54 +00:00
fyodor
8d74bbcd8a merge soc07 r4871:4884 and r4888 - renaming __FUNCTION__ to __func__ and changing hardcoded func names to __func__ 2007-08-11 04:06:09 +00:00
fyodor
58522c59f6 merge soc07 r4822 - Reduce the number of build dependencies. 2007-08-11 03:35:46 +00:00
fyodor
e882edf484 added Eddie Bell's traceroute patch, with only minor changes 2007-03-13 08:02:19 +00:00
fyodor
a111518907 More elaborate reasons for OmitSubmissionFP 2006-09-02 21:50:35 +00:00
fyodor
2140dfb00f Applied a patch by Kris Katterjohn which makes 14 functions static 2006-08-29 04:03:03 +00:00
fyodor
b28d51167c Minor source code header improvements 2006-08-25 01:47:49 +00:00
fyodor
a403864351 Replace file headers, mostly to update copyright to 2006 2006-08-24 04:43:50 +00:00
fyodor
3d9ccee8ff I think I'm done with pcap upgrade and doug's pcap selectable_fd patch 2006-08-17 00:23:03 +00:00
fyodor
71ac6ae95a little rDNS fix from Doug 2006-08-08 22:50:15 +00:00
fyodor
68606aae6f Doug DNS verbosity improvement 2006-08-02 07:02:05 +00:00
fyodor
9c0af0a95b memory releasing patch from Marek 2006-07-04 23:04:56 +00:00
fyodor
30190d664a fixed a completion time estimate bug 2006-07-04 07:36:29 +00:00
fyodor
5a9fea3b39 portability fixes, fixed UDP phantom port bug, fixed --version-intensity crash, changed mass_dns to give warning rather than error if cannot find dns servers 2006-06-10 21:23:27 +00:00
fyodor
48a6d1ce41 latest changes, including a couple doug fixes 2006-05-16 21:46:41 +00:00
fyodor
396a6c6d48 Change DNS message 2006-05-13 21:40:34 +00:00
fyodor
0b33f41633 About to do Nmap 4.03 2006-04-22 23:00:09 +00:00