1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 14:11:29 +00:00
Commit Graph

33 Commits

Author SHA1 Message Date
dmiller
0500811f5a Move string utility functions to stringaux.lua 2018-10-18 01:08:19 +00:00
dmiller
16504696a5 Move length checks to before string.unpack to avoid throwing errors 2018-09-05 19:01:51 +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
tomsellers
1663733bb8 Fix handling of objectSID by ldap.lua Closes #938 2017-07-16 16:07:45 +00:00
dmiller
4cef14a873 Switch to string packing instead of bin packing and return order for asn1-related libs 2017-03-29 20:42:01 +00:00
dmiller
85e10c6b2b Use byte values instead of hex strings for ASN.1 types, avoiding upper/lower case mixups 2017-03-29 20:41:57 +00:00
dmiller
92f52de958 Remove trailing whitespace 2016-08-29 20:30:26 +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
tomsellers
ee4ed66956 Added support for LDAP over udp to ldap-rootdse.nse.
Also added version detection and information extraction to match the
new LDAP LDAPSearchReq and LDAPSearchReqUDP probes. Closes #362
2016-04-09 21:33:26 +00:00
dmiller
f4619edece Update http urls for nmap.org to https 2015-11-05 20:41:05 +00:00
dmiller
e2bfa97920 Replace instances of bin.pack('A', x), which is equivalent to tostring(x), and a no-op on strings 2015-03-03 04:48:18 +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
c1b2429efd Remove some more creative ways of building a literal byte 2015-03-02 13:47:45 +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
3dcf997d60 Fix NSEdoc errors
1. All @table blocks must have an explicit @name
2. All @field blocks must have both a name and description

Also added some more information to the creds.States table description
2014-03-08 14:02:06 +00:00
dmiller
e296cdea2a Fix some @see NSEdoc
https://secwiki.org/w/Nmap/Code_Standards#NSEdoc_best-practices
2014-03-04 17:04:58 +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
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
tomsellers
41145a414c Added support for the LDAP extensibleMatch filter to ldap.lua. LDAP searches using this take the following format:
attributename:ruleOID:=value

for example the following finds AD Domain controllers:

(userAccountControl:1.2.840.113556.1.4.803:=8192)

Also added the above as a quickfilter (ad_dcs) to ldap-search.nse to serve as a code example.

Added documentation to explain the values used in some field.
2011-10-31 00:27:03 +00:00
tomsellers
bca60ba8de Added support for LDAP substring searches to ldap.lua. These can now be performed alone or in conjunction with other LDAP query types.
Added a new quick filter (qfilter) to ldap-search.nse that allows the user to specify, on the command line, an attribute and corresponding value to search the LDAP directory for.  The use of the asterisk '*' as a wildcard is permitted in the value parameter.

Updated asn1.lua with some minor notes on a hex value that was used.
2011-10-29 10:18:52 +00:00
tomsellers
c193cadac7 Fix a typo 2011-09-05 22:44:08 +00:00
tomsellers
f6dc7a160d ldap.lua - added support for saving search results to CSV.
Also added support for decoding certain time formats found in Microsoft AD such as lastLogon,pwdLastSet, etc
2011-09-05 22:39:03 +00:00
patrik
8ff4e89019 Added new error messages for error codes
Added the 8A tagdecoder
Modified the output of error messages slightly
[Patrik]
2011-05-22 14:43:08 +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
patrik
937b2df7dd changed the extractAttribute function to be case insensitive when retrieving
attributes.
2010-11-04 19:53:01 +00:00
david
7d0c08a097 Brief copyediting of NSEDoc for modules. 2010-07-12 19:42:43 +00:00
david
5fa554266b Fix NSEDoc. 2010-03-31 20:28:14 +00:00
patrik
42da3e0ba0 o [NSE] Added a new library for LDAP and two new scripts:
- ldap-brute uses the unpwdb library to guess credentials for LDAP
  - ldap-rootdse retrieves the LDAP root DSA-specific Entry (DSE)
2010-02-21 08:52:44 +00:00