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

9911 Commits

Author SHA1 Message Date
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
david
7b1c0155ba apt-get command for lua-format dependencies. 2012-09-13 00:17:40 +00:00
kroosec
ca43a6d59f Added http fingerprints by Jesper Kückelhahn for Sitecore CMS. 2012-09-12 21:57:49 +00:00
david
f66691ee08 Remove some ancient commented SearchResult test code. 2012-09-12 21:51:48 +00:00
robert
a9d060cb43 Prevent tftp-enum from incorrectly setting the port as closed when an error occurred (e.g. timeout when port is filtered). 2012-09-12 09:27:51 +00:00
fyodor
f98479160d Add a minor Nping bugfix to allow -c values higher than 4 billion and make -c 0 not stop at 4 billion 2012-09-12 07:18:06 +00:00
fyodor
2c6b5e7d24 The Nroff man pages aren't really able to render superscripts (AFAICT) and so 2^32 was rendering as just 232. So I changed it to just say that Nping will run continuously if '-c 0' is specified. If it really stops after 4 billion rounds, that is a bug that we should probably fix at some point 2012-09-12 07:16:41 +00:00
david
b32c5f617a CHANGELOG John Spencer for configure portability fixes. 2012-09-12 04:57:04 +00:00
david
ecf62c247a Check for and include <sys/select.h>.
This was reported as a build error by John Spencer using musl libc.
http://seclists.org/nmap-dev/2012/q3/776
2012-09-12 04:54:21 +00:00
david
739aca56d4 Whitespace. 2012-09-12 04:54:19 +00:00
david
fed81c865a Include <arpa/inet.h> in APR_CHECK_WORKING_GETNAMEINFO.
http://seclists.org/nmap-dev/2012/q3/777
2012-09-12 04:23:24 +00:00
david
2c092db698 Don't use exit in APR_CHECK_WORKING_GETNAMEINFO.
Same reason as r29737.

http://seclists.org/nmap-dev/2012/q3/777
2012-09-12 04:23:23 +00:00
david
b5b558f162 Don't use the clobbered rtmsg->rtm_family to look up interfaces.
This value gets clobbered after the netlink recvmsg. It was giving me a
bogus address family (234), which caused the call to getInterfaceByName
to fail:
Could not find interface wlan0 which was specified by -e

This seems to have been exposed by r29754. Specifying a source address
that is not on any actual route seems to result in a netlink query
result with 0 entries, and the changed value of rtm_family. (The fact
that there are no routes returned is not a problem, because we bail out
early when -e is given, now that getInterfaceByName works again.)
2012-09-11 23:50:21 +00:00
david
84fc27ee2d Make --route-dst option obey other command-line args.
--route-dst has been a useful debugging option, but it ran inline during
option processing and always used AF_UNSPEC to resolve names. Let it run
after options have been processed, so it can obey things like -6, -S,
and -e. Let it always resolve with o.af(), so you get different results:
  nmap --route-dst scanme.nmap.org
  nmap -6 --route-dst scanme.nmap.org
2012-09-11 21:00:47 +00:00
david
c1484a52a9 Wording, brevity. 2012-09-11 21:00:46 +00:00
david
bb075521ea Formatting in nmap.cc.
astyle -a -p -H -s2 -m2 nmap.cc
2012-09-11 20:43:24 +00:00
david
5b8c1090e5 Add specifiers for source address and interface in route_dst_netlink.
We previously restricted by destination address; do it for source
address as well. This can matter in some configurations.

http://seclists.org/nmap-dev/2012/q3/831

There still seems to be a problem with the wrong route being chosen with
--send-ip, but this patch is reported to work with --send-eth.
2012-09-11 18:39:42 +00:00
david
be636dacaf Factor out a add_rtattr_addr function to add a source or destination spec.
This is used to restrict what routes the Netlink layer will return to
us.
2012-09-11 18:39:40 +00:00
david
ba88cb4f5d Check for received packet in rpc-grind.nse.
The script was checking the returned data, but not the status. When
status is false, data is actually an error message. So in case of a
timeout, the script was receiving nil, "TIMEOUT" and interpreting
"TIMEOUT" as a response from the server. It looked like this:

Discovered open port 1434/udp on 127.0.0.1
NSE: rpc-grind: RPC checking function response data is not RPC.
NSE: Target port 1434 is not a RPC port.

This was reported by Christopher Clements.
http://seclists.org/nmap-dev/2012/q3/685
2012-09-11 00:39:04 +00:00
fyodor
ef5205b798 Note that Mac high resolution application icon is done 2012-09-10 23:58:48 +00:00
fyodor
ed217a04f5 Update todo with latest changes and ideas 2012-09-10 23:57:18 +00:00
david
a47d68a84f Typo. 2012-09-10 23:53:54 +00:00