mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
NSEdoc fixes
This commit is contained in:
@@ -357,8 +357,8 @@ Options = {
|
||||
return (val == "true" or val == true or tonumber(val) == 1)
|
||||
end,
|
||||
|
||||
--- Sets the brute mode to either iterate over users or passwords
|
||||
-- @see description for more information.
|
||||
--- Sets the brute mode to either iterate over users or passwords.
|
||||
-- See description for more information.
|
||||
--
|
||||
-- @param mode string containing either "user" or "password"
|
||||
-- @return status true on success else false
|
||||
|
||||
@@ -26,7 +26,7 @@ local crlf_pattern = "\r?\n"
|
||||
-- @return code The numeric response code, as returned by read_reply, or error message if socket is nil.
|
||||
-- @return message The response message
|
||||
-- @return buffer The socket read buffer function, to be passed to read_reply.
|
||||
-- @see comm.lua
|
||||
-- @see comm
|
||||
connect = function(host, port, opts)
|
||||
opts = opts or {}
|
||||
opts.recv_before = true
|
||||
|
||||
@@ -72,7 +72,7 @@ function publickey_canauth(session, username, publickeydata)
|
||||
-- @param session Authenticated libssh2 session
|
||||
-- @param no_pty If true, skip requesting a PTY.
|
||||
-- @return libssh2 channel
|
||||
function open_channel(session, pty)
|
||||
function open_channel(session, no_pty)
|
||||
|
||||
--- Reads data from stdin on libssh2 channel.
|
||||
-- @param session Authenticated libssh2 session
|
||||
|
||||
@@ -267,7 +267,7 @@ Session = {
|
||||
--- Prepares and sends the challenge response authentication to the server
|
||||
-- @name Session.authenticate
|
||||
-- @param request instance of the request object requiring authentication
|
||||
-- @param authdata string containing authentication data
|
||||
-- @param response string containing authentication data
|
||||
-- @return status true on success false on failure
|
||||
-- @return err string containing an error message if status is false
|
||||
authenticate = function(self, request, response)
|
||||
@@ -582,7 +582,7 @@ Request = {
|
||||
|
||||
--- Sets the request content data
|
||||
-- @name Request.setContent
|
||||
-- @param string containing the content data
|
||||
-- @param content string containing the content data
|
||||
setContent = function(self, content) self.content = content end,
|
||||
|
||||
--- Sets the requests' content type
|
||||
|
||||
@@ -192,7 +192,7 @@ parser = {
|
||||
unescape = function(str) return string.gsub( str, '(&(#?)([%d%a]+);)', entitySwap ) end,
|
||||
|
||||
--- Parses the xml in sax like manner.
|
||||
-- @self The parser object.
|
||||
-- @param self The parser object.
|
||||
-- @param xml The xml body to be parsed.
|
||||
-- @param options Options if any specified.
|
||||
parseSAX = function(self, xml, options)
|
||||
|
||||
@@ -458,7 +458,7 @@ function start_raw(host, port)
|
||||
return true, socket
|
||||
end
|
||||
|
||||
--- This function will take a string like "a.b.c.d" and return "a", "a.b", "a.b.c", and "a.b.c.d".
|
||||
-- This function will take a string like "a.b.c.d" and return "a", "a.b", "a.b.c", and "a.b.c.d".
|
||||
--
|
||||
-- This is used for discovering NetBIOS names. If a NetBIOS name is unknown, the substrings of the
|
||||
-- DNS name can be used in this way.
|
||||
@@ -687,7 +687,7 @@ function smb_encode_header(smb, command, overrides)
|
||||
return header
|
||||
end
|
||||
|
||||
--- Converts a string containing the parameters section into the encoded
|
||||
-- Converts a string containing the parameters section into the encoded
|
||||
-- parameters string.
|
||||
--
|
||||
-- The encoding is simple:
|
||||
@@ -705,7 +705,7 @@ local function smb_encode_parameters(parameters, overrides)
|
||||
return string.pack("<B", overrides['parameters_length'] or (#parameters / 2)) .. parameters
|
||||
end
|
||||
|
||||
--- Converts a string containing the data section into the encoded data string.
|
||||
-- Converts a string containing the data section into the encoded data string.
|
||||
--
|
||||
-- The encoding is simple:
|
||||
-- * (2 bytes) The number of bytes in the data section
|
||||
@@ -722,7 +722,7 @@ local function smb_encode_data(data, overrides)
|
||||
return string.pack("<I2", overrides['data_length'] or #data) .. data
|
||||
end
|
||||
|
||||
---Sign the message, if possible. This is done by replacing the signature with the sequence
|
||||
--Sign the message, if possible. This is done by replacing the signature with the sequence
|
||||
-- number, creating a hash, then putting that hash in the signature location.
|
||||
--@param smb The smb state object.
|
||||
--@param body The body of the packet that's being signed.
|
||||
@@ -749,7 +749,7 @@ local function message_sign(smb, body)
|
||||
return string.sub(body, 1, 14) .. signature .. string.sub(body, 23)
|
||||
end
|
||||
|
||||
---Check the signature of the message.
|
||||
--Check the signature of the message.
|
||||
--
|
||||
-- This is the opposite of <code>message_sign</code>, and works the same way
|
||||
-- (replaces the signature with the sequence number, calculates hash, checks)
|
||||
@@ -2142,7 +2142,7 @@ function delete_file(smb, path, overrides)
|
||||
return true
|
||||
end
|
||||
|
||||
---
|
||||
--
|
||||
-- Implements SMB_COM_TRANSACTION2 to support the find_files function
|
||||
-- This function has not been extensively tested
|
||||
--
|
||||
|
||||
@@ -322,7 +322,7 @@ function init_account(host)
|
||||
end
|
||||
end
|
||||
|
||||
---Generate the Lanman v1 hash (LMv1).
|
||||
--Generate the Lanman v1 hash (LMv1).
|
||||
--
|
||||
-- The generated hash is incredibly easy to reverse, because the input is
|
||||
-- padded or truncated to 14 characters, then split into two 7-character
|
||||
@@ -628,7 +628,7 @@ end
|
||||
-- be generated properly).
|
||||
--@return lm_response, to be send directly back to the server
|
||||
--@return ntlm_response, to be send directly back to the server
|
||||
--@reutrn mac_key used for message signing.
|
||||
--@return mac_key used for message signing.
|
||||
function get_password_response(ip, username, domain, password, password_hash, hash_type, challenge, is_extended)
|
||||
local status
|
||||
local lm_hash = nil
|
||||
|
||||
@@ -151,7 +151,7 @@ end
|
||||
local version_to_num = {v1=0, v2c=1}
|
||||
local num_to_version = {[0]="v1", [1]="v2c"}
|
||||
|
||||
--- Returns the numerical value of a given SNMP protocol version
|
||||
-- Returns the numerical value of a given SNMP protocol version
|
||||
--
|
||||
-- Numerical input is simply passed through, assuming it is valid.
|
||||
-- String input is translated to its corresponding numerical value.
|
||||
@@ -549,7 +549,7 @@ Helper = {
|
||||
-- @param options SNMP options table
|
||||
-- @see snmp.options
|
||||
-- @param oid Object identifiers of object to be set.
|
||||
-- @param value To which value object should be set. If given a table,
|
||||
-- @param setparam To which value object should be set. If given a table,
|
||||
-- use the table instead of OID/value pair.
|
||||
-- @return status False if error, true otherwise
|
||||
-- @return Table with all decoded responses and their OIDs.
|
||||
|
||||
@@ -643,7 +643,7 @@ end
|
||||
-- => mode = "timed"
|
||||
-- => domains = {"host1","host2"}
|
||||
--
|
||||
-- @param Arguments Script arguments to check.
|
||||
-- @param ... Script arguments to check.
|
||||
-- @return Arguments values.
|
||||
function get_script_args (...)
|
||||
local args = {}
|
||||
|
||||
@@ -41,14 +41,13 @@ end
|
||||
|
||||
--- Split a string at a given delimiter, which may be a pattern.
|
||||
--
|
||||
-- If you want to loop over the resulting values, consider using string.gmatch instead.
|
||||
-- If you want to loop over the resulting values, consider using <code>string.gmatch</code> instead.
|
||||
-- @usage
|
||||
-- stringaux.strsplit(",%s*", "Anna, Bob, Charlie, Dolores")
|
||||
-- --> { "Anna", "Bob", "Charlie", "Dolores" }
|
||||
-- @param pattern Pattern that separates the desired strings.
|
||||
-- @param text String to split.
|
||||
-- @return Array of substrings without the separating pattern.
|
||||
-- @see string.gmatch
|
||||
function strsplit(pattern, text)
|
||||
local list, pos = {}, 1;
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ end
|
||||
--- Check for the presence of a value in a table
|
||||
--@param t the table to search into
|
||||
--@param item the searched value
|
||||
--@array (optional) If true, then use ipairs to only search the array indices of the table.
|
||||
--@param array (optional) If true, then use ipairs to only search the array indices of the table.
|
||||
--@return Boolean true if the item was found, false if not
|
||||
--@return The index or key where the value was found, or nil
|
||||
function contains(t, item, array)
|
||||
|
||||
@@ -60,7 +60,7 @@ end
|
||||
--
|
||||
-- Only prerule, portrule and hostrule scripts can add new targets.
|
||||
--
|
||||
-- @param targets A variable number of targets. Target is a
|
||||
-- @param ... A variable number of targets. Target is a
|
||||
-- string that represents an IP or a Hostname. If this function
|
||||
-- is called without target arguments then it will return true
|
||||
-- and the number of pending targets (waiting to be scanned).
|
||||
|
||||
@@ -324,8 +324,8 @@ Telnet = {
|
||||
-- Buffer addresses can come in 14 or 12 (this terminal doesn't support 16 bit)
|
||||
-- this function takes two bytes (buffer addresses are two bytes long) and returns
|
||||
-- the decoded buffer address.
|
||||
-- @param1 unsigned char, first byte of buffer address.
|
||||
-- @param2 unsigned char, second byte of buffer address.
|
||||
-- @param unsigned char, first byte of buffer address.
|
||||
-- @param unsigned char, second byte of buffer address.
|
||||
-- @return integer of buffer address
|
||||
DECODE_BADDR = function ( byte1, byte2 )
|
||||
if (byte1 & 0xC0) == 0 then
|
||||
@@ -339,7 +339,7 @@ Telnet = {
|
||||
|
||||
--- Encode Buffer Address
|
||||
--
|
||||
-- @param integer buffer address
|
||||
-- @param address integer buffer address
|
||||
-- @return TN3270 encoded buffer address (12 bit) as string
|
||||
ENCODE_BADDR = function ( self, address )
|
||||
stdnse.debug(3, "Encoding Address: %s", address)
|
||||
@@ -842,7 +842,7 @@ Telnet = {
|
||||
|
||||
--- WCC / tn3270 data stream processor
|
||||
--
|
||||
-- @param tn3270 data stream
|
||||
-- @param data tn3270 data stream
|
||||
-- @return status true on success, false on failure
|
||||
-- @return changes self.buffer to match requested changes
|
||||
process_write = function ( self, data )
|
||||
@@ -1065,7 +1065,7 @@ Telnet = {
|
||||
--- Sends TN3270 Packet
|
||||
--
|
||||
-- Expands IAC to IAC IAC and finally appends IAC EOR
|
||||
-- @param data: table containing buffer array
|
||||
-- @param data table containing buffer array
|
||||
send_tn3270 = function ( self, data )
|
||||
local packet = ''
|
||||
if self.state == self.TN3270E_DATA then
|
||||
@@ -1164,8 +1164,8 @@ Telnet = {
|
||||
--- Sends the data to the location specified
|
||||
--
|
||||
-- Using a location on the screen sends the data
|
||||
-- @param location: a location on the screen (between 0 and 1920)
|
||||
-- @param data: ascii data to send to that location
|
||||
-- @param location a location on the screen (between 0 and 1920)
|
||||
-- @param data ascii data to send to that location
|
||||
send_location = function( self, location, data )
|
||||
local cursor_location = location + #data
|
||||
local ebcdic_letter = ''
|
||||
@@ -1191,7 +1191,7 @@ Telnet = {
|
||||
--
|
||||
-- Using a supplied tuple of location and data generates tn3270 data to
|
||||
-- fill out the screen
|
||||
-- @param location_tuple: and array of tuples with location and data. For
|
||||
-- @param location_tuple and array of tuples with location and data. For
|
||||
-- example: send_locations([{579:"dade"},{630:"secret"}])
|
||||
send_locations = function( self, location_tuple )
|
||||
local cursor_location = location_tuple[#location_tuple][1] + #location_tuple[#location_tuple][2]
|
||||
@@ -1303,7 +1303,7 @@ Telnet = {
|
||||
|
||||
--- Any Hidden Fields
|
||||
--
|
||||
-- @returns true if there are any hidden fields in the buffer
|
||||
-- @return true if there are any hidden fields in the buffer
|
||||
any_hidden = function ( self )
|
||||
local hidden_attrib = 0x0c -- 00001100 is hidden
|
||||
for i = 0,#self.fa_buffer do
|
||||
@@ -1315,7 +1315,7 @@ Telnet = {
|
||||
|
||||
--- Hidden Fields
|
||||
--
|
||||
-- @returns the locations of hidden fields in a table with each pair being the start and stop of the hidden field
|
||||
-- @return the locations of hidden fields in a table with each pair being the start and stop of the hidden field
|
||||
hidden_fields_location = function ( self )
|
||||
local hidden_attrib = 0x0c -- 00001100 is hidden
|
||||
local hidden_location = {}
|
||||
|
||||
@@ -672,7 +672,7 @@ Packet.Unknown1 = {
|
||||
|
||||
--- Creates a new Packet.Unknown1
|
||||
--
|
||||
-- @param version containing the version of the packet to send
|
||||
-- @param os string containing the version of the packet to send
|
||||
-- @return new instance of Packet.Unknown1
|
||||
new = function(self, os)
|
||||
local o = { os = os }
|
||||
@@ -1690,7 +1690,7 @@ Helper = {
|
||||
--- Authenticates to the database
|
||||
--
|
||||
-- @param user containing the Oracle user name
|
||||
-- @param pass containing the Oracle user password
|
||||
-- @param password containing the Oracle user password
|
||||
-- @return true on success, false on failure
|
||||
-- @return err containing error message when status is false
|
||||
Login = function( self, user, password )
|
||||
@@ -1720,7 +1720,7 @@ Helper = {
|
||||
|
||||
--- Steal auth data from database
|
||||
-- @param user containing the Oracle user name
|
||||
-- @param pass containing the Oracle user password
|
||||
-- @param password containing the Oracle user password
|
||||
-- @return true on success, false on failure
|
||||
-- @return err containing error message when status is false
|
||||
StealthLogin = function( self, user, password )
|
||||
|
||||
@@ -235,6 +235,8 @@ end
|
||||
-- @class function
|
||||
--@param cp The Unicode code point as a number
|
||||
--@return A string containing the code point in UTF-8 encoding.
|
||||
--@class function
|
||||
--@name utf8_enc
|
||||
utf8_enc = utf8.char
|
||||
|
||||
---Decodes a UTF-8 character.
|
||||
|
||||
@@ -427,7 +427,7 @@ Helper = {
|
||||
-- @param username string
|
||||
-- @param password string
|
||||
-- @param mech string containing a supported authentication mechanism
|
||||
-- @see Helper.getAuthMechs
|
||||
-- @see XMPP.getAuthMechs
|
||||
-- @return status true on success, false on failure
|
||||
-- @return err string containing error message if status is false
|
||||
login = function(self, username, password, mech)
|
||||
|
||||
@@ -8,6 +8,9 @@ author = {"Alessandro ZANNI <alessandro.zanni@bt.com>", "Daniel Miller"}
|
||||
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
|
||||
categories = {"default","safe","discovery","version"}
|
||||
|
||||
---@output
|
||||
--|_weblogic-t3-info: T3 protocol in use (WebLogic version: 12.1.2)
|
||||
|
||||
portrule = function(host, port)
|
||||
if type(port.version) == "table" and port.version.name_confidence > 3 and port.version.product ~= nil then
|
||||
return string.find(port.version.product, "WebLogic", 1, true) and nmap.version_intensity() >= 7
|
||||
|
||||
Reference in New Issue
Block a user