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

33 Commits

Author SHA1 Message Date
dmiller
3499025302 Wrap dnet eth functions for non-Ethernet links 2025-06-23 20:54:32 +00:00
dmiller
42170b067f Remove unneeded g_has_npcap_loopback 2025-04-16 00:00:05 +00:00
dmiller
136e1c6ed7 Lua 5.4 change: userdata created with 1 uservalue by default. Set to 0 when possible 2024-06-20 20:47:10 +00:00
dmiller
13be028eb1 nse_dnet: try raw Ethernet sends if raw sockets don't work, e.g. Windows 2024-06-20 20:14:31 +00:00
dmiller
a5baf9de0b Consolidate device name checking in nse_dnet.cc 2024-06-20 20:14:31 +00:00
dmiller
a0b2d3d80e Check return value of eth_send in case of errors 2022-01-13 22:30:20 +00:00
dmiller
044295b0c8 Script tracing for dnet raw sends 2022-01-13 22:30:19 +00:00
dmiller
a0f55317f3 Fix inclusion of Lua headers. See #1355
We will need to do something similar for Ncat.
2018-10-16 05:18:31 +00:00
dmiller
86edcb0e5b Remove some unused includes 2017-04-19 19:06:47 +00:00
dmiller
36301d6ddd Fix dnet raw packet sending on Npcap Loopback on Windows in NSE 2017-03-05 04:10:46 +00:00
batrick
7f5ec526fe Merge branch 'nse-lua53'
Lua 5.3 adds several awesome features of particular interest to nmap including
bitwise operators and integers, a utf8 library, and standard binary pack/unpack
functions.

In addition to adding Lua 5.3, this branch changes:

o Complete removal of the NSE bit library (in C), It has been replaced with
  a new Lua library wrapping Lua 5.3's bit-wise operators.

o Complete removal of the NSE bin library (in C). It has been replaced with a
  new Lua library wrapping Lua 5.3's string.pack|unpack functions.

o The bin.pack "B" format specifier (which has never worked correctly) is
  unimplemented.  All scripts/libraries which use it have been updated. Most
  usage of this option was to allow string based bit-wise operations which are no
  longer necessary now that Lua 5.3 provides integers and bit-wise operators.

o The base32/base64 libraries have been reimplemented using Lua 5.3's new
  bitwise operators. (This library was the main user of the bin.pack "B" format
  specifier.)

o A new "bits" library has been added for common bit hacks. Currently only has
  a reverse function.

Thanks to David Fifield, Daniel Miller, Jacek Wielemborek, and  Paulino
Calderon for testing this branch.
2016-07-02 17:02:27 +00:00
dmiller
67fd101b01 Enable Nmap, Nping to use Npcap over Winpcap if available. 2016-06-14 14:16:46 +00:00
dmiller
84d0e45641 Remove some unneeded includes of utils.h 2015-06-23 15:52:55 +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
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
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
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
batrick
6cbcf02734 Get the closure from the library, don't make a new one. 2012-05-28 21:48:54 +00:00
batrick
000f6dc4d9 Lua 5.2 upgrade [1] for NSE.
[1] http://seclists.org/nmap-dev/2012/q2/34
2012-05-27 08:53:32 +00:00
david
3fe86cca72 Add a note that ip_send is broken for IPv6 link-local destinations.
The function always extracts the address from the packet contents, but
the scope_id cannot be recovered from the packet contents.
2011-10-29 19:40:18 +00:00
david
fd556a76fe Make dnet:ip_send able to send IPv6. 2011-10-29 19:40:16 +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
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
djalal
fc79deba75 Made getInterfaceByName() return IPv6 interface information. 2011-08-10 22:56:34 +00:00
david
4aa4a154f9 Merge from /nmap-exp/david/nmap-ipv6.
This is raw IPv6 packet support for most port and ping scans, Neighbor
Discovery, and traceroute.
2011-06-08 01:24:48 +00:00
djalal
e91c3505be o [NSE] Removed the nmap.get_interface_link function, which was
deprecated by the new nmap.get_interface_info function.
2011-04-22 22:47:28 +00:00
david
c36cf833e6 Add the nmap.get_interface and nmap.get_interface_info functions by
Djalal Harouni.
2011-04-05 06:11:58 +00:00
batrick
8475399cd3 Removed unused variable (compiler warning). 2011-01-07 23:51:43 +00:00
batrick
b62c80f070 Removed dnet userdata "interface" field which is an integer
key in the Lua Registry for a string interface value. It
is apparently not used anywhere so no point keeping it.
2011-01-07 23:28:21 +00:00
kris
e39eeea8ba Since r20267 (NSE Nsock maintenance), failures in raw IP sends from NSE cause
scripts to bail.  (This is why Ron saw a backtrace when path-mtu elicited an
EMSGSIZE [a separate issue I'm still working on] instead of path-mtu
recognizing the failure and resending with a smaller MTU like it would do
before.)  I'm changing this back to the original design of returning false to
scripts (just like connect-mode send failures).  

I've changed safe_error() in nse_utility.cc to support varargs.
2010-11-11 01:11:13 +00:00
david
6cc9a328b4 Fix nse_dnet.cc compilation on Windows. This was broken in the merge in r20267. 2010-09-23 01:58:32 +00:00
batrick
de4ba536de Merge from /nmap-exp/patrick/nse-nsock-maintenance.
This is a maintenance fix for the NSE Nsock library binding. The patch focuses
on code correctness and simplicity. The patch also brings some initial updates
with an eye towards the upcoming Lua 5.2 release. See [1] for a post concerning
this branch.

[1] http://seclists.org/nmap-dev/2010/q3/710
2010-09-18 20:35:09 +00:00