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

Fix NSEdoc generation problems due to block ordering

Reported here: http://seclists.org/nmap-dev/2014/q2/258

Complicated parsing issue, but short version is this: The NSEdoc for
scripts must not be followed by a local declaration, or it will not be
accepted. Easiest way is to be sure the block with @usage, @output,
@args, @xmloutput, etc. comes right before the author line.
This commit is contained in:
dmiller
2014-05-21 19:06:50 +00:00
parent f2e162d224
commit ba5f207d94
4 changed files with 33 additions and 34 deletions

View File

@@ -1,3 +1,12 @@
local mysql = require "mysql"
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
local vulns = require "vulns"
local openssl = stdnse.silent_require "openssl"
description = [[ description = [[
Attempts to bypass authentication in MySQL and MariaDB servers by Attempts to bypass authentication in MySQL and MariaDB servers by
@@ -70,15 +79,6 @@ Interesting post about this vuln:
-- @args mysql-vuln-cve2012-2122.socket_timeout Socket timeout. Default: 5s. -- @args mysql-vuln-cve2012-2122.socket_timeout Socket timeout. Default: 5s.
--- ---
local mysql = require "mysql"
local nmap = require "nmap"
local shortport = require "shortport"
local stdnse = require "stdnse"
local string = require "string"
local table = require "table"
local vulns = require "vulns"
local openssl = stdnse.silent_require "openssl"
author = "Paulino Calderon <calderon@websec.mx>" author = "Paulino Calderon <calderon@websec.mx>"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html" license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery", "intrusive", "vuln"} categories = {"discovery", "intrusive", "vuln"}

View File

@@ -38,6 +38,10 @@ The output is intended to resemble the output of the UNIX <code>ls</code> comman
-- @args smb-ls.checksum [optional] download each file and calculate a SHA1 checksum -- @args smb-ls.checksum [optional] download each file and calculate a SHA1 checksum
-- --
author = "Patrik Karlsson"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery", "safe"}
local arg_share = stdnse.get_script_args(SCRIPT_NAME .. '.share') local arg_share = stdnse.get_script_args(SCRIPT_NAME .. '.share')
local arg_path = stdnse.get_script_args(SCRIPT_NAME .. '.path') local arg_path = stdnse.get_script_args(SCRIPT_NAME .. '.path')
local arg_pattern = stdnse.get_script_args(SCRIPT_NAME .. '.pattern') or '*' local arg_pattern = stdnse.get_script_args(SCRIPT_NAME .. '.pattern') or '*'
@@ -45,10 +49,6 @@ local arg_maxfiles = tonumber(stdnse.get_script_args(SCRIPT_NAME .. '.maxfiles')
local arg_maxdepth = tonumber(stdnse.get_script_args(SCRIPT_NAME .. '.maxdepth')) local arg_maxdepth = tonumber(stdnse.get_script_args(SCRIPT_NAME .. '.maxdepth'))
local arg_checksum = stdnse.get_script_args(SCRIPT_NAME .. '.checksum') local arg_checksum = stdnse.get_script_args(SCRIPT_NAME .. '.checksum')
author = "Patrik Karlsson"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery", "safe"}
hostrule = function(host) hostrule = function(host)
return ( smb.get_port(host) ~= nil and arg_share and arg_path ) return ( smb.get_port(host) ~= nil and arg_share and arg_path )
end end

View File

@@ -19,15 +19,6 @@ Original idea by Jacob Appelbaum and his TeaTime and tlsdate tools:
* https://github.com/ioerror/tlsdate * https://github.com/ioerror/tlsdate
]] ]]
author = "Aleksandar Nikolic"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery", "safe", "default"}
portrule = function(host, port)
return shortport.ssl(host, port) or sslcert.isPortSupported(port)
end
--- ---
-- @usage -- @usage
-- nmap <target> --script=ssl-date -- nmap <target> --script=ssl-date
@@ -41,6 +32,14 @@ end
-- <elem key="date">2012-08-02T18:29:31+00:00</elem> -- <elem key="date">2012-08-02T18:29:31+00:00</elem>
-- <elem key="delta">4</elem> -- <elem key="delta">4</elem>
author = "Aleksandar Nikolic"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = {"discovery", "safe", "default"}
portrule = function(host, port)
return shortport.ssl(host, port) or sslcert.isPortSupported(port)
end
-- --
-- most of the code snatched from tls-nextprotoneg until we decide if we want a separate library -- most of the code snatched from tls-nextprotoneg until we decide if we want a separate library
-- --

View File

@@ -1,3 +1,15 @@
local bin = require('bin')
local match = require('match')
local nmap = require('nmap')
local shortport = require('shortport')
local sslcert = require('sslcert')
local stdnse = require('stdnse')
local string = require('string')
local table = require('table')
local vulns = require('vulns')
local have_tls, tls = pcall(require,'tls')
assert(have_tls, "This script requires the tls.lua library from http://nmap.org/nsedoc/lib/tls.html")
description = [[ description = [[
Detects whether a server is vulnerable to the OpenSSL Heartbleed bug (CVE-2014-0160). Detects whether a server is vulnerable to the OpenSSL Heartbleed bug (CVE-2014-0160).
The code is based on the Python script ssltest.py authored by Jared Stafford (jspenguin@jspenguin.org) The code is based on the Python script ssltest.py authored by Jared Stafford (jspenguin@jspenguin.org)
@@ -27,18 +39,6 @@ The code is based on the Python script ssltest.py authored by Jared Stafford (js
-- @args ssl-heartbleed.protocols (default tries all) TLS 1.0, TLS 1.1, or TLS 1.2 -- @args ssl-heartbleed.protocols (default tries all) TLS 1.0, TLS 1.1, or TLS 1.2
-- --
local bin = require('bin')
local match = require('match')
local nmap = require('nmap')
local shortport = require('shortport')
local sslcert = require('sslcert')
local stdnse = require('stdnse')
local string = require('string')
local table = require('table')
local vulns = require('vulns')
local have_tls, tls = pcall(require,'tls')
assert(have_tls, "This script requires the tls.lua library from http://nmap.org/nsedoc/lib/tls.html")
author = "Patrik Karlsson <patrik@cqure.net>" author = "Patrik Karlsson <patrik@cqure.net>"
license = "Same as Nmap--See http://nmap.org/book/man-legal.html" license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
categories = { "vuln", "safe" } categories = { "vuln", "safe" }