1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

30 Commits

Author SHA1 Message Date
nnposter
5d7012bab6 Correct detection of end-of-options in the DHCP parser, which rectifies
false warning "Unexpected end of options" on valid packets.
2024-08-22 03:15:12 +00:00
nnposter
6adb9d3609 Correct the documentation for dhcp.dhcp_parse(), as it is explicitly
wired to process only DHCP replies. Any other DHCP packet types are rejected.
2024-08-22 03:01:54 +00:00
dmiller
1a7a96274a Avoid format-string bugs. Fixes #2634 2023-07-20 17:24:16 +00:00
nnposter
1293291ac8 Skip lease time in DHCP client packets by default
The old behavior (of using the default time of 1s) did not allow constructing
packets without this option, which in turn resulted in (1) DHCPINFORM packets
being non-compliant with RFC 2131 and (2) DHCP discovery scripts potentially
receiving non-default IP lease information. Fixes #2197
2020-12-04 00:38:12 +00:00
dmiller
dcc0e3ed7e New tableaux library containing table auxiliary functions. 2018-10-17 15:34:30 +00:00
dmiller
ff6b5b65a8 Remove more bin.lua packings. 2018-09-22 05:19:24 +00:00
dmiller
46eca7f35f Move date/time functions from stdnse to datetime. See #517 2018-08-27 22:00:10 +00:00
dmiller
edfc5e3835 Remove useless bin.pack('A') calls (equivalent to tostring) 2017-03-14 02:51:06 +00:00
dmiller
2091ce3199 Fix endianness in unpacking IP addresses, since ipOps.fromdword is fixed. Fixes #750 2017-03-13 14:58:57 +00:00
dmiller
69e1423363 Add a check to dhcp.lua to avoid crash and provide debug output 2017-03-01 20:41:20 +00:00
dmiller
cb4b46bd53 Canonicalize authors as tables instead of comma-separated strings 2016-06-09 22:46:42 +00:00
dmiller
c2c86cb9f9 reduce memory reallocs in dhcp.lua (string building, static tables) 2016-02-12 05:42:19 +00:00
dmiller
4a85f18938 Add TFTP/PXE-related DHCP options. patch by Mike Rykowski 2016-02-11 23:50:47 +00:00
dmiller
03110e7e89 String concat cleanup grab-bag
Mostly just eliminating concatenation-reassignments by chaining
concatenations, reordering assignments to allow better use of bin.pack,
and using tables to store intermediate results before concatenating
them. Used strbuf as a quick fix in dhcp.lua. Eliminated some unused
string variables in vulns.lua.
2015-03-02 14:39:29 +00:00
dmiller
0e74dd7a35 Replace some string.char and bin.pack calls with literals 2015-02-27 19:42:56 +00:00
dmiller
33adefaab6 Update several scripts and libraries to use stdnse.format_time 2014-09-05 02:54:39 +00:00
batrick
ee6622aea4 nselib stdnse.print_debug -> stdnse.debug
$ f() { find -name \*.lua -exec /bin/echo sed -i "$1" {} \; ; }
$ f 's/stdnse.print_debug( *\([0-9]*\) *, */stdnse.debug\1(/'
$ f 's/stdnse.print_debug( *"\(.*\))/stdnse.debug1("\1)/'
2014-08-03 00:56:45 +00:00
dmiller
17c3e9755e NSEdoc cleanup.
1. The first paragraph of a function's NSEdoc is used as a short
summary. Some of these were very long, so I split off a shorter summary.

2. Use asterisks (*) to denote bulletted lists, not 'o'

3. Wrap lines at 80 columns

4. a couple other spelling and formatting fixes
2014-03-10 19:01:19 +00:00
dmiller
1b71f75aad Spelling fixes for Lua files
Mostly in documentation/comments, but a couple code bugs were caught,
including a call to stdnse.pirnt_debug and a mis-declared variable.
2014-02-19 04:15:46 +00:00
dmiller
69e343f0aa Reindent the last of the NSE libraries.
https://secwiki.org/w/Nmap/Code_Standards
2014-02-04 19:47:26 +00:00
dmiller
620f9fdb34 Remove trailing whitespace in lua files
Whitespace is not significant, so this should not be a problem.
https://secwiki.org/w/Nmap/Code_Standards
2014-01-23 21:51:58 +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
patrik
9ff471d906 o [NSE] Removed DoS code from dhcp-discover and placed it into the discover and
safe categories. Added support for adding options to DHCP requests in the
  dhcp library. [Patrik]
2011-12-29 08:07:26 +00:00
patrik
a4e6a82b00 Cleaned up code and removed interface from functions dhcp_send and
make_request as it was not used. Added WPAD action. [Patrik]
2011-12-28 21:17:31 +00:00
patrik
07e0426629 o [NSE] Changed the dhcp-discover script to use the DHCPINFORM request to query
dhcp servers instead of DHCPDISCOVER. Cleaned up some code in the DHCP
  library. [Patrik]
2011-12-27 18:48:34 +00:00
patrik
cbf959aecc o [NSE] Added the script broadcast-dhcp-discover that sends a DHCP discover
message to the broadcast address and collects and reports the network
  information received from the DHCP server. [Patrik]
2011-07-21 11:56:15 +00:00
david
18157ed081 Merge from /nmap-exp/david/nmap-unconnected. This adds unconnected
socket support to NSE, with updates in scripts and libraries.

o [NSE] Added the ability to send and receive on unconnected sockets.
  This can be used, for example, to receive UDP broadcasts without
  using pcap. A number of scripts have been changed so that they can
  work as prerule scripts to discover services by UDP broadcasting,
  optionally add the discovered targets to the scanning queue:
    - ms-sql-info
    - upnp-info
    - dns-service-discovery
  The nmap.new_socket function can now optionally take a default
  protocol and address family, which will be used if the socket is not
  connected. There is a new nmap.sendto function to be used with
  unconnected UDP sockets. [David, Patrik]
2010-10-16 00:48:44 +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
batrick
ed3ac6bc0e accidental global fixes 2010-09-13 06:09:42 +00:00
ron
89888ef6b3 Added DHCP library and re-wrote dhcp-discover.nse to use the new library. 2010-08-28 17:18:40 +00:00