mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +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:
@@ -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 = [[
|
||||
|
||||
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.
|
||||
---
|
||||
|
||||
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>"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
categories = {"discovery", "intrusive", "vuln"}
|
||||
|
||||
@@ -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
|
||||
--
|
||||
|
||||
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_path = stdnse.get_script_args(SCRIPT_NAME .. '.path')
|
||||
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_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)
|
||||
return ( smb.get_port(host) ~= nil and arg_share and arg_path )
|
||||
end
|
||||
|
||||
@@ -19,15 +19,6 @@ Original idea by Jacob Appelbaum and his TeaTime and tlsdate tools:
|
||||
* 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
|
||||
-- nmap <target> --script=ssl-date
|
||||
@@ -41,6 +32,14 @@ end
|
||||
-- <elem key="date">2012-08-02T18:29:31+00:00</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
|
||||
--
|
||||
|
||||
@@ -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 = [[
|
||||
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)
|
||||
@@ -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
|
||||
--
|
||||
|
||||
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>"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
categories = { "vuln", "safe" }
|
||||
|
||||
Reference in New Issue
Block a user