1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-24 16:39:03 +00:00
Commit Graph

10291 Commits

Author SHA1 Message Date
dmiller
ed9ecc54ea Improve html form parsing, patch from nnposter
http://seclists.org/nmap-dev/2014/q3/418
2014-09-20 14:49:55 +00:00
dmiller
1d5da8bccb Get rid of redundant/useless tonumber()s in script arg processing 2014-09-20 06:03:25 +00:00
dmiller
47d31171b0 Some NSE globals cleanup. 2014-09-20 05:40:49 +00:00
dmiller
0224e0515a Make http-vuln-wnr1000-creds actually return something 2014-09-20 05:40:47 +00:00
dmiller
bf457ee12c Normalize some timeouts in scripts
Added use of stdnse.parse_timespec for timeout args. Used comm.lua
default timeouts in a couple cases. Corrected 2 cases of incorrect
documentation ("Default 60" when the default was 30 seconds).
2014-09-20 05:40:46 +00:00
dmiller
5db940fc70 Update http-server-header in a few ways
1. Use "softmatched" to let Nmap print the service fingerprint for the
user to submit.

2. Run even if version detection got a good match. This allows it to be
run by-name, or to provide additional info if available. Existing match
will not be clobbered, though.

3. Use comm.lua's default timeouts. Also, no need to pass port.protocol,
since comm.tryssl will use the port table directly.

4. XML output
2014-09-20 05:40:44 +00:00
dmiller
d50436def8 Let scripts set/preserve port.version.service_fp
Previously, calling nmap.set_port_version would delete a service
fingerprint if it existed. Now, setting probestate to anything but
"hardmatched" will preserve the fingerprint, if it exists. This allows
scripts (like http-server-header) to use "softmatched" to set version
info but still encourage users to submit fingerprints.
2014-09-20 05:40:43 +00:00
fyodor
0351db35b9 Update copyright year to 2014 2014-09-19 04:32:58 +00:00
dmiller
791566faf0 Let imap and pop3 use shorter connect timeouts 2014-09-19 03:10:10 +00:00
dmiller
45ff211483 Refactor smtp.connect to use comm.opencon 2014-09-19 03:10:09 +00:00
dmiller
004851bb06 Reindent comm.lua (whitespace-only) 2014-09-19 03:10:07 +00:00
dmiller
77a1c5c79c Some comm.lua internal changes
1. export the comm.opencon function. Does all the connect/request
timeout, recv_before, and first data payload stuff that tryssl does, but
without trying SSL. Ought to save some boilerplate in some scripts

2. Make opencon use setup_connect instead of duplicating code.

3. Move a debug message about tryssl to tryssl from opencon

4. Transparently handle UDP in tryssl, in case someone does that. Debug
message about DTLS not being supported is printed, but otherwise just
connects with opencon. Previously, doing this would result in a
connection to the TCP version of the port, even if you passed in a port
table with port.protocol=="udp".
2014-09-19 03:10:06 +00:00
dmiller
e8eddb6cfe Use comm.lua default timeouts for http.pipeline_go, remove unused get_default_timeout 2014-09-18 04:11:28 +00:00
dmiller
a7b86fa0fa Change timeouts for comm.lua
As reported by nnposter (http://seclists.org/nmap-dev/2014/q3/472) using
the rtt-based timeouts for read timeouts is not a good idea, since host
processing time can be considerably longer, especially for SSL
connections. comm.lua already allowed for different connect_ and
request_timeout values to reflect this truth, so this commit switches to
using the rtt-based timeout for the connect timeout and adding 6 seconds
to get the request timeout. This value is based on the totalwaitms value
in nmap-service-probes, and is still well short of the default 30s nsock
timeout.
2014-09-18 03:38:24 +00:00
dmiller
327496d50c Relax http.parse_form to allow forms without an action
Patch from nnposter: http://seclists.org/nmap-dev/2014/q3/384
2014-09-18 03:38:23 +00:00
dmiller
d518e2dbcb Use http.parse_redirect and allow arbitrary verbs in http-form-brute
There's no reason we can't use other verbs besides GET and POST. Other
verbs are handled like GET requests (parameters in the URI string). Any
redirect responses will be followed with GET requests, though.
2014-09-17 21:57:59 +00:00
dmiller
440ed59396 Export http.parse_redirect, a useful function 2014-09-17 21:57:57 +00:00
dmiller
5c9d6a3a75 Let http-form-brute use GET in addition to POST
Patch from nnposter. http://seclists.org/nmap-dev/2014/q3/262
2014-09-17 21:57:56 +00:00
dmiller
26faf21ae1 Work around weird AIX traceroute hang
std::list::size() was hanging because list traversal was broken for this
particular static list (timedout_hops). Could not reproduce with a small
test program, but another AIX user confirmed. Exhausted other options
before switching it to dynamic allocation (of the list itself, not the
elements, which are always dynamically allocated), which somehow
bypasses the problem.
2014-09-16 15:36:44 +00:00
dmiller
2f4f11637b Fix some library ordering (-lnsock must come before -lnbase)
Doesn't matter on most platforms because our own object (.o) files
require the symbols from libnbase, so all of them have been linked by
the time libnsock is encountered, but vasprintf and asprintf were
causing problems on platforms that need the versions defined in
libnbase.
2014-09-16 03:10:17 +00:00
dmiller
3ecd0452d5 Fix a memory leak in NSE's bind function 2014-09-15 22:49:17 +00:00
dmiller
9a155c269d Actually use reply ttl for distance guessing in traceroute
This chunk of code in read_replies was generating valgrind errors
because reply.ttl was uninitialized:

  if (host->state == HostState::COUNTING_DOWN) {
    /* If this probe was past the target, skip ahead to what we think the
       actual distance is. */
    int distance = get_initial_ttl_guess(reply.ttl) - reply.ttl + 1;
    if (distance > 0 && distance < host->current_ttl)
      host->current_ttl = MIN(distance, MAX_TTL);
  }

My compiler was setting the initial value to 0, which meant that
distance was always 33, clearly wrong. Setting reply.ttl in decode_reply
silences the error and causes distance to be more accurate.
2014-09-15 17:27:10 +00:00
dmiller
53135e80b9 Remove large files support from nse_fs
This was a hassle to support on AIX (several broken implmentations) and
the move to a more portable solution (using autoconfig macros) was also
troublesome. Upon review, nse_fs.cc only uses directory and link
functions, so large files support shouldn't matter. Stripping it out.
2014-09-15 13:59:01 +00:00
fyodor
d9ef693a93 remove a TODO item which is an addition to a proposed feature which itself isn't yet in Nmap. So I think it's better to track this one separately 2014-09-11 09:21:46 +00:00
dmiller
47ad1bf67c Add a problematic TCP option to validateTCPhdr 2014-09-10 18:48:15 +00:00
dmiller
ed604aedc7 Fix a bug (infinite loop) with connect scan on AIX 2014-09-10 15:55:51 +00:00
dmiller
be4cf76125 Actually use nmap_config.h in nse_fs.h (see r33661) 2014-09-10 15:55:50 +00:00
dmiller
c22c1119e9 Note last commit in libdnet/NMAP_MODIFICATIONS 2014-09-09 21:19:09 +00:00
dmiller
73275cc872 dnet: Fix hw address getting on AIX 2014-09-09 21:19:08 +00:00
dmiller
9847a701e4 Make large files support conditional
nse_fs.cc was forcing large files support, and it was broken on AIX due
to this GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=20366

Now we let autoconf handle setting the appropriate defines, and also
check for this particular bug before defining.
2014-09-09 05:04:17 +00:00
dmiller
e6659f1d90 Fix initializer for struct in6_addr on AIX 2014-09-09 01:59:08 +00:00
dmiller
48dfb446d2 Only use RT_ROUNDUP on NetBSD
AIX's version breaks things: http://seclists.org/nmap-dev/2014/q3/405
2014-09-08 20:50:51 +00:00
dmiller
3c5137e7e7 Update 14 scripts with XML structured output 2014-09-08 04:35:49 +00:00
dmiller
6d421b2e67 Correct CVE number for ssl-ccs-injection 2014-09-06 03:09:37 +00:00
dmiller
9936bf6a47 Update smb-enum-shares to use structured output 2014-09-05 20:07:44 +00:00
dmiller
4a9cd8af7d Update smb-enum-groups to structured output 2014-09-05 13:08:13 +00:00
dmiller
a41685fd33 Correct some wrong output sections (old-style) 2014-09-05 13:08:11 +00:00
dmiller
b6e59efb4b Add stdnse.keys() for extracting keys from a table 2014-09-05 13:08:09 +00:00
dmiller
5c11f46bf0 Update dhcp-discover and broadcast-dhcp-discover to XML output 2014-09-05 02:54:40 +00:00
dmiller
33adefaab6 Update several scripts and libraries to use stdnse.format_time 2014-09-05 02:54:39 +00:00
dmiller
6dfd1b5abe Let stdnse.format_time take other units besides seconds 2014-09-05 02:54:37 +00:00
dmiller
9460f34e32 New stdnse.format_time for showing time intervals 2014-09-05 02:54:35 +00:00
dmiller
b913b23d58 Structured output for nat-pmp-info, sip-methods, smb-security-mode 2014-09-04 18:35:20 +00:00
dmiller
adc213d536 Update hadoop-namenode-info and hadoop-tasktracker-info with XML output 2014-09-04 18:35:19 +00:00
dmiller
92cf943482 Update ms-sql-info with structured output 2014-09-04 02:37:32 +00:00
dmiller
e7e530ccd0 Update hadoop-jobtracker-info with XML output 2014-09-03 22:07:32 +00:00
dmiller
327e0ab4cd Update hbase-master-info with XML output 2014-09-03 22:07:31 +00:00
dmiller
34ea28f869 Update epmd-info
Added structured output
Simplified building of probe (now just a string)
Added a timeout
2014-09-03 21:39:33 +00:00
dmiller
1bd3e1e85c Convert snmp-win32-* to XML output 2014-09-03 19:50:03 +00:00
dmiller
5365095c7b Convert netbus-info to XML output 2014-09-03 19:50:00 +00:00