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

79 Commits

Author SHA1 Message Date
nnposter
be409657c2 Replace references to stdnse.strjoin with stringaux.strjoin. See #1720 2019-09-01 02:07:19 +00:00
ron
467b06008e Add permissions to openscmanagerw() in msrpc.lua, allowing the caller to specify the permissions they need. 2018-10-22 17:29:49 +00:00
dmiller
0500811f5a Move string utility functions to stringaux.lua 2018-10-18 01:08:19 +00:00
dmiller
00ec940ead Replace bin.lua packing in msrpc libraries 2018-09-19 21:43:44 +00:00
dmiller
e0af0179eb Remove use of bit library from all NSE libs 2018-08-28 15:21:53 +00:00
dmiller
46eca7f35f Move date/time functions from stdnse to datetime. See #517 2018-08-27 22:00:10 +00:00
dmiller
6c4e02e89d Use stdnse.format_timestamp in more places to avoid formatting issues. See #1255, #1303 2018-08-16 21:26:48 +00:00
dmiller
689ea0e05d Spelling corrections. Fixes #1160 2018-03-26 14:59:41 +00:00
rewanth
8e717e1694 Adds NSE script for smb-enum-services and its support functions. Closes #987. 2017-09-05 18:19:11 +00:00
rewanth
0a33672e18 Fixes bug in debug statement in msrpc.lua 2017-08-25 05:32:29 +00:00
rewanth
6ee953a5ff Removes trailing spaces in 69 files. Closes #971. 2017-08-23 08:52:40 +00:00
dmiller
dff7eca79f Fix some globals 2017-07-18 18:46:01 +00:00
paulino
ba992765b3 Closes smb connection properly. 2017-05-29 19:48:35 +00:00
paulino
850ae6ef52 Instead of requesting less information, let's try access level 2 first then fallback to 1 if necessary. 2017-05-29 19:47:26 +00:00
paulino
b0228a212b Updates smb.lua and msrpc.lua to support fully qualified path names as share names and updates match for OID. Modern Windows versions require FQPN and older version work the same. The level of information requested with the call NetShareGetInfo was reduced to support newer versions of Windows. This closes #266, closes #704, closes #238, and closes #883. 2017-05-27 07:28:44 +00:00
dmiller
f89d7610b0 Replace IP address parsing with functions from ipOps 2017-03-14 18:59:12 +00:00
dmiller
f4619edece Update http urls for nmap.org to https 2015-11-05 20:41:05 +00:00
dmiller
9840973b60 Fix format string argument mismatches
Cases where the format string does not contain any placeholders, but
values are given anyway. Cases where string.format is used without any
placeholders or arguments.
2015-09-18 12:40:32 +00:00
dmiller
a954950b5a Remove some unneeded local declarations of loop variables 2015-09-18 12:40:30 +00:00
dmiller
c1b2429efd Remove some more creative ways of building a literal byte 2015-03-02 13:47:45 +00:00
dmiller
ea58c6bebb Replace chained concatenation reassignment with simple concatenation
Example:

x = y
x = x .. z

Fixed:

x = y
.. z

This simple fix would save 1 string creation/deletion. Most changes
involve many more than this.
2015-03-02 13:47:42 +00:00
dmiller
0e74dd7a35 Replace some string.char and bin.pack calls with literals 2015-02-27 19:42:56 +00:00
dmiller
f6733b2d89 Replace msrpc.random_crap with stdnse.generate_random_string 2015-02-25 05:06:05 +00:00
dmiller
33adefaab6 Update several scripts and libraries to use stdnse.format_time 2014-09-05 02:54:39 +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
dmiller
2692746c42 NSEdoc cleanup
Mostly splitting function summaries (the first paragraph of NSEdoc) from
the body of the description to make the summary indexes shorter and
easier to scan.

Also fixed some unbalanced code tags like <code>foo</table>
2014-09-02 18:23:06 +00:00
batrick
4b9f1c6766 nselib stdnse.print_debug -> stdnse.debug
Manual fixes.
2014-08-03 01:17:09 +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
ddcfa8cc90 Spellcheck: common misspellings in the entire source tree 2014-02-21 21:10:51 +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
a084340b6d Remove useless calls to string.format
stdnse.print_debug accepts a format string and arguments, making
string.format redundant in calls of this form:

stdnse.print_debug(1, string.format("%s: error", SCRIPT_NAME))
stdnse.print_debug(("length %d"):format(#tab))

These can be rewritten as:

stdnse.print_debug(1, "%s: error", SCRIPT_NAME)
stdnse.print_debug("length %d", #tab)
2014-02-13 15:47:41 +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
patrik
f9e457ec7c nse-check-globals cleanup 2012-08-31 15:22:29 +00:00
aca
c13d7c719a Added msrpc-enum script and msrpc lua changes 2012-08-31 10:00:54 +00:00
aca
68b2efd3db Merged msrpc changes from my branch, including spoolss functionality 2012-07-30 09:39:23 +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
2de40c99b4 o [NSE] Added the script samba-vuln-cve-2012-1182 which detects the SAMBA CVE
2012-1182 vulnerability. [Aleksandar Nikolic]
2012-04-21 22:44:23 +00:00
patrik
5558837091 o [NSE] Added two new scripts broadcast-netbios-master-browser and smb-mbenum:
- broadcast-netbios-master-browser attempts to discover master browsers in
    the broadcast domain
  - smb-mbenum lists servers registered with the master browser
  [Patrik]
2011-06-19 18:47:19 +00:00
batrick
4444071f03 use # length operator instead of string.len (canonicalize)
Used this perl command:

$ # perl -pi -e 's/string\.len\((.*?)\)/#\1/g' *.lua

Also fixed one instance where the above command didn't correctly
translate the intended code (string.len(a .. b .. c)).
2011-05-11 15:08:55 +00:00
david
a9e4947411 Make msrpc.call_function a public function. stuxnet-detect.nse is about
to need this, and Dražen had to do it too while he was working on the
NDR library.
2010-12-12 22:40:41 +00:00
ron
f71008bcd3 Fixed a spelling mistake in a variable name in msrpc.lua 2010-09-24 03:38:11 +00:00
ron
11ad4fafd5 Fixed a nil-pointer exception caused by certain printers and OS X machines. An array in the result was set to nil instead of 0-length, which was unexpected. 2010-09-24 01:22:36 +00:00
david
7d0c08a097 Brief copyediting of NSEDoc for modules. 2010-07-12 19:42:43 +00:00
david
32c8ee9f1f Fix some NSEDoc. 2010-06-24 17:01:55 +00:00
drazen
a99aa3b53b Added a check for the MS07-029 vulnerability within "smb-check-vulns".
Made some small changes to the function descriptions.
2010-06-13 02:55:26 +00:00
drazen
62c2d97f93 MS06-025:
-- Finished, tested and merged into smb-check-vulns
	-- msrpc.lua contains the code required to interface with the RASRPC interface
2010-06-12 19:32:50 +00:00
ron
f91c3d0136 Added a minor patch contributed by the Nepenthes Development Team. It changes the 'alloc hint' argument to be the expected value, which happens to be the size of the arguments, instead of the static value I was using. No target I've ever seen cares about the value of this argument, but this brings us slightly more in line with the standard 2010-06-09 01:31:28 +00:00
david
5fa554266b Fix NSEDoc. 2010-03-31 20:28:14 +00:00