Commit Graph

212 Commits

Author SHA1 Message Date
dmiller f8004b792c Replace a config-time check with a ifndef that also works on Windows. 2018-11-21 06:23:08 +00:00
dmiller d8c1d935f1 Move Npcap headers and lib stuff to nmap-mswin32-aux 2018-10-18 03:28:39 +00:00
dmiller 30db709755 Optimistically revert mutex that was needed with WinPcap. Npcap likely is unaffected. 2018-10-03 16:57:54 +00:00
dmiller 534643aac6 Performance tweak for Windows. See #1327 2018-09-26 21:12:40 +00:00
dmiller d6a04c465e Call pcap_set_immediate_mode to get results back immediately. 2018-08-21 04:51:33 +00:00
dmiller 7f1485f56d Switch to pcap_create instead of pcap_live_open. See #1291 2018-08-20 22:08:56 +00:00
nnposter 302954fb3f Rectifies incorrect use of va_start/va_end from stdarg.h. Closes #1297 2018-08-09 22:11:15 +00:00
dmiller 689ea0e05d Spelling corrections. Fixes #1160 2018-03-26 14:59:41 +00:00
fyodor ff62300249 Bump copyright dates to 2018 and slightly improve wording (doesn't change meaning) of Nmap license header text 2018-01-28 21:18:17 +00:00
rewanth 6ee953a5ff Removes trailing spaces in 69 files. Closes #971. 2017-08-23 08:52:40 +00:00
dmiller 9c7ea727a7 Update license terms for 2017 2017-06-07 12:32:38 +00:00
fyodor 4bd67aa2fb Update the Nmap license/header text to reflect latest updates to docs/legal-notices.xml 2016-12-14 00:12:23 +00:00
dmiller f4c5c832a6 Remove dependency on pcap-int.h Fixes #426
Windows doesn't support selectable pcap fds, so instead of fiddling with
adapter read timeouts via PacketSetReadTimeout, we get an event handle
with pcap_get_event and WaitForSIngleObject. This means we don't need to
extract the adapter from the pcap_t, which is not part of the libpcap
API and was causing crashes switching between the libpcap versions used
by WinPcap and Npcap.
2016-08-25 18:41:03 +00:00
vincent b5606dde91 Hide first makefile attempt to include makefile.dep
This is to avoid having a warning saying that there is no makefile.dep
file, which will be generated right after the warning and then
included in the Makefile.
2016-08-16 09:31:59 +00:00
dmiller af13cef717 Upgrade to Npcap 0.08 (libpcap 1.8.0 headers for Windows) 2016-08-13 20:04:05 +00:00
vincent 3bbd85b38d Correct bad fix for silencing compiler warning (overloaded functions) 2016-08-02 13:47:45 +00:00
dmiller 5d726c7733 Handle ICMPv6 packets without a body
Two issues here: First, IP protocol scan can send packets with protocol
58 (ICMPv6) even over IPv4. This led to a bad interaction where the
packet was created (in build_protoscan_packet) without a data payload,
but setIP tried to set the packet's Identifier field (present in both
ICMPv6 and ICMP Echo Request packets), leading to a heap buffer
overflow. Instead, we now only try to set this identifier when the IP
version matches the ICMP version, indicating that we set the data
payload.

The other issue was a out-of-bounds read while packet tracing when an
ICMPv6 packet without a payload was sent or received, due to trying to
read the type and code. Now we check that the data length is sufficient
to contain an ICMPv6 header before attempting to read one.

Credit LLVM/Clang's AddressSanitizer with catching these bugs.
2016-07-28 05:11:35 +00:00
dmiller 040d8e9c0f Revert r35943: causing segv crashes in IPv6 OS scan 2016-07-27 19:49:13 +00:00
vincent 0f22680426 Correct format string specifiers
The formats has been tested and verified on Mac OS X 10.8.5,
Mac OS X 10.11.5 and Ubuntu 14.04 LTS, all on x86_64 machines
and OSs. It mainly silences warnings. There were no warnings on
Ubuntu but a few on Mac OS, so the fix is intended to silence
warnings on Mac OS whithout triggering new warnings on other OSs.
Example of warnings previously encountered:

netutil.cc:2828:74: warning: format specifies type 'unsigned short'
but the argument has type 'int' [-Wformat]
2016-07-01 11:44:26 +00:00
vincent 9703feace9 Avoid hidden overloaded virtual functions
Since the functions were hidden for the comiler, I specified every
function that was being hidden in the IPv*Header.h header files.
This allows us to use both overloaded functions and the original one
instead of having one being hidden by the others.
Here is the compiler warning output before the fix:

warning: 'file::function' hides overloaded virtual function
note: hidden overloaded virtual function 'file2::function' declared
here: different qualifiers
2016-07-01 11:36:20 +00:00
dmiller 855ec33fc0 Allow use of Windows' own inet_pton and inet_ntop functions 2016-06-04 02:46:12 +00:00
dmiller 50054e6ed7 Update platform toolset to remove XP compatibility 2016-06-04 02:46:11 +00:00
dmiller 6e33d6ac3c Bump date in copyright headers 2016-04-04 15:38:44 +00:00
dmiller ecd041bd11 Avoid unused var warning if IPV6_TCLASS is not defined 2016-02-21 14:28:10 +00:00
dmiller 1cde9a4ed7 Display next-hop MTU instead of encapsulated total IP len. http://seclists.org/nmap-dev/2016/q1/112 2016-02-12 05:42:20 +00:00
dmiller 27c2a64a17 Remove 6/8, 7/8, and 55/8 from ip_is_reserved. http://seclists.org/nmap-dev/2016/q1/11 2016-02-11 05:52:35 +00:00
dmiller f9a7123aed sys/uio.h needed for struct iovec on OpenBSD 2016-01-13 20:53:38 +00:00
dmiller a205e0c4d4 Fix for OpenBSD packet loss. Fixes #274 2016-01-12 19:38:06 +00:00
dmiller 2450dee71e Extend libnetutil's isipprivate function to check for 169.254/16 2015-12-19 20:44:55 +00:00
dmiller 47ac4e421e Clean up some windows build errors due to misapplication of a patch 2015-11-12 19:38:47 +00:00
dmiller 37d517b32e Use XP compatibility SDK, because users are complaining 2015-11-10 16:47:35 +00:00
dmiller f4619edece Update http urls for nmap.org to https 2015-11-05 20:41:05 +00:00
dmiller e73053c457 Fix FreeBSD version check for raw socket byte order. Fixes #217. See #196, #50 2015-10-28 03:21:15 +00:00
dmiller 3d9e348832 Use a mutex on Windows to avoid a hang when accessing WinPCAP driver
Reported by multiple users on Windows 8.1 and Windows Server 2012 R2.
Seems to hang when the WinPCAP driver is accessed via OpenServiceA by
multiple processes at once. Users report that this change, which uses a
mutex to avoid concurrent access, fixes the hang.
2015-09-20 19:06:11 +00:00
dmiller 9ab82ecedf Fix raw packet sending on FreeBSD 10.0 and later.
See https://svnweb.freebsd.org/base?view=revision&revision=241913 for
the change. Closes #196. Fixes #50.
2015-08-06 21:10:36 +00:00
dmiller 2e602435f5 Move osscan-related structs to osscan.h from global_structures.h 2015-06-23 15:53:02 +00:00
dmiller 68409b2226 Update copyright date to 2015 2015-06-03 13:01:29 +00:00
dmiller 5d6fe15fec Cache dnet names not found in addition to found names. http://seclists.org/nmap-dev/2015/q1/251 2015-06-01 03:51:31 +00:00
dmiller 0952bed032 Merge final changes to support VS2013 build
Changes:

* Fix a collision of the name PS_NONE with a different constant in shlobj.h
* Update solution and project files for VS2013
* Update the NSIS installer to reference the VC 2013 redistributable
2015-01-17 04:35:01 +00:00
dmiller fc99bed706 Don't use unnecessary parens with __declspec
Reported by nnposter, this broke on VS2010. Pretty sure this was just a
simple mistake in the first place. Fixes #33
2015-01-01 13:39:47 +00:00
dmiller 85bb2d388d Define a NORETURN macro 2014-11-17 13:25:32 +00:00
dmiller a067bc25bc Let MSVC know about noreturn attribute to help with code analysis 2014-11-12 13:29:40 +00:00
dmiller 98b1467a48 Avoid null pointer deref when getting IPv4 header options 2014-11-12 13:29:37 +00:00
dmiller 111fbe4b41 Modify some offensive terminology in comments. 2014-11-05 15:02:09 +00:00
dmiller c7e5ad67b5 Do optimization of pcap filters via set_pcap_filter
Optimizing reduces BPF instructions from 45 to 10 for large-scan case.

Also use PCAP_NETMASK_UNKNOWN instead of 0 since we don't provide a
netmask.
2014-10-29 05:31:08 +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
claude 319b6b560e Fixed a small error in the comments, probably a copy/paste error. 2014-06-05 19:51:50 +00:00