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

232 Commits

Author SHA1 Message Date
dmiller
e9bdcd811a Strip tcpip.h of some unnecessary includes 2015-06-30 18:34:28 +00:00
dmiller
68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
dmiller
a86b679404 Fix WinPcap crash on pcap_findalldevs error
See http://seclists.org/nmap-dev/2015/q1/176

Fixes #15
2015-02-12 16:52:02 +00:00
dmiller
47ad1bf67c Add a problematic TCP option to validateTCPhdr 2014-09-10 18:48:15 +00:00
dmiller
5adfb3b1de Update copyright notice to 2014 2014-08-16 01:52:33 +00:00
jay
8d5ec9e310 Reapply r33420, r33421. Fix a missing right parenthesis. https://xkcd.com/859/ 2014-08-15 12:09:22 +00:00
fyodor
f6f59a7cd7 Auto regeneration with latest template files, etc. 2014-08-13 22:57:43 +00:00
jay
d4cf544df6 Fix a missing bracket at the end of the IMPORTANT NMAP LICENSE TERMS part in each file 2014-08-02 19:29:50 +00:00
d33tah
421176fc00 Get rid of double newline at the EOF I accidentally introduced in the
last commit.
2014-06-18 11:30:02 +00:00
d33tah
e3d1c178e3 Add newlines at the EOF in conformance to Daniel's coding standards
proposal. This only affects Nmap's root directory. We might also need to
modify the code which autogenerates Nmap's source code files such as IPv6
fingerprinting code.
2014-06-18 10:18:58 +00:00
dmiller
3f0d0c16f9 Spellcheck on Nmap, Nsock, Nbase source files 2014-02-20 18:44:12 +00:00
d33tah
ccd0c02a4c Add a lacking space in the license comment. The command I used to do this is:
for file in `grep "* including the terms and conditions of this license text as well.       \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well.       \*/* including the terms and conditions of this license text as well.        */g" -i $file; done
2013-09-11 19:06:20 +00:00
fyodor
6e01ecd452 Update an email address, fix a typo, and slightly reword a sentence. 2013-07-30 00:02:00 +00:00
fyodor
83fb10ec56 Update the Nmap copyright/license files. This isn't the new Nmap Public Source License we've been discussing on the list, but rather just a 'quick patch' to hopefully prevent some of the abuse we've been seeing from companies lately. More details on the changes will be posted to the dev list. Also, the copyright year was updated to 2013 (which is the only change to Nsock license statements). 2013-07-28 22:05:05 +00:00
fyodor
6a42ef47c0 Update the Nmap and Nsock source code headers to note new Nmap dev mailing list email address and a better URL for Nmap license. 2012-12-06 01:21:42 +00:00
david
7b18ea1bc0 Move win32_fatal_raw_sockets out of nmap_raw_socket.
For the same reason and with the same exception (nse_dnet.cc) as in
r30159.
2012-10-31 17:00:55 +00:00
david
03946ba2f5 Return -1 instead of calling pfatal in nmap_raw_socket.
There was one case where we previously didn't fatal, in nse_dnet.cc.
Move the fatal calls out of nmap_raw_socket and into the calling scope,
with the exception of the one in nse_dnet.cc.

The problem was reported by Rob Nicholls.
http://seclists.org/nmap-dev/2012/q4/186
2012-10-31 16:09:47 +00:00
david
22dc30d786 Fix a compile error left from r29932 refactoring.
Reported by Jaebum Shin.
http://seclists.org/nmap-dev/2012/q4/47
2012-10-07 15:16:18 +00:00
david
bc0c6d17b4 Constify data arguments in packet building and sending functions. 2012-10-06 21:26:29 +00:00
david
8ab0096609 Remove dead asserts.
I believe the purpose of these asserts was to quiet a compiler warning
in r24309, but the rest of that revision (marking fatal as a
non-returning function) should do the job.
2012-10-06 21:26:26 +00:00
david
84f4697c50 Call socket_bindtodevice in nmap_raw_socket. 2012-10-03 15:43:23 +00:00
david
a53e00afa1 Factor out an nmap_raw_socket function.
This does the common setup of a raw socket that we use everywhere.
2012-10-03 15:43:21 +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
652fb94405 Make -e assign IPv6 scope ids for everything, not only route_dst.
You could use "-e en0" to automatically add scope ids to your IPv6
addresses, so you didn't need the write "fe80::1234%en0". But this only
happened for the route_dst calculation, and could lead to later failures
in sendmsg when the address didn't have a scope id.
2012-03-27 21:48:53 +00:00
david
aadc34efa3 Remove dumb offensive comments. 2012-03-26 21:58:15 +00:00
david
e4816cea05 Whitespace.
astyle -a -p -H -s2 -m2 tcpip.cc
2012-03-26 21:58:14 +00:00
david
b4cb468b1d Apply the nonblocking pcap read trick in readip_pcap too. 2012-03-22 00:47:24 +00:00
david
94768d88fa Include <net/if_arp.h> from struct_ip.h.
This may be a better way to solve AIX build problems; anyway tcpip.cc didn't build for me on Solaris.
2012-03-17 11:44:00 +00:00
david
941d609eef Include <net/if.h> before <net/if_arp.h>.
This may fix some build problems on AIX 5.3.
2012-03-07 03:39:11 +00:00
batrick
4e7756e4de Change hostname parameter to const char *. 2012-03-04 07:26:16 +00:00
fyodor
684f42c4ad One more adjustment to the license text. Notes that Zenmap, Ncat, and Nping use this license. Note that contributions made directly in the src repository are treated the same as those in the mailing list. 2012-03-01 06:53:35 +00:00
fyodor
e96a7b7b24 Update the headers for each code file. This updates code copyright dates to 2012, notes the awesome NSE in the list of technology, and slightly rewords the derivative works clarification 2012-03-01 06:32:23 +00:00
henri
63f3fc4954 Fixed comments that referred to an incorrect location. 2012-01-26 09:25:05 +00:00
david
06b69fa9a3 Make some args const. 2011-10-29 19:40:15 +00:00
david
91b7aa2d5f Don't use strict inequality with MAX_LINK_HEADERSZ.
DLT_IPNET is equal to this.
2011-09-29 22:23:14 +00:00
david
f0d97d0e9a Add offset for DLT_IPNET (seen on Solaris). 2011-09-29 22:23:13 +00:00
david
fee764a5d8 Use a special struct_ip.h to include <netinet/ip.h> and accoutrements.
The comment in struct_ip.h explains the reasoning for this. The AIX C library
uses #defines that change the names of members of struct ip, and conflict with
some existing code. (Notably struct ip_hdr in libdnet and IPv4Header::h in
libnetutil.) We can still use the AIX files if we include <netinet/ip.h> after
this other code has been preprocessed. That's hard to enforce when
<netinet/ip.h> is included from another header file; this new file allows
including it always late, and only where needed.
2011-09-21 07:31:38 +00:00
david
c87da9aa8b Avoid using parameter names that are #defined on AIX.
AIX defines various things like ip_id as some implementation-dependent
submember of struct ip.
2011-09-21 07:31:37 +00:00
david
f41753c4e9 Add a sockaddr dst argument to send_ip function that use raw sockets.
Heretofore we have always extracted teh destination address directly
from the packet contents. But the raw packet bytes do not contain enough
information in one case: IPv6 link-local addresses. For those we really
need the scope ID, and for that we must pass this information all the
way down.

Before this, I got "no route to host" on OS link-local addresses. I
think that it was working on Linux only on accident, by the OS picking a
default interface or something.
2011-09-19 16:13:35 +00:00
david
d91b131da0 Make various accessors and parameters const. 2011-09-19 16:13:33 +00:00
david
8b01344caf In build_{icmp,igmp}_raw, fill with zeros when data is NULL.
This restores the previous behavior of these functions, which was broken
in r24127, which itself was fixing another bug.

r24127 solved the problem of --data-length appending zeroes, not random
data, to ICMP and IGMP packets. But in doing so, it added a check that
the data argument is not NULL. OS detection uses a data argument of
NULL, expecting these functions to fill in zeroes in this case. The
result of this was that the IE probes were being sent with empty
payloads instead of 120 and 150 bytes.
2011-09-15 17:57:00 +00:00
david
f86f2dec67 Assign scope id in nmap_route_dst.
This is done for all IPv6 addresses when the -e option is used.
2011-08-30 23:55:09 +00:00
david
9932429abd Whitespace. 2011-08-30 23:55:06 +00:00
david
6cf428d8c6 Fix some "and" -> "&&". 2011-07-19 23:42:33 +00:00
weilin
1dcf652410 Added ND ping for local IPv6 nets, merging from /nmap-exp/weilin/nmap-nd. 2011-07-19 02:31:54 +00:00
david
21cbe8ffba Use a big enough buffer in traceND. Same as r24365 in
/nmap-exp/weiling/nmap-nd.
2011-06-28 21:58:54 +00:00
shinnok
3240e10bb0 Fix MSVC compiler noreturn related warnings and add extra
safety asserts to the functions that do not return on all
control paths.
2011-06-23 23:59:52 +00:00
shinnok
e8bd001619 Fix build_icmp_raw and build_igmp_raw filling the packet data payload with
zeroes instead of the supplied random data, when nmap is invoked with --data-length.
2011-06-18 11:20:54 +00:00
david
35d920cda9 Rename do_arp_cache to do_mac_cache.
It is no longer specific to ARP; it also caches IPv6 ND results.
2011-06-14 00:42:39 +00:00