diff --git a/nselib/afp.lua b/nselib/afp.lua index 50ba485bb..f7b9e2af4 100644 --- a/nselib/afp.lua +++ b/nselib/afp.lua @@ -392,7 +392,7 @@ Response = { --- Sets the result -- - -- @param result + -- @param result result to set setResult = function(self, result) self.result = result end, @@ -588,7 +588,6 @@ Proto = { --- Sends an GetStatus DSI request (which is basically a FPGetSrvrInfo -- AFP request) to the server and handles the response -- - -- @param socket already connected to the server -- @return status (true or false) -- @return table with server information (if status is true) or error string -- (if status is false) @@ -1449,7 +1448,7 @@ Helper = { --- Reads a file on the AFP server -- - -- @param str_patch string containing the AFP sharepoint, path and filename eg. HR/Documents/File.doc + -- @param str_path string containing the AFP sharepoint, path and filename eg. HR/Documents/File.doc -- @return status boolean true on success, false on failure -- @return content string containing the file contents ReadFile = function( self, str_path ) @@ -1495,7 +1494,7 @@ Helper = { --- Writes a file to the AFP server -- - -- @param str_patch string containing the AFP sharepoint, path and filename eg. HR/Documents/File.doc + -- @param str_path string containing the AFP sharepoint, path and filename eg. HR/Documents/File.doc -- @param fdata string containing the data to write to the file -- @return status boolean true on success, false on failure -- @return error string containing error message if status is false diff --git a/nselib/asn1.lua b/nselib/asn1.lua index 9d747f370..88b07b432 100644 --- a/nselib/asn1.lua +++ b/nselib/asn1.lua @@ -80,7 +80,7 @@ ASN1Decoder = { --- Allows for registration of additional tag decoders -- - -- @param table containing decoding functions @see tagDecoders + -- @param tagDecoders table containing decoding functions @see tagDecoders registerTagDecoders = function(self, tagDecoders) self:registerBaseDecoders() for k, v in pairs(tagDecoders) do @@ -293,7 +293,7 @@ ASN1Encoder = { --- Allows for registration of additional tag encoders -- - -- @param table containing encoding functions @see tagEncoders + -- @param tagEncoders table containing encoding functions @see tagEncoders registerTagEncoders = function(self, tagEncoders) self:registerBaseEncoders() for k, v in pairs(tagEncoders) do @@ -389,7 +389,7 @@ ASN1Encoder = { --- -- Encodes the length part of a ASN.1 encoding triplet using the "primitive, -- definite-length" method. - -- @param val Value to be encoded. + -- @param len Length to be encoded. -- @return Encoded length value. encodeLength = function(len) if len < 128 then diff --git a/nselib/citrixxml.lua b/nselib/citrixxml.lua index 718b88c34..5060204bd 100644 --- a/nselib/citrixxml.lua +++ b/nselib/citrixxml.lua @@ -23,7 +23,7 @@ module(... or "citrixxml",package.seeall) --- Decodes html-entities to chars eg. => -- --- @param str string to convert +-- @param xmldata string to convert -- @return string an e function decode_xml_document(xmldata) @@ -72,7 +72,8 @@ end -- This function implements all the supported parameters described in: -- Version 5.0 (draft 1) 24 January 2008 -- --- @param socket socket, connected to the remote web server +-- @param host string, the ip of the remote server +-- @param port number, the port of the remote server -- @return string HTTP response data -- function request_server_farm_data( host, port ) @@ -379,7 +380,6 @@ end -- -- @param host string the host which is to be queried -- @param port number the port number of the XML service --- @param params table with parameters -- @return string HTTP response data -- function request_capabilities( host, port ) diff --git a/nselib/http.lua b/nselib/http.lua index e101bf9c9..95cbccf73 100644 --- a/nselib/http.lua +++ b/nselib/http.lua @@ -931,8 +931,6 @@ end -- -- @param host The host to connect to. -- @param port The port to connect to. --- @param method The method to use, a string like "GET" or "HEAD". --- @param path The path to retrieve. -- @param options A table of other parameters. It may have any of these fields: -- * timeout: A timeout used for socket operations. -- * header: A table containing additional headers to be used for the request. @@ -1154,7 +1152,6 @@ end -- @param host The host to query. -- @param port The port for the host. -- @param allReqs A table with all the previously built pipeline requests --- @param options A table with options to configure the pipeline request -- @return A table with multiple http response tables pipeline = function(host, port, allReqs) stdnse.print_debug("Total number of pipelined requests: " .. #allReqs) @@ -1457,7 +1454,6 @@ end -- the user. -- -- @param body The body of the page. --- @param uri The URI that the page came from. local function clean_404(body) -- Remove anything that looks like time body = string.gsub(body, '%d?%d:%d%d:%d%d', "") diff --git a/nselib/json.lua b/nselib/json.lua index cd78c929c..6176c5f13 100644 --- a/nselib/json.lua +++ b/nselib/json.lua @@ -441,8 +441,8 @@ end --- Parses json data into an object form -- This is the method you probably want to use if you -- use this library from a script. ---@param input : a json string ---@return status : true if ok, false if bad +--@param data a json string +--@return status true if ok, false if bad --@return an object representing the json, or error message function parse(data) local parser = Json:new(data) diff --git a/nselib/ldap.lua b/nselib/ldap.lua index beafd082c..319032c7c 100644 --- a/nselib/ldap.lua +++ b/nselib/ldap.lua @@ -194,7 +194,7 @@ end -- that were received prior to the error. In order to achieve this and not terminating the script -- by returning a false status a true status is returned together with a table containing all searchentries. -- This table has the errorMessage and resultCode entries set with the error information. --- As a try won't catch this error it's up to the script to do so. @see ldap-search.nse for an example. +-- As a try won't catch this error it's up to the script to do so. See ldap-search.nse for an example. -- -- @param socket socket already connected to the ldap server -- @param params table containing at least scope, derefPolicy, baseObject @@ -472,4 +472,4 @@ function extractAttribute( searchEntries, attributeName ) end end return ( #attributeTbl > 0 and attributeTbl or nil ) -end \ No newline at end of file +end diff --git a/nselib/msrpc.lua b/nselib/msrpc.lua index bf818cffe..26962445b 100644 --- a/nselib/msrpc.lua +++ b/nselib/msrpc.lua @@ -1600,7 +1600,7 @@ function samr_getmembersinalias(smbstate, alias_handle) return true, result end ----Call the LookupRids function, which converts a list of RIDs to +-- Call the LookupRids function, which converts a list of RIDs to -- names. -- --NOTE: This doesn't appear to work (it generates a fault, despite the packet being properly formatted). diff --git a/nselib/pgsql.lua b/nselib/pgsql.lua index 8dda10e44..25f40ccdf 100644 --- a/nselib/pgsql.lua +++ b/nselib/pgsql.lua @@ -581,9 +581,9 @@ end --- Creates a cryptographic hash to be used for login -- --- @param string username --- @param string password --- @param string salt +-- @param username username +-- @param password password +-- @param salt salt -- @return string suitable for login request function createMD5LoginHash(username, password, salt) local md5_1 = select( 2, bin.unpack( "H16", openssl.md5(password..username) ) ):lower() @@ -620,4 +620,4 @@ function detectVersion(host, port) end return v3 -end \ No newline at end of file +end diff --git a/nselib/rpc.lua b/nselib/rpc.lua index ed783ede9..395ed9d6f 100644 --- a/nselib/rpc.lua +++ b/nselib/rpc.lua @@ -871,7 +871,7 @@ NFS = { -- @return status true on success, false on failure -- @return statfs table with the fields transfer_size, block_size, -- total_blocks, free_blocks and available_blocks - -- @returns errormsg if status is false + -- @return errormsg if status is false StatFs = function( self, file_handle ) local status, packet @@ -1283,7 +1283,7 @@ Helper = { -- @param host table -- @param port table -- @param program_id number containing the RPC program ID - -- @param protcol string containing either "tcp" or "udp" + -- @param protocol string containing either "tcp" or "udp" -- @return status true on success, false on failure -- @return table containing the portmapper information as returned by -- Portmap.Dump @@ -1678,4 +1678,4 @@ Util = end end -} \ No newline at end of file +} diff --git a/nselib/smb.lua b/nselib/smb.lua index da7b0f733..a4bea03f7 100644 --- a/nselib/smb.lua +++ b/nselib/smb.lua @@ -309,7 +309,6 @@ end -- SMB). -- -- @param host The host object --- @param overrides [optional] Overrides for various fields -- @return (status, smb) if the status is true, result is the newly crated smb object; -- otherwise, socket is the error message. function start(host) @@ -2177,7 +2176,6 @@ end --@param overrides A table of override values that's passed to the smb functions. --@param encoded Set to 'true' if the file is encoded (xor'ed with 0xFF), It will be decoded before upload. Default: false --@return (status, err) If status is false, err is an error message. Otherwise, err is undefined. -require 'nsedebug' function file_upload(host, localfile, share, remotefile, overrides, encoded) local status, err, smbstate local chunk = 1024 @@ -2340,7 +2338,7 @@ end -- --@param host The host object --@param share The share to read it from (eg, C$). ---@param fo;es A list of files to look for; it is relative to the share's root. +--@param files A list of files to look for; it is relative to the share's root. --@param overrides [optional] Override various fields in the SMB packets. --@return status: A true/false value indicating success --@return count: The number of files that existed, or an error message if status is 'false' @@ -2611,7 +2609,6 @@ end -- bad, because it means we cannot tell whether or not a share exists). -- --@param host The host object ---@param share The share to test --@return (status, result) If status is false, result is an error message. Otherwise, result is a boolean value: -- true if the file was successfully written, false if it was not. function share_host_returns_proper_error(host) @@ -2665,7 +2662,7 @@ end ---Get all the details we can about the share. These details are stored in a table and returned. -- --@param host The host object. ---@param shares An array of shares to check. +--@param share An array of shares to check. --@return (status, result) If status is false, result is an error message. Otherwise, result is a boolean value: -- true if the file was successfully written, false if it was not. function share_get_details(host, share) diff --git a/nselib/smbauth.lua b/nselib/smbauth.lua index 08fe8c377..9ada636cf 100644 --- a/nselib/smbauth.lua +++ b/nselib/smbauth.lua @@ -444,8 +444,8 @@ end ---Create the LM mac key, which is used for message signing. For basic authentication, it's the first 8 bytes -- of the lanman hash, followed by 8 null bytes, followed by the lanman response; for extended authentication, -- this is just the first 8 bytes of the lanman hash followed by 8 null bytes. ---@param ntlm_hash The NTLM hash. ---@param ntlm_response The NTLM response. +--@param lm_hash The NTLM hash. +--@param lm_response The NTLM response. --@param is_extended Should be set if extended security negotiations are being used. function lm_create_mac_key(lm_hash, lm_response, is_extended) if(have_ssl ~= true) then diff --git a/scripts/couchdb-databases.nse b/scripts/couchdb-databases.nse index 2ed191541..f25d69fa5 100644 --- a/scripts/couchdb-databases.nse +++ b/scripts/couchdb-databases.nse @@ -18,7 +18,7 @@ http://wiki.apache.org/couchdb/HTTP_database_API -- | 5 = creditcards -- | 6 = test_suite_users -- |_ 7 = test_suite_db_b ---@version 0.2 +-- version 0.2 -- Created 01/12/2010 - v0.1 - created by Martin Holst Swende -- TODO : Authentication not implemented diff --git a/scripts/couchdb-stats.nse b/scripts/couchdb-stats.nse index 16d92f4df..8474d8997 100644 --- a/scripts/couchdb-stats.nse +++ b/scripts/couchdb-stats.nse @@ -30,7 +30,7 @@ http://wiki.apache.org/couchdb/HTTP_database_API -- | current = 5 -- | count = 1617 -- |_ Authentication : NOT enabled ('admin party') ---@version 0.3 +-- version 0.3 -- -- Created 01/20/2010 - v0.1 - created by Martin Holst Swende -- Modified 07/02/2010 - v0.2 - added test if auth is enabled, compacted output a bit (mhs) diff --git a/scripts/dhcp-discover.nse b/scripts/dhcp-discover.nse index d528be4bf..bc4cfd2cc 100644 --- a/scripts/dhcp-discover.nse +++ b/scripts/dhcp-discover.nse @@ -435,7 +435,7 @@ actions[61] = {name="Client Identifier (client)", func=read_string, --@param overrides [optional] A table of overrides. If a field in the table matches a field in the DHCP -- packet (see rfc2131 section 2 for a list of possible fields. Or, just look at the -- code. ---@param leasetime [optional] The lease time for which to request an IP. Default: 1 second. +--@param lease_time [optional] The lease time for which to request an IP. Default: 1 second. --@return The packet, as a string. It should be sent to the server on UDP/67. local function dhcp_build(request_type, ip_address, mac_address, request_options, overrides, lease_time) local packet = '' diff --git a/scripts/mongodb-databases.nse b/scripts/mongodb-databases.nse index 03e27f170..8d3b556a7 100644 --- a/scripts/mongodb-databases.nse +++ b/scripts/mongodb-databases.nse @@ -28,7 +28,7 @@ Attempts to get tables from a MongoDB -- | sizeOnDisk = 1 -- | name = admin -- |_ totalSize = 167772160 ---@version 0.1 +-- version 0.1 -- Created 01/12/2010 - v0.1 - created by Martin Holst Swende diff --git a/scripts/mongodb-info.nse b/scripts/mongodb-info.nse index fb6fd8676..cbf09774d 100644 --- a/scripts/mongodb-info.nse +++ b/scripts/mongodb-info.nse @@ -40,7 +40,7 @@ Attempts to get build info and server status from a MongoDB -- | heap_usage_bytes = 117120 -- | note = fields vary by platform -- |_ page_faults = 0 ---@version 0.2 +-- version 0.2 -- Created 01/12/2010 - v0.1 - created by Martin Holst Swende diff --git a/scripts/qscan.nse b/scripts/qscan.nse index 32bc0532e..c3bf6e9b1 100644 --- a/scripts/qscan.nse +++ b/scripts/qscan.nse @@ -170,7 +170,6 @@ end --- Create a TCP Packet object -- @param host Host object --- @param port Port number -- @return TCP Packet object local genericpkt = function(host) local pkt = bin.pack("H", diff --git a/scripts/smtp-enum-users.nse b/scripts/smtp-enum-users.nse index 9a1228025..f8a1a7e33 100644 --- a/scripts/smtp-enum-users.nse +++ b/scripts/smtp-enum-users.nse @@ -27,7 +27,7 @@ smtp-enum-users.methods={EXPN,RCPT,VRFY} -- @args smtp-enum-users.domain Define the domain to be used in the SMTP commands -- @args smtp-enum-users.methods Define the methods and order to be used by the script (EXPN, VRFY, RCPT) -- --- @changelog +-- changelog -- 2010-03-07 Duarte Silva -- * First version ;) -- 2010-03-14 Duarte Silva @@ -256,6 +256,8 @@ function do_vrfy(socket, username, domain) return do_gnrc(socket, "VRFY", username, domain) end +issued_from = false + ---Verify if a username is valid using the RCPT method. It will only issue the MAIL FROM -- command if the issued_from flag is false. The MAIL FROM command does not need to -- be issued each time an RCPT TO is used. Otherwise it should also be issued a RSET @@ -265,8 +267,6 @@ end -- @param username User name to test -- @param domain Domain to use in the command -- @return Status and depending on the code, a error message -issued_from = false - function do_rcpt(socket, username, domain) if not issued_from then -- Lets try to issue MAIL FROM command. diff --git a/scripts/smtp-open-relay.nse b/scripts/smtp-open-relay.nse index 77e71a5b2..25f986ee7 100644 --- a/scripts/smtp-open-relay.nse +++ b/scripts/smtp-open-relay.nse @@ -32,7 +32,7 @@ printed with the list of any combinations that were found prior to the error. -- @args smtp-open-relay.to Define the destination email address to be used (without the domain, default is -- relaytest) -- --- @changelog +-- changelog -- 2007-05-16 Arturo 'Buanzo' Busleiman -- + Added some strings to return in different places -- * Changed "HELO www.[ourdomain]" to "EHLO [ourdomain]" diff --git a/scripts/snmp-interfaces.nse b/scripts/snmp-interfaces.nse index 5c3ff2a46..29c67b2b0 100644 --- a/scripts/snmp-interfaces.nse +++ b/scripts/snmp-interfaces.nse @@ -73,7 +73,7 @@ local iana_types = { "other", "regular1822", "hdh1822", "ddnX25", "rfc877x25", " --- Walks the MIB Tree -- -- @param socket socket already connected to the server --- @base_oid string containing the base object ID to walk +-- @param base_oid string containing the base object ID to walk -- @return table containing oid and value function snmp_walk( socket, base_oid ) diff --git a/scripts/snmp-netstat.nse b/scripts/snmp-netstat.nse index d0bf644ad..21235ca9d 100644 --- a/scripts/snmp-netstat.nse +++ b/scripts/snmp-netstat.nse @@ -33,7 +33,7 @@ portrule = shortport.portnumber(161, "udp", {"open", "open|filtered"}) --- Walks the MIB Tree -- -- @param socket socket already connected to the server --- @base_oid string containing the base object ID to walk +-- @param base_oid string containing the base object ID to walk -- @return table containing oid and value function snmp_walk( socket, base_oid ) diff --git a/scripts/snmp-processes.nse b/scripts/snmp-processes.nse index c630b618c..731d22174 100644 --- a/scripts/snmp-processes.nse +++ b/scripts/snmp-processes.nse @@ -43,7 +43,7 @@ portrule = shortport.portnumber(161, "udp", {"open", "open|filtered"}) --- Walks the MIB Tree -- -- @param socket socket already connected to the server --- @base_oid string containing the base object ID to walk +-- @param base_oid string containing the base object ID to walk -- @return table containing oid and value function snmp_walk( socket, base_oid ) diff --git a/scripts/snmp-win32-services.nse b/scripts/snmp-win32-services.nse index 86646ed3e..0a380fcf5 100644 --- a/scripts/snmp-win32-services.nse +++ b/scripts/snmp-win32-services.nse @@ -36,7 +36,7 @@ portrule = shortport.portnumber(161, "udp", {"open", "open|filtered"}) --- Walks the MIB Tree -- -- @param socket socket already connected to the server --- @base_oid string containing the base object ID to walk +-- @param base_oid string containing the base object ID to walk -- @return table containing oid and value function snmp_walk( socket, base_oid ) diff --git a/scripts/snmp-win32-shares.nse b/scripts/snmp-win32-shares.nse index 0cd9d03d6..389da10ba 100644 --- a/scripts/snmp-win32-shares.nse +++ b/scripts/snmp-win32-shares.nse @@ -29,7 +29,7 @@ portrule = shortport.portnumber(161, "udp", {"open", "open|filtered"}) --- Walks the MIB Tree -- -- @param socket socket already connected to the server --- @base_oid string containing the base object ID to walk +-- @param base_oid string containing the base object ID to walk -- @return table containing oid and value function snmp_walk( socket, base_oid ) diff --git a/scripts/snmp-win32-software.nse b/scripts/snmp-win32-software.nse index 216ff87e1..4f59d4a14 100644 --- a/scripts/snmp-win32-software.nse +++ b/scripts/snmp-win32-software.nse @@ -31,7 +31,7 @@ portrule = shortport.portnumber(161, "udp", {"open", "open|filtered"}) --- Walks the MIB Tree -- -- @param socket socket already connected to the server --- @base_oid string containing the base object ID to walk +-- @param base_oid string containing the base object ID to walk -- @return table containing oid and value function snmp_walk( socket, base_oid ) diff --git a/scripts/snmp-win32-users.nse b/scripts/snmp-win32-users.nse index 607e83026..5525507e7 100644 --- a/scripts/snmp-win32-users.nse +++ b/scripts/snmp-win32-users.nse @@ -33,7 +33,7 @@ portrule = shortport.portnumber(161, "udp", {"open", "open|filtered"}) --- Walks the MIB Tree -- -- @param socket socket already connected to the server --- @base_oid string containing the base object ID to walk +-- @param base_oid string containing the base object ID to walk -- @return table containing oid and value function snmp_walk( socket, base_oid )