1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

183 Commits

Author SHA1 Message Date
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
david
745a49d24a Upgrade the included Windows OpenSSL to version 1.0.0a. 2010-09-16 03:49:43 +00:00
david
e8ecc904b8 Call nsi_set_hostname in service_scan.cc. 2010-08-13 21:47:09 +00:00
kris
05abf37ead get rid of a warning 2010-07-07 01:25:20 +00:00
djalal
72a06a3b5c Merge r18160:18278 from nmap-exp/djalal/nmap-nse/ to fix NSE not honoring the exclude directive bug. 2010-06-29 21:56:59 +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
jah
3b15630d70 Wrap EPROTO case in an ifdef directive to avoid compiler errors when EPROTO is
not defined (such as on windows XP).
2010-05-08 23:35:41 +00:00
david
6fa497f04e o Added EPROTO to the list of known error codes in service scan. Daniel
Miller reported that an EPROTO was causing Nmap to exit after sending
  the Sqlping probe during service scan. The error message was
  "Unexpected error in NSE_TYPE_READ callback. Error code: 71 (Protocol
  error)". We suspect this was caused by a forged ICMP packet sent by an
  active firewall.
2010-05-06 21:36:11 +00:00
fyodor
1aecac420f Update copyright year from 2009 to 2010 2010-05-03 21:20:25 +00:00
david
e72ecb11ac Fix spelling neccessary -> necessary. 2010-03-20 03:59:31 +00:00
kris
a4d9644b19 Use targetipstr() instead of NameIP() in places so output is like
192.168.10.14:21

instead of

	hostname (192.168.10.14):21
2010-03-19 05:03:39 +00:00
david
1f6c6d1aac Only change the port state to PORT_OPEN during service scan if it is not
already open. Rob Nicholls pointed out that setting the state
unconditionally results in multiple messages per port:

Discovered open port 3389/tcp
Discovered open port 3389/tcp
Discovered open port 3389/tcp
Discovered open port 3389/tcp

This is because setPortState has the side effect of printing a message.
2010-01-26 20:14:29 +00:00
david
4c57d3f8c8 Unconditionally set the port state to PORT_OPEN when receiving a service
scan response, instead of checking for a current state of
PORT_OPENFILTERED. The code calls getPortState, but the port may not
have been assigned a state, again because of the new Port allocation
architecture, so the function returns -1.

It would make sense to have getPortState return the default port state
if a Port has not been allocated, but there are two other places it is
used where the code relies on it returning -1 to indicate that a port
has not received a state yet.
2010-01-23 02:01:50 +00:00
david
7db7da0007 Merge again from /nmap-exp/david/nmap-mem; this fixes a couple of bugs. 2009-12-20 03:22:19 +00:00
david
1c6030709b Revert r16307:16309, the merge from nmap-mem. I just found a
segmentation fault which I am investigating.
2009-12-19 22:49:16 +00:00
david
b838242e01 Merge from /nmap-exp/david/nmap-mem. This brings in two memory-reducing
changes. The first is that Port objects don't allocate memory for
service and RPC results unless that information is set. This reduces the
size of a bare Port from 92 to 40 bytes on my machine. The second change
is that PortList now has the notion of a "default port state," which is
the state of any ports that didn't receive a response. These ports don't
need an allocated Port object, which saves a lot of memory in scans
where most ports didn't get a response.
2009-12-19 21:26:14 +00:00
david
b3597eb3a3 Add an n parameter to ServiceProbe::testMatch to enable getting all of
the available matches.
2009-12-19 08:30:18 +00:00
david
0530fa2f2d Add a lineno member to MatchDetails. 2009-12-19 06:08:47 +00:00
david
e2315ae075 Remove the unused Port::owner member. 2009-11-20 20:17:33 +00:00
david
99a2835d7d Let Nmap run if the nmap-service-probes file is empty. Patch by Ankur
Nandwani.
2009-09-07 22:03:27 +00:00
david
c7abca3a2e Make the checking of argument counts and types for the $P and $SUBST
substitutions more explicit. Formerly the number of arguments was
checked implicitly by checking their type (that they had a specific type
and were not SUBSTARGS_ARGTYPE_NONE), but this makes it clearer.
2009-08-29 15:21:52 +00:00
david
32db650a4b Add some more comments to substvar in service_scan.cc. 2009-08-29 14:35:50 +00:00
david
c371d35714 Add a check against svc->probe_matched being NULL before doing a string
comparison in scanThroughTunnel. It is checked against NULL later in the
function, so presumably it can happen.
2009-08-24 21:14:51 +00:00
fyodor
7e6d183799 Increase the default concurrency level for version scanning from 10-20 based on timing level to 20-40 based on results from Patrick's testing 2009-08-18 21:39:27 +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
david
9aebba220c Merge from svn://svn.insecure.org/nmap-exp/daniel/{nmap,ncat,nsock}-sctp.
This adds SCTP support (including SSL over SCTP) to Nsock and Ncat.
2009-07-25 00:03:48 +00:00
david
4e117783a1 With --version-trace, show the names of probes as they are sent. Also
show the names of probes that had a match with --version-trace (used to
only happen with -d2). The patch is from Tom Sellers.
2009-06-08 23:42:57 +00:00
daniel
50830f7488 o Added initial SCTP port scanning support to Nmap. SCTP is
a layer 4 protocol used mostly for telephony related applications.
  This brings the following new features:
  o SCTP INIT chunk port scan (-sY): open ports return an INIT-ACK
    chunk, closed ones an ABORT chunk.  This is the SCTP equivalent
    of a TCP SYN stealth scan.
  o SCTP COOKIE-ECHO chunk port scan (-sZ): open ports are silent,
    closed ports return an ABORT chunk.
  o SCTP INIT chunk ping probes (-PY): host discovery using SCTP
    INIT chunk packets.
  o SCTP-specific IP protocol scan (-sO -p sctp).
  o SCTP-specific traceroute support (--traceroute).
  o The ability to use the deprecated Adler32 algorithm as specified
    in RFC 2960 instead of CRC32C from RFC 4960 (--adler32).
  o 42 well-known SCTP ports were added to the nmap-services file.
  Part of the work on SCTP support was kindly sponsored by
  Compass Security AG, Switzerland.  [Daniel Roethlisberger]
2009-06-03 23:15:45 +00:00
david
d122b91891 Merge from /nmap-exp/david/nmap-ssl, /nmap-exp/david/ncat-ssl, and
/nmap-exp/david/nsock-ssl. This brings in secure SSL connections for
Ncat. See http://seclists.org/nmap-dev/2009/q2/0183.html.
2009-04-25 03:24: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
david
e69ae791cb Fix an identifier in a TODO comment. 2009-04-08 20:04:54 +00:00
bmenrigh
9bf557485b o Expanded and tweaked the product/version/info of service scans in an
attempt to reduce the number of warnings like "Warning: Servicescan
  failed to fill info_template...".  Parts of this change include:
  o Improved the text of the warning to be less confusing
  o Increased the internal version info buffer to 256 chars from 128
  o Increased the final version string length to 160 from 128 chars
  o Changed the behavior when constructing the final version string so
    that if it runs out of space, rather than dropping the output of that
    template it truncates the template with ...
  o Fixed the printing of unneeded spaces between templates when one of the
    templates isn't going to be printed at all.
2009-04-05 02:02:15 +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
72d3ffe636 Version detection used to omit the "ssl/" service name prefix if an
SSL-tunneled port didn't respond to any version probes. Now it keeps "ssl/" as
an indication that SSL was discovered, even if the service behind it wasn't
identified. Kristof Boeynaems reported the problem and contributed a patch.
2009-03-03 17:38:28 +00:00
david
c561222685 Fix spelling in some identifiers. wierd_responses -> weird_responses,
printStatsIfNeccessary -> printStatsIfNecessary.
2008-12-04 17:04:48 +00:00
kris
98ee3211f2 Fixing port numbers in output. The "%hi" conversion modifier was being used
which treats port numbers as signed shorts, and this caused high ports numbers
to wrap around and be shown as negative.
2008-10-24 00:48:19 +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
michael
9f1c28ad9c This patch reorganizes the way ping probes are handled internally.
Previously the ping probe data structures were stored in NmapOps,
now they will be stored in the scan_lists struct. All other changes
auxiliary to this reorganization.
2008-05-29 07:49:37 +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
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
kris
85edc7a005 Merging over from /nmap-exp/kris/assert-testing
Ensuring the safety of assert() calls by keeping NDEBUG undefined throughout
Nmap, Nbase and Nsock.

I've tested this on Linux and Windows XP without problems.  On Windows I've
removed the definitions of _DEBUG and NDEBUG from the *.vcproj files.
2008-05-03 17:58:48 +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
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
fyodor
8220c8a42f update copyright line at the top of files from 1996-2006 to 1996-2008 2007-12-22 06:32:03 +00:00
fyodor
09512ff092 o Fix a bunch of warning/error messages which contained an extra
newline.  Thanks to Brandon Enright for the patch.
2007-12-21 03:38:04 +00:00
kris
fe63809293 Setting uninitialized pointer to NULL. It was possible that it would not be set, and also not be NULL so it would bypass the assert() on it, which in turn caused a crash. Found with Coverity, CID 18 2007-11-16 00:48:44 +00:00
fyodor
5e67f7db4c When version detection changes the state of a port, the reason field is now updated as well (to udp-response or tcp-response as applicable). Thanks to Thomas Buchanan for the patch. 2007-11-15 23:41:12 +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