1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00
Commit Graph

33 Commits

Author SHA1 Message Date
dmiller
44a315b548 Fix a unit test in asn1.lua 2017-04-04 16:26:09 +00:00
dmiller
ffda9402f9 Correctly handle ASN.1 booleans (was opposite) and add unit tests. 2017-04-01 02:00:40 +00:00
dmiller
877136858f Tag decoder stub for Report-PDU 2017-03-29 20:58:37 +00:00
dmiller
783e0fb05c Replace bit.lua with bitwise ops in asn1.lua 2017-03-29 20:58:36 +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
49231a2782 Fix decoding of OID sequences caused by Lua 5.3 integer/number handling 2017-03-29 17:10:40 +00:00
dmiller
629e50a900 Replace bin.pack('H') calls with fromhex or equivalent simplifications 2017-03-14 14:36:12 +00:00
dmiller
963011520f Fix bugs where pos return value of bin.unpack was ignored 2016-07-21 17:05:24 +00:00
dmiller
28c06ce28b Fix up some NSEdoc in asn1.lua 2016-07-13 17:51:10 +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
f4619edece Update http urls for nmap.org to https 2015-11-05 20:41:05 +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
ec9074f718 Correct "it's" to "its" where necessary
it's = it is
its = belonging to it
2014-06-19 04:58:46 +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
4cef3889f1 Remove unused and redundant snmp.dec function 2014-03-03 22:34:25 +00:00
dmiller
d50c47d621 Remove duplicate decodeLength function 2014-03-03 22:34:23 +00:00
dmiller
a959de5685 Update asn1.lua NSEdoc
https://secwiki.org/w/Nmap/Code_Standards#NSEdoc_best-practices
2014-03-03 22:34:21 +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
961ea25225 Re-indent some NSE libraries.
https://secwiki.org/w/Nmap/Code_Standards
2014-02-03 19:47:34 +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
bc0defc8ff o [NSE] Added SPNEGO authentication supporting Windows 7 and Windows 2008 to
the smb library. [Patrik Karlsson]
2012-06-09 12:17:01 +00:00
patrik
721ac80024 reverted previous commit, due to unfinnished changes in smb, asn1 and smbauth
libraries.
2012-06-06 22:04:28 +00:00
patrik
c4617f8d31 Fixed a bunch of errors reported by Ron Bowes;
http://seclists.org/nmap-dev/2012/q2/639
2012-06-06 21:57:00 +00:00
david
aa6717eb1f Lua 5.2 fixed from Daniel Miller.
http://seclists.org/nmap-dev/2012/q2/525
2012-05-29 20:11:39 +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
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
patrik
33333da283 Added a new function setStopOnError to the ASN1 library. The function allows
the library to be set to a mode that will stop trying to decode a ASN1
structure as soon as it runs into a decoding error. [Patrik]
2011-10-20 02:44:20 +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
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
d2e54f0bf2 o [NSE] Added a new library for ASN.1 parsing and adapted the SNMP library to
make use of it. Added 5 scripts that use the new libraries:
  - snmp-netstat shows listening and connected sockets
  - snmp-processes shows process information including name, pid, path and 
    parameters
  - snmp-win32-services shows the names of running Windows services
  - snmp-win32-shares shows the names and path of Windows shares
  - snmp-win32-software shows a list of installed Windows software
  - snmp-win32-users shows a list of local Windows users
2010-02-16 09:15:38 +00:00