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

35 Commits

Author SHA1 Message Date
nnposter
f0e85baf85 Add support for DHCP client identifier
see https://datatracker.ietf.org/doc/html/rfc2132#section-9.14
Closes #2468
2022-06-08 22:59:30 +00:00
dmiller
8df11582e6 Move comma-separated list code to outlib 2020-01-19 16:37:36 +00:00
nnposter
c4ecf225dd Add script argument to force specific MAC address. See #1838 2020-01-15 01:20:36 +00:00
dmiller
0500811f5a Move string utility functions to stringaux.lua 2018-10-18 01:08:19 +00:00
dmiller
26ef852a28 Move stdnse.generate_random_string to new rand.lua 2018-09-08 17:07:06 +00:00
dmiller
e373419855 Add a few NSE cross-references 2017-02-09 22:59:52 +00:00
dmiller
f4619edece Update http urls for nmap.org to https 2015-11-05 20:41:05 +00:00
dmiller
5c11f46bf0 Update dhcp-discover and broadcast-dhcp-discover to XML output 2014-09-05 02:54:40 +00:00
dmiller
40f36a4e3e Some string optimizations in NSE
Changes fall into these categories:

1. Avoid pathological string building. Loops over x = x .. "foo" can
become very slow. Instead, use strbuf.lua, table.concat, or just one
continuous concatenation; a = x .. y .. z is one operation, better than
a = x .. y; a = a .. z

2. Use hex-escaped strings instead of string.char. I find this more
readable in many cases, and it avoids a table lookup and function call.

3. Don't duplicate code. A few libraries and scripts had re-implemented
stdnse.generate_random_string or openssl.rand_bytes.
2014-09-03 04:49:54 +00:00
batrick
536075d3af stdnse.print_debug -> stdnse.debug
$ sed -i 's/stdnse.print_debug("[-a-z0-9]*:\s*\([^"]*\)"/stdnse.debug1("\1"/' *.nse
$ sed -i 's/stdnse.print_debug(\([0-9]*\),\s*"[-a-z0-9]*:\s*\([^"]*\)"/stdnse.debug\1("\2"/' *.nse

Except:
  o eap-info.nse
  o oracle-brute.nse

Modified:
  o couchdb-databases.nse
  o couchdb-stats.nse
  o http-open-redirect.nse
2014-08-01 23:04:55 +00:00
batrick
2a8c81c4f6 stdnse.print_debug -> stdnse.debug1
$ sed -i 's/stdnse.print_debug("%s \([^"]*\)", SCRIPT_NAME/stdnse.debug1("\1"/' *.nse
2014-08-01 21:35:56 +00:00
dmiller
7170837c8b Add @usage nsedoc to UDP scripts (default is missing -sU in this case) 2014-04-11 16:42:26 +00:00
dmiller
c7d4f2ec96 Re-indent some scripts. Whitespace-only commit
https://secwiki.org/w/Nmap/Code_Standards
2014-01-31 21:01: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
batrick
5a68e5f04a Set the math.randomseed value in nse_main.lua on behalf of scripts.
Since Lua uses the C rand and srand functions, which have a static
seed for the entire program, we don't want scripts doing this themselves.
2011-05-23 21:43:46 +00:00
david
3ae3339cb7 Make the set of script "default and intrusive" empty.
These scripts got removed from default:
	dhcp-discover
	dns-zone-transfer

These scripts got removed from intrusive:
	dns-recursion
	ftp-bounce
	http-open-proxy
	socks-open-proxy

Thanks to Toni for noticing these.
2011-04-30 19:21:38 +00:00
david
d668c758e0 Join an NSEDoc comment to get @output. 2011-04-30 09:35:28 +00:00
david
ec4db04494 Add checks for nmap.address_family == "inet" to scripts that require
that. Patch by Henri Doreau.
2011-04-19 18:09:15 +00:00
kris
ede2a10048 remove a stale comment 2010-09-29 02:07:41 +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
david
3c89e089fc Change calls in these forms:
socket:connect(host.ip, port.number)
socket:connect(host.ip, port.number, port.protocol)

to this:

socket:connect(host, port)

connect can take host and port tables now, and the default protocol is
taken from the port table if possible.
2010-08-16 18:59:30 +00:00
david
b9633ed69b Do copyediting of NSEDoc. This is a first pass up to ms-sql-xp-cmdshell. 2010-07-09 23:32:18 +00:00
ron
ab654ecc34 Fixed a bug in dhcp-discover -- the read_boolean() function appears to never have worked, but I didn't run into anything that returned a boolean value until Brandon tried running it. It now handles booleans properly, along with a lot of extra debug output (especially on -d2 and higher) 2010-04-07 21:47:22 +00:00
ron
398ecbcb62 Improved error handling (and messages) on dhcp-discover.nse. Hoping to track down a problem reported to me by Brandon Enright. 2010-04-07 21:03:51 +00:00
david
4332937a74 Fix typo. 2010-04-07 14:35:31 +00:00
david
5fa554266b Fix NSEDoc. 2010-03-31 20:28:14 +00:00
fyodor
77ab5c4305 Remove email addresses from scripts as discussed in this thread: http://seclists.org/nmap-dev/2009/q4/466 2009-11-24 08:49:02 +00:00
ron
08da8db7f0 Importing changes from my branch. There are two major updates:
1) I wrote a function that formats output from scripts in a consistent way. Although we haven't really come to a concensus on how it should look yet, it's easy to change when we do. 
2) New script: smb-enum-groups.nse. Enumerate the local groups on a system and their membership.
2009-11-20 16:05:06 +00:00
fyodor
fea1ab7c39 Moved a bunch of scripts to the "safe" category, and some others to "intrusive" after
discussion on nmap-dev about how best to handle these.  I also updated the docs and
am about to regenerate script.db.  See this thread for more info:
http://seclists.org/nmap-dev/2009/q3/1008.html
2009-10-01 19:07:16 +00:00
david
0a479a45fa Fix a typo in dhcp-discover.nse. 2009-09-10 14:18:02 +00:00
ron
9465a839c1 Added dhcp-discover script 2009-09-10 03:26:53 +00:00