1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

28 Commits

Author SHA1 Message Date
dmiller
1a7a96274a Avoid format-string bugs. Fixes #2634 2023-07-20 17:24:16 +00:00
dmiller
26ef852a28 Move stdnse.generate_random_string to new rand.lua 2018-09-08 17:07:06 +00:00
dmiller
f973b4b9f4 Correct an error in the fix for #1211 2018-05-15 17:00:59 +00:00
dmiller
0dbf3c9b16 Strip trailing whitespace when parsing torrent files. Fixes #1211 2018-05-14 18:19:10 +00:00
dmiller
6d93755fe6 Properly parse udp tracker port number 2018-05-04 05:10:55 +00:00
dmiller
fe4830dbf7 Check for response body from http trackers 2018-05-04 05:10:54 +00:00
dmiller
b0fddde9d7 Fix return values from calc_torrent_size; was always returning nil 2018-05-04 05:10:53 +00:00
dmiller
16e061ec2b Use bdecode function to parse buffer instead of reimplementing. Fixes #1203 2018-05-04 05:10:52 +00:00
dmiller
689ea0e05d Spelling corrections. Fixes #1160 2018-03-26 14:59:41 +00:00
dmiller
cc644955c4 Use string unpacking instead of manual bit manipulation in bittorrent.lua 2017-03-14 14:36:14 +00:00
dmiller
629e50a900 Replace bin.pack('H') calls with fromhex or equivalent simplifications 2017-03-14 14:36:12 +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
cb4b46bd53 Canonicalize authors as tables instead of comma-separated strings 2016-06-09 22:46:42 +00:00
dmiller
9450cb725a Avoid boolean tautologies of the form 'not x == y'
Lua operator 'not' has higher precedence than '==', so the statement

    not x == "something"

is equivalent to:

    (not x) == "something"

which will always be false, since the value of 'not x' will be either
'true' or 'false' and the string "something" is not the boolean 'true'
or 'false'. This is usually resolved by using the '~=' operator.
2016-05-23 04:30:06 +00:00
dmiller
f4619edece Update http urls for nmap.org to https 2015-11-05 20:41:05 +00:00
dmiller
4d106cbe23 Remove unneeded requires 2015-02-28 12:43:59 +00:00
dmiller
d16772a8a8 Simplify bencode parsing and random string gen in bittorrent.lua 2015-02-27 14:55:26 +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
tomsellers
74798d0356 Removed svn:execute property from certain .LUA scripts in the /nselib directory. This was enabling the execute bit on files when they were checked out. 2012-02-08 04:12:45 +00:00
batrick
2511cd1d2a fixed wrong (global) variable name 2011-09-16 18:33:52 +00:00
fyodor
726022d23f Slightly improve the nsedoc for a couple libraries 2011-09-11 21:21:17 +00:00
gorjan
aec7e1ab94 Add the architecture description in the bittorrent.lua library. 2011-08-11 09:54:38 +00:00
gorjan
88e8647381 Adding the bittorrent library and bittorrent-discovery script which enables you to add bittorrent peers and DHT nodes as targets for scanning 2011-08-09 16:56:13 +00:00