1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-19 22:19:02 +00:00
Commit Graph

7732 Commits

Author SHA1 Message Date
luis
f712477644 Fix a bug in the argparser. When users pass 'random' as an IPv6 address, the randomly generated address never gets stored. This was reported and fixed by Mark Atkinson. More info: http://seclists.org/nmap-dev/2012/q3/950 2012-09-20 20:40:38 +00:00
dmiller
7751a61e82 Fix broken service matches
Discussion: http://seclists.org/nmap-dev/2012/q3/929

Similar situation to http://seclists.org/nmap-dev/2009/q2/75

Fixed by changing .*\n.* to .* (since s modifier was in place)
2012-09-20 19:21:34 +00:00
david
cc126ea7d4 Fix removal (assignment to nil) of elements in stdnse.output_table.
There was a reverse table that was meant to map keys to their position
in the order table, to make it easy to table.remove an entry from order.
But removing something from order would shift the indices of all
following elements by 1, and those elements were not updated
correspondingly in the reverse table. Instead, do a linear lookup for
the the element to remove from order, after checking that the element
exists at all.

http://seclists.org/nmap-dev/2012/q3/905
2012-09-20 06:47:42 +00:00
david
8f39b485a0 Add cassandra scripts from Vlatko Kosturjak. 2012-09-20 06:30:48 +00:00
david
00cc96ba95 Add ipv6-ra-flood script by Adam Števko.
http://seclists.org/nmap-dev/2012/q2/250
https://bitbucket.org/xenol/nse-scripts/raw/6d3ad48e6251/ipv6-ra-flood.nse
2012-09-20 00:50:05 +00:00
david
7e5c9a8914 Regen with Autoconf 2.68 and aclocal 1.11.6.
for DIR in . nbase ncat nsock/src nping;
	do (echo $DIR; cd $DIR && aclocal --force && autoconf --force);
done
2012-09-19 16:41:35 +00:00
david
43a920120e Rename configlocal.m4 to acinclude.m4 for uniformity. 2012-09-19 16:41:31 +00:00
david
380bb92867 Remove broken incldue of nbase/configlocal.m4. 2012-09-19 16:41:30 +00:00
david
ad61d6de85 Remove unused aclocal.m4 files.
These aren't getting regenerated even with "aclocal --force"; I think
it's because there is nothing to put in them. Running "aclocal
--verbose" shows that all the required macros are in acinclude.m4 files:

aclocal: saw macro PCAP_IS_SUITABLE
aclocal: saw macro RECVFROM_ARG6_TYPE
aclocal: saw macro PCAP_IS_SUITABLE
aclocal: saw macro CHECK_IPV6_IPPROTO_RAW
aclocal: saw macro APR_FIND_APR
aclocal: ../acinclude.m4 is already included by configure.ac
2012-09-19 16:41:28 +00:00
david
ddc37e6e39 AM_CONFIG_HEADER → AC_CONFIG_HEADER(config.h).
aclocal.m4 said that AM_CONFIG_HEADER was obsolete; with
AC_CONFIG_HEADER aclocal.m4 is not even needed.
2012-09-19 16:41:27 +00:00
david
0bf004cf6b Move acinclude.m4 inclusion from aclocal.m4 to configure.ac.
aclocal.m4 is autogenerated, so running aclocal would remove the
m4_include of acinclude.m4.

The exceptions are at the top of the source tree and in nsock/src, where
an acinclude.m4 lives; aclocal notices it there and automatically adds
an inclusion to the end of aclocal.m4, so no inclusion is needed in
configure.ac.
2012-09-19 16:41:25 +00:00
david
74a79b14f5 Correct header comment. 2012-09-19 16:41:24 +00:00
david
6270d3f7c9 Move -Wno-deprecated-declarations from Makefile.in to configure.ac.
It's a flag specific to GCC, so shouldn't be set unconditionally.
2012-09-19 15:33:56 +00:00
david
98bb6cff31 Add -Wall to CFLAGS when using GCC. 2012-09-19 15:33:50 +00:00
david
89d52c8f4f Declare the function name we actually use.
It was nmap_update_svn_cmdline_create_auth_baton, but should be
       nmap_update_svn_cmdline_setup_auth_baton.
This was missed in r27746, which otherwise was making the same change.

This was noticed by John Spencer.
http://seclists.org/nmap-dev/2012/q3/942
2012-09-19 15:16:24 +00:00
david
9f0f8e33c0 Change hbase-region-info URL to /rs-status.
http://seclists.org/nmap-dev/2012/q3/903
2012-09-18 21:22:14 +00:00
david
fe185dfc24 Show OS scan guesses in XML even without --osscan-guess. 2012-09-18 17:03:47 +00:00
fyodor
b9cdbfa2ca An ID of npìng-man was used, so I changed it to the normal ASCII nping-man (note that the i character is slightly different in these two cases). 2012-09-18 09:07:24 +00:00
fyodor
1f10160411 Move copyright year from 2011 to 2012 (I suppose I should have done this in January rather than September, but better late than never 2012-09-18 09:04:54 +00:00
fyodor
729d5d744b just auto-sorting 2012-09-18 09:02:29 +00:00
fyodor
89caffb317 Note a finished task 2012-09-18 09:01:04 +00:00
fyodor
57973b0c60 Added a new legal notices section to the Ncat man page which is basically the same as that section in the Nmap man page (in fact it links to that section to avoid copy and pasting a bunch of text. As part of this, I had to make an enclosure file (ncatmanhtml.xml) for the ncat.xml. Otherwise I can't use things like –. And this is consistent with how we deal with the nping man page, though I'm fine with getting rid of the enclosure in both cases if there is a good way to do so 2012-09-18 08:58:41 +00:00
fyodor
a9a52064ef Some more minor updates/prioritization of the todo 2012-09-17 22:44:12 +00:00
fyodor
fc515208da some todo updates 2012-09-17 22:40:02 +00:00
david
874bbe28cd Pass the dst argument to existing calls to nmap.ip_send. 2012-09-15 17:56:21 +00:00
david
a4a046ac4c Let dnet:ip_send take a destination address.
Previously we always took the destination address from the packet
buffer, which failed for IPv6 link-local addresses because the packet
buffer does not contain the scope id.
2012-09-15 17:56:19 +00:00
david
9b28bc8ed5 Add an nseU_opttarget function. 2012-09-15 17:56:17 +00:00
david
d319f8bf56 Uniformity and style in resolve functions. 2012-09-15 17:56:16 +00:00
david
40eb708922 Show gai_strerror in some error messages. 2012-09-15 17:56:14 +00:00
david
113e0b975f Break out resolve and resolve_numeric.
Besides the confusingness of the nodns argument being negatively
phrased, it had the value 0 in every existing call. Split out the nodns
special case into a separate function resolve_numeric.

This also has the side effect of changing the number of parameters to
the resolve function, which will cause a compile error for any calls I
might have missed changing when I changed the return code meaning in the
previous commit.

Ncat has its own copy of resolve, which obeys the global o.nodns rather
than a parameter. I'm leaving that alone for now. But give it the same
resolve_internal function, and make resolve call it with different flags
depending on the value of o.nodns.
2012-09-15 17:56:11 +00:00
david
0e738370ee Make resolve return a getaddrinfo error code.
The only error we can have apart from a getaddrinfo error is a list of
zero addresses; return EAI_NONAME in that case.

This unfortunately inverts the truth value of the return code of
resolve; 0 now means success.
2012-09-15 17:56:08 +00:00
david
8803578976 Don't use optarg outside of option parsing. 2012-09-15 17:53:29 +00:00
david
e2d17adf9f Fix add_rtattr_addr.
The second argument to RTA_NEXT was missing a dereference, so it was
changing the pointer rather than the integer pointed to. I got this
assertion failure with an IPv6 link-local address:

nmap: netutil.cc:3048: void add_rtattr_addr(nlmsghdr*, rtattr**, unsigned int*, unsigned char, const sockaddr_storage*): Assertion `((*len) >= (int)sizeof(struct rtattr) && (*rtattr)->rta_len >= sizeof(struct rtattr) && (*rtattr)->rta_len <= (*len))' failed.
2012-09-15 17:17:59 +00:00
david
44c5c227d3 Revert "Document dnet:ip_send to take a destination address."
This reverts r29795. It's not finished yet.
2012-09-15 15:06:15 +00:00
david
fdc2f96c8c Use http.get(host, port) in hadoop scripts.
As well as being shorter, this prevents connecting using a different
address family (e.g., IPv6 rather than IPv4) compared to doing this:
  http.get(host.targetname, port.number)
Patch by John Bond.

http://seclists.org/nmap-dev/2012/q2/637
2012-09-15 15:05:13 +00:00
david
78cf2dfb06 Document dnet:ip_send to take a destination address. 2012-09-15 15:05:11 +00:00
david
7527202d8b Let setTargetNextHopMAC call getNextHopMAC instead of duplicating code. 2012-09-15 14:57:35 +00:00
david
271045501f Make getNextHopMAC do ND when the dest is IPv6.
This is what setTargetNextHopMAC already did, but the code change was
not copied here. This provided a way for NSE scripts to cause an
assertion failure:

local math = require "math"
local packet = require "packet"
function portrule(host, port)
  return port.protocol == "udp"
end
function action(host, port)
  local ip_raw = bin.pack("H", "60000000000d11ff")
    .. host.bin_ip_src .. host.bin_ip
    .. bin.pack(">S", math.random(32768, 65535)) .. bin.pack(">S",
port.number)
    .. bin.pack("H", "000d8082") .. "hello"
  local p = packet.Packet:new(ip_raw, #ip_raw)
  p:udp_count_checksum()
  local s = nmap.new_dnet()
  s:ip_open()
  s:ip_send(p.buf)
end

This would fail with the message "doArp can only handle IPv4 addresses"
when ip_send called getNextHopMAC. (Only with --send-eth.)
2012-09-15 14:57:34 +00:00
david
6d0e34ad7b nmap.ip_send is for both IPv4 and IPv6. 2012-09-15 07:27:27 +00:00
david
e2a6682a55 todo typo. 2012-09-15 07:26:38 +00:00
david
bc197f1877 Whitespace. 2012-09-14 21:08:23 +00:00
dmiller
f97c8db5e8 Correct output for ssl-enum-ciphers against non-ssl
ssl-enum-ciphers was producing output against non-ssl services, listing
"least strength: strong" when there was no cipher matched. Fixed to
return nil in this case, and to clearly indicate when a protocol is
supported but does not support any of our ciphers (a very unlikely
situation! Had to artificially reduce attempted ciphers to test.)
2012-09-14 21:06:46 +00:00
david
3fb047e237 Don't assign any routes to interfaces that are not up. 2012-09-14 15:51:12 +00:00
dmiller
0c1fd3e9d9 Make all host filters case-insensitive
Also some cleanup of unused variables, other minor performance tweaks.
2012-09-13 20:24:19 +00:00
dmiller
74a750a855 Allow negative matching in Zenmap filters
nmap-dev thread: http://seclists.org/nmap-dev/2012/q3/788

Host filter and others can now take things like "os:!linux" to match
hosts without Linux OS.
2012-09-13 20:24:18 +00:00
dmiller
2f36d0b968 Fix date handling in ssl-cert
Was crashing on unparseable dates (example: "2147483647Z"). Now the
exact string is placed in structured output when it cannot be
normalized. Also, the structured-format timestamp is used for Normal
output for consistency; no timezone offset was previously displayed.
2012-09-13 20:23:07 +00:00
fyodor
d88d8720a9 Add a task to include OS guesses in XML output in more cases 2012-09-13 03:36:36 +00:00
fyodor
444bc5ea48 Add an http digest parsing task suggested by David 2012-09-13 03:32:40 +00:00
david
5cc7049402 Add structured output to http-auth.nse. 2012-09-13 03:01:18 +00:00
david
bfa954c5ea Add a lua-format Makefile target to format scripts/*.nse. 2012-09-13 00:17:42 +00:00