diff --git a/scripts/acarsd-info.nse b/scripts/acarsd-info.nse index b865b6ce2..d591ec273 100644 --- a/scripts/acarsd-info.nse +++ b/scripts/acarsd-info.nse @@ -70,7 +70,7 @@ action = function(host, port) end -- Check for restricted access -- Parse daemon info - if string.match(data, "Authorization needed\. If your client doesnt support this") then + if string.match(data, "Authorization needed%. If your client doesnt support this") then local version_match = string.match(data, "acarsd\t(.+)\t") if version_match then table.insert(result, string.format("Version: %s", version_match)) end @@ -96,7 +96,7 @@ action = function(host, port) } for _, var in ipairs(vars) do local tag = var[2] - local var_match = string.match(data, string.format('<%s>(.+)<\/%s>', tag, tag)) + local var_match = string.match(data, string.format('<%s>(.+)', tag, tag)) if var_match then table.insert(result, string.format("%s: %s", var[1], string.gsub(var_match, "&", "&"))) end end diff --git a/scripts/asn-query.nse b/scripts/asn-query.nse index 62ddd7a5b..bb4c1ab3d 100644 --- a/scripts/asn-query.nse +++ b/scripts/asn-query.nse @@ -445,8 +445,8 @@ function nice_output( output, combined_records ) for j=1,#output,1 do -- does everything after the first pipe match for i ~= j? if i ~= j and output[i]:match( "[^|]+|([^$]+$)" ) == output[j]:match( "[^|]+|([^$]+$)" ) then - first = output[i]:match( "([%x%d:\.]+/%d+)%s|" ) -- the lastmost BGP before the pipe in i. - second = output[j]:match( "([%x%d:\.]+/%d+)" ) -- first BGP in j + first = output[i]:match( "([%x%d:%.]+/%d+)%s|" ) -- the lastmost BGP before the pipe in i. + second = output[j]:match( "([%x%d:%.]+/%d+)" ) -- first BGP in j -- add in the new BGP from j and delete j if first and second then output[i] = output[i]:gsub( first, ("%s and %s"):format( first, second ) ) diff --git a/scripts/dns-cache-snoop.nse b/scripts/dns-cache-snoop.nse index 2ce9281c6..2b9980a44 100644 --- a/scripts/dns-cache-snoop.nse +++ b/scripts/dns-cache-snoop.nse @@ -131,7 +131,7 @@ local ALEXA_DOMAINS = { -- Construct the default list of domains. for _, domain in ipairs(ALEXA_DOMAINS) do DOMAINS[#DOMAINS + 1] = domain - if not string.match(domain, "^www\.") then + if not string.match(domain, "^www%.") then DOMAINS[#DOMAINS + 1] = "www." .. domain end end diff --git a/scripts/drda-info.nse b/scripts/drda-info.nse index 1b2f47dc4..836f852d8 100644 --- a/scripts/drda-info.nse +++ b/scripts/drda-info.nse @@ -53,7 +53,7 @@ local function parseVersion( server_version ) local hotfix = string.sub(server_version,8) server_version = major_version .. "." .. minor_version .. "." .. hotfix elseif( pfx == "CSS" ) then - return server_version:match("%w+\/(.*)") + return server_version:match("%w+/(.*)") end return server_version @@ -78,7 +78,7 @@ action = function( host, port ) helper:close() -- Set port information - if ( response.srvclass and response.srvclass:match("IDS\/") ) then + if ( response.srvclass and response.srvclass:match("IDS/") ) then port.version.name = "drda" port.version.product = "IBM Informix Dynamic Server" port.version.name_confidence = 100 diff --git a/scripts/ganglia-info.nse b/scripts/ganglia-info.nse index cda402bc0..87f890fcc 100644 --- a/scripts/ganglia-info.nse +++ b/scripts/ganglia-info.nse @@ -112,7 +112,7 @@ action = function( host, port ) end -- Parse daemon info - if not string.match(data, "<\!DOCTYPE GANGLIA_XML") then + if not string.match(data, "UA-[0-9]{6,9}-[0-9]{1,2})", ["Google Adsense ID"] = "(?Ppub-[0-9]{16,16})", - ["Amazon Associates ID"] = "http://(www\.amazon\.com/[^\"']*[\\?&;]tag|rcm\.amazon\.com/[^\"']*[\\?&;]t)=(?P\\w+-\\d+)", + ["Amazon Associates ID"] = "http://(www%.amazon%.com/[^\"']*[\\?&;]tag|rcm%.amazon%.com/[^\"']*[\\?&;]t)=(?P\\w+-\\d+)", } portrule = shortport.http diff --git a/scripts/http-barracuda-dir-traversal.nse b/scripts/http-barracuda-dir-traversal.nse index 141c35850..e753fe3e0 100644 --- a/scripts/http-barracuda-dir-traversal.nse +++ b/scripts/http-barracuda-dir-traversal.nse @@ -109,7 +109,7 @@ action = function(host, port) if data and data.status and tostring(data.status):match("200") and data.body and data.body ~= "" then -- Check if the HTTP response contains a valid config file in MySQL database dump format - if string.match(data.body, "DROP TABLE IF EXISTS config;") and string.match(data.body, "barracuda\.css") then + if string.match(data.body, "DROP TABLE IF EXISTS config;") and string.match(data.body, "barracuda%.css") then config_file = data.body break end diff --git a/scripts/http-domino-enum-passwords.nse b/scripts/http-domino-enum-passwords.nse index 5ee6534d6..28fc49ff3 100644 --- a/scripts/http-domino-enum-passwords.nse +++ b/scripts/http-domino-enum-passwords.nse @@ -160,7 +160,7 @@ end -- @param body the html content of the recieved page -- @return link to next page local function getPager( body ) - return body:match(".*" ) ) then + http_response.body:match(".*.*" ) ) then return " \n ERROR: Failed to authenticate" else return " \n ERROR: Failed to process results" diff --git a/scripts/http-qnap-nas-info.nse b/scripts/http-qnap-nas-info.nse index 4e56f4c31..a024e7b63 100644 --- a/scripts/http-qnap-nas-info.nse +++ b/scripts/http-qnap-nas-info.nse @@ -99,7 +99,7 @@ action = function(host, port) } for _, var in ipairs(vars) do - local var_match = string.match(config_file, string.format('<%s><\/%s>', var[2], var[2])) + local var_match = string.match(config_file, string.format('<%s>', var[2], var[2])) if var_match then table.insert(result, string.format("%s: %s", var[1], var_match)) end end diff --git a/scripts/http-vuln-cve2010-2861.nse b/scripts/http-vuln-cve2010-2861.nse index 51386cde6..ac711776f 100644 --- a/scripts/http-vuln-cve2010-2861.nse +++ b/scripts/http-vuln-cve2010-2861.nse @@ -114,10 +114,10 @@ locale parameter]], end local exploits = { - ['CFusionMX'] = '..\\..\\..\\..\\..\\..\\..\\..\\CFusionMX\\lib\\password.properties\%00en', - ['CFusionMX7'] = '..\\..\\..\\..\\..\\..\\..\\..\\CFusionMX7\\lib\\password.properties\%00en', - ['ColdFusion8'] = '..\\..\\..\\..\\..\\..\\..\\..\\ColdFusion8\\lib\\password.properties\%00en', - ['JRun4\\servers'] = '..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\JRun4\\servers\\cfusion\\cfusion-ear\\cfusion-war\\WEB-INF\\cfusion\\lib\\password.properties\%00en', + ['CFusionMX'] = '..\\..\\..\\..\\..\\..\\..\\..\\CFusionMX\\lib\\password.properties%00en', + ['CFusionMX7'] = '..\\..\\..\\..\\..\\..\\..\\..\\CFusionMX7\\lib\\password.properties%00en', + ['ColdFusion8'] = '..\\..\\..\\..\\..\\..\\..\\..\\ColdFusion8\\lib\\password.properties%00en', + ['JRun4\\servers'] = '..\\..\\..\\..\\..\\..\\..\\..\\..\\..\\JRun4\\servers\\cfusion\\cfusion-ear\\cfusion-war\\WEB-INF\\cfusion\\lib\\password.properties%00en', } local results = {} diff --git a/scripts/reverse-index.nse b/scripts/reverse-index.nse index ef3bd6e1c..2ffdc80e4 100644 --- a/scripts/reverse-index.nse +++ b/scripts/reverse-index.nse @@ -79,8 +79,8 @@ local function createVerticalResults(db) table.insert(results, result_entries) table.sort(results, function(a,b) - local a_port, a_proto = a.name:match("^(%d+)\/(%w*)") - local b_port, b_proto = b.name:match("^(%d+)\/(%w*)") + local a_port, a_proto = a.name:match("^(%d+)/(%w*)") + local b_port, b_proto = b.name:match("^(%d+)/(%w*)") if ( a_proto == b_proto ) then return ( tonumber(a_port) ) < ( tonumber(b_port) ) else @@ -116,8 +116,8 @@ local function createHorizontalResults(db) table.insert(results, str) table.sort(results, function(a,b) - local a_port, a_proto = a:match("^(%d+)\/(%w*):") - local b_port, b_proto = b:match("^(%d+)\/(%w*):") + local a_port, a_proto = a:match("^(%d+)/(%w*):") + local b_port, b_proto = b:match("^(%d+)/(%w*):") if ( a_proto == b_proto ) then return ( tonumber(a_port) ) < ( tonumber(b_port) ) else diff --git a/scripts/rexec-brute.nse b/scripts/rexec-brute.nse index 180d21a25..61097ca17 100644 --- a/scripts/rexec-brute.nse +++ b/scripts/rexec-brute.nse @@ -57,7 +57,7 @@ Driver = { login = function(self, username, password) local cmd = "id" - local data = ("\0%s\0%s\0\%s\0"):format(username, password, cmd) + local data = ("\0%s\0%s\0%s\0"):format(username, password, cmd) local status, err = self.socket:send(data) if ( not(status) ) then @@ -95,4 +95,4 @@ action = function(host, port) engine.options.script_name = SCRIPT_NAME status, result = engine:start() return result -end \ No newline at end of file +end diff --git a/scripts/smb-security-mode.nse b/scripts/smb-security-mode.nse index 2fe3e2dd5..cc84ec8e8 100644 --- a/scripts/smb-security-mode.nse +++ b/scripts/smb-security-mode.nse @@ -63,7 +63,7 @@ action = function(host) local result, username, domain = smb.get_account(host) if(result ~= false) then - table.insert(response, string.format("Account that was used for smb scripts: %s\%s", domain, stdnse.string_or_blank(username, ''))) + table.insert(response, string.format("Account that was used for smb scripts: %s%s", domain, stdnse.string_or_blank(username, ''))) end -- User-level authentication or share-level authentication diff --git a/scripts/smtp-open-relay.nse b/scripts/smtp-open-relay.nse index 634d4c22f..369f16105 100644 --- a/scripts/smtp-open-relay.nse +++ b/scripts/smtp-open-relay.nse @@ -113,7 +113,7 @@ function go(host, port) port.number) end - local srvname = string.match(response, "%d+%s([%w]+[%w\.\-]*)") + local srvname = string.match(response, "%d+%s([%w]+[%w%.-]*)") local status, response = smtp.ehlo(socket, domain) if not status then @@ -121,7 +121,7 @@ function go(host, port) end if not srvname then - srvname = string.match(response, "%d+%-([%w]+[%w\.\-]*)") + srvname = string.match(response, "%d+%-([%w]+[%w%.-]*)") end -- Antispam tests. diff --git a/scripts/smtp-vuln-cve2010-4344.nse b/scripts/smtp-vuln-cve2010-4344.nse index 74771f7a8..22c847417 100644 --- a/scripts/smtp-vuln-cve2010-4344.nse +++ b/scripts/smtp-vuln-cve2010-4344.nse @@ -84,7 +84,7 @@ local function get_exim_banner(response) local banner, version banner = response:match("%d+%s(.+)") if banner then - version = tonumber(banner:match("Exim%s([0-9\.]+)")) + version = tonumber(banner:match("Exim%s([0-9%.]+)")) end return banner, version end diff --git a/scripts/smtp-vuln-cve2011-1764.nse b/scripts/smtp-vuln-cve2011-1764.nse index 02eaf606f..71f0b13fd 100644 --- a/scripts/smtp-vuln-cve2011-1764.nse +++ b/scripts/smtp-vuln-cve2011-1764.nse @@ -71,7 +71,7 @@ local function get_exim_banner(response) local banner, version banner = response:match("%d+%s(.+)") if banner and banner:match("Exim") then - version = tonumber(banner:match("Exim%s([0-9\.]+)")) + version = tonumber(banner:match("Exim%s([0-9%.]+)")) end return banner, version end diff --git a/scripts/svn-brute.nse b/scripts/svn-brute.nse index 2552a3dec..586db1e3f 100644 --- a/scripts/svn-brute.nse +++ b/scripts/svn-brute.nse @@ -118,7 +118,7 @@ svn = return false, "error" end - challenge = msg:match("\<.+\>") + challenge = msg:match("<.+>") if ( not(challenge) ) then return false, "Failed to read challenge" diff --git a/scripts/whois.nse b/scripts/whois.nse index 5efb169fb..387933c99 100644 --- a/scripts/whois.nse +++ b/scripts/whois.nse @@ -1361,8 +1361,8 @@ function script_init( ) ob_netnum = {ob_start = "\r?\n?%s*[Ii]net6?num:%s*.-\r?\n", ob_end = "\r?\n%s*[Ss]ource:%s*.-\r?\n\r?\n", inetnum = "\r?\n%s*[Ii]net6?num:%s*(.-)\r?\n", - netname = "\r?\n%s*[Nn]et[\-]-[Nn]ame:%s*(.-)\r?\n", - nettype = "\r?\n%s*[Nn]et[\-]-[Tt]ype:%s*(.-)\r?\n", + netname = "\r?\n%s*[Nn]et[-]-[Nn]ame:%s*(.-)\r?\n", + nettype = "\r?\n%s*[Nn]et[-]-[Tt]ype:%s*(.-)\r?\n", descr = "[Dd]escr:[^\r?\n][%s]*(.-)\r?\n", country = "\r?\n%s*[Cc]ountry:%s*(.-)\r?\n", status = "\r?\n%s*[Ss]tatus:%s*(.-)\r?\n", @@ -1370,62 +1370,62 @@ function script_init( ) ob_org = { ob_start = "\r?\n%s*[Oo]rgani[sz]ation:%s*.-\r?\n", ob_end = "\r?\n%s*[Ss]ource:%s*.-\r?\n\r?\n", organisation = "\r?\n%s*[Oo]rgani[sz]ation:%s*(.-)\r?\n", - orgname = "\r?\n%s*[Oo]rg[\-]-[Nn]ame:%s*(.-)\r?\n", + orgname = "\r?\n%s*[Oo]rg[-]-[Nn]ame:%s*(.-)\r?\n", descr = "[Dd]escr:[^\r?\n][%s]*(.-)\r?\n", - email = "\r?\n%s*[Ee][\-]-[Mm]ail:%s*(.-)\r?\n"}, + email = "\r?\n%s*[Ee][-]-[Mm]ail:%s*(.-)\r?\n"}, ob_role = { ob_start = "\r?\n%s*[Rr]ole:%s*.-\r?\n", ob_end = "\r?\n%s*[Ss]ource:%s*.-\r?\n\r?\n", role = "\r?\n%s*[Rr]ole:%s*(.-)\r?\n", - email = "\r?\n%s*[Ee][\-]-[Mm]ail:%s*(.-)\r?\n"}, + email = "\r?\n%s*[Ee][-]-[Mm]ail:%s*(.-)\r?\n"}, ob_persn = { ob_start = "\r?\n%s*[Pp]erson:%s*.-\r?\n", ob_end = "\r?\n%s*[Ss]ource:%s*.-\r?\n\r?\n", person = "\r?\n%s*[Pp]erson:%s*(.-)\r?\n", - email = "\r?\n%s*[Ee][\-]-[Mm]ail:%s*(.-)\r?\n"} }, + email = "\r?\n%s*[Ee][-]-[Mm]ail:%s*(.-)\r?\n"} }, arin = { - ob_exist = "\r?\n%s*[Nn]et[\-]-[Rr]ange:.-\r?\n", - ob_netnum = {ob_start = "\r?\n%s*[Nn]et[\-]-[Rr]ange:.-\r?\n", + ob_exist = "\r?\n%s*[Nn]et[-]-[Rr]ange:.-\r?\n", + ob_netnum = {ob_start = "\r?\n%s*[Nn]et[-]-[Rr]ange:.-\r?\n", ob_end = "\r?\n\r?\n", - netrange = "\r?\n%s*[Nn]et[\-]-[Rr]ange:(.-)\r?\n", - netname = "\r?\n%s*[Nn]et[\-]-[Nn]ame:(.-)\r?\n", - nettype = "\r?\n%s*[Nn]et[\-]-[Tt]ype:(.-)\r?\n"}, - ob_org = {ob_start = "\r?\n%s*[Oo]rg[\-]-[Nn]ame:.-\r?\n", + netrange = "\r?\n%s*[Nn]et[-]-[Rr]ange:(.-)\r?\n", + netname = "\r?\n%s*[Nn]et[-]-[Nn]ame:(.-)\r?\n", + nettype = "\r?\n%s*[Nn]et[-]-[Tt]ype:(.-)\r?\n"}, + ob_org = {ob_start = "\r?\n%s*[Oo]rg[-]-[Nn]ame:.-\r?\n", ob_end = "\r?\n\r?\n", - orgname = "\r?\n%s*[Oo]rg[\-]-[Nn]ame:(.-)\r?\n", - orgid = "\r?\n%s*[Oo]rg[\-]-[Ii][Dd]:(.-)\r?\n", - stateprov = "\r?\n%s*[Ss]tate[\-]-[Pp]rov:(.-)\r?\n", + orgname = "\r?\n%s*[Oo]rg[-]-[Nn]ame:(.-)\r?\n", + orgid = "\r?\n%s*[Oo]rg[-]-[Ii][Dd]:(.-)\r?\n", + stateprov = "\r?\n%s*[Ss]tate[-]-[Pp]rov:(.-)\r?\n", country = "\r?\n%s*[Cc]ountry:(.-)\r?\n"}, - ob_cust = {ob_start = "\r?\n%s*[Cc]ust[\-]-[Nn]ame:.-\r?\n", + ob_cust = {ob_start = "\r?\n%s*[Cc]ust[-]-[Nn]ame:.-\r?\n", ob_end = "\r?\n\r?\n", - custname = "\r?\n%s*[Cc]ust[\-]-[Nn]ame:(.-)\r?\n", - stateprov = "\r?\n%s*[Ss]tate[\-]-[Pp]rov:(.-)\r?\n", + custname = "\r?\n%s*[Cc]ust[-]-[Nn]ame:(.-)\r?\n", + stateprov = "\r?\n%s*[Ss]tate[-]-[Pp]rov:(.-)\r?\n", country = "\r?\n%s*[Cc]ountry:(.-)\r?\n"}, - ob_persn = {ob_start = "\r?\n%s*[Oo]rg[\-]-[Tt]ech[\-]-[Nn]ame:.-\r?\n", + ob_persn = {ob_start = "\r?\n%s*[Oo]rg[-]-[Tt]ech[-]-[Nn]ame:.-\r?\n", ob_end = "\r?\n\r?\n", orgtechname = - "\r?\n%s*[Oo]rg[\-]-[Tt]ech[\-]-[Nn]ame:(.-)\r?\n", + "\r?\n%s*[Oo]rg[-]-[Tt]ech[-]-[Nn]ame:(.-)\r?\n", orgtechemail = - "\r?\n%s*[Oo]rg[\-]-[Tt]ech[\-]-[Ee][\-]-[Mm]ail:(.-)\r?\n"} }, + "\r?\n%s*[Oo]rg[-]-[Tt]ech[-]-[Ee][-]-[Mm]ail:(.-)\r?\n"} }, lacnic = { ob_exist = "\r?\n%s*[Ii]net6?num:%s*.-\r?\n", ob_netnum = {ob_start = "\r?\n%s*[Ii]net6?num:%s*.-\r?\n", ob_end = "\r?\n\r?\n", inetnum = "\r?\n%s*[Ii]net6?num:%s*(.-)\r?\n", owner = "\r?\n%s*[Oo]wner:%s*(.-)\r?\n", - ownerid = "\r?\n%s*[Oo]wner[\-]-[Ii][Dd]:%s*(.-)\r?\n", + ownerid = "\r?\n%s*[Oo]wner[-]-[Ii][Dd]:%s*(.-)\r?\n", responsible = "\r?\n%s*[Rr]esponsible:%s*(.-)\r?\n", country = "\r?\n%s*[Cc]ountry:%s*(.-)\r?\n", source = "\r?\n%s*[Ss]ource:%s*(.-)\r?\n"}, ob_persn = {ob_start = "\r?\n%s*[Pp]erson:%s*.-\r?\n", ob_end = "\r?\n\r?\n", person = "\r?\n%s*[Pp]erson:%s*(.-)\r?\n", - email = "\r?\n%s*[Ee][\-]-[Mm]ail:%s*(.-)\r?\n"} }, + email = "\r?\n%s*[Ee][-]-[Mm]ail:%s*(.-)\r?\n"} }, jpnic = { ob_exist = "\r?\n%s*[Nn]etwork%s-[Ii]nformation:%s*.-\r?\n", - ob_netnum = {ob_start = "\[[Nn]etwork%s*[Nn]umber\]%s*.-\r?\n", + ob_netnum = {ob_start = "[[Nn]etwork%s*[Nn]umber]%s*.-\r?\n", ob_end = "\r?\n\r?\n", - inetnum = "\[[Nn]etwork%s*[Nn]umber\]%s*(.-)\r?\n", - netname = "\[[Nn]etwork%s*[Nn]ame\]%s*(.-)\r?\n", - orgname = "\[[Oo]rganization\]%s*(.-)\r?\n"} } + inetnum = "[[Nn]etwork%s*[Nn]umber]%s*(.-)\r?\n", + netname = "[[Nn]etwork%s*[Nn]ame]%s*(.-)\r?\n", + orgname = "[[Oo]rganization]%s*(.-)\r?\n"} } } --- @@ -1578,7 +1578,7 @@ function script_init( ) } nmap.registry.whois.m_none = { - "\n%s*([Nn]o match found for[%s\+]*$addr)", + "\n%s*([Nn]o match found for[%s+]*$addr)", "\n%s*([Uu]nallocated resource:%s*$addr)", "\n%s*([Rr]eserved:%s*$addr)", "\n[^\n]*([Nn]ot%s[Aa]ssigned[^\n]*$addr)", @@ -1595,8 +1595,8 @@ function script_init( ) { remote_resource = "http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.txt", local_resource = "ipv4-address-space", - match_assignment = "^%s*([\.%d]+/%d+)", - match_service = "whois\.(%w+)\.net" + match_assignment = "^%s*([%.%d]+/%d+)", + match_service = "whois%.(%w+)%.net" } } nmap.registry.whois.remote_assignments_files.ipv6 = { @@ -1610,7 +1610,7 @@ function script_init( ) remote_resource = "http://www.iana.org/assignments/ipv6-unicast-address-assignments/ipv6-unicast-address-assignments.txt", local_resource = "ipv6-unicast-address-assignments", match_assignment = "^%s*([:%x]+/%d+)", - match_service = "whois\.(%w+)\.net" + match_service = "whois%.(%w+)%.net" } } @@ -1773,7 +1773,7 @@ function get_local_assignments_data() -- update our file header with a new timestamp stdnse.print_debug( 1, "%s: %s is up-to-date.", SCRIPT_NAME, file ) file_content = read_from_file( file ) - file_content[2] = file_content[2]:gsub("^<[\-\+]?%d+>(.*)$", "<" .. os.time() .. ">%1") + file_content[2] = file_content[2]:gsub("^<[-+]?%d+>(.*)$", "<" .. os.time() .. ">%1") write_success, err = write_to_file( file, file_content ) if err then stdnse.print_debug( 1, "%s: Error writing to %s: %s.", SCRIPT_NAME, file, err ) @@ -1903,7 +1903,7 @@ function requires_updating( file ) if not ( mod:match( "%a%a%a,%s%d%d%s%a%a%a%s%d%d%d%d%s%d%d:%d%d:%d%d%s%u%u%u" ) or - mod:match( "%a*day,%d%d\-%a%a%a\-%d%d%s%d%d:%d%d:%d%d%s%u%u%u" ) + mod:match( "%a*day,%d%d-%a%a%a-%d%d%s%d%d:%d%d:%d%d%s%u%u%u" ) or mod:match( "%a%a%a%s%a%a%a%s%d?%d%s%d%d:%d%d:%d%d%s%d%d%d%d" ) ) then @@ -2144,7 +2144,7 @@ end function get_period( period ) if type( period ) ~= string or ( period == "" ) then return nil end - local quant, unit = period:match( "(\-?\+?%d*\.?%d*)([SsMmHhDd]?)" ) + local quant, unit = period:match( "(-?+?%d*%.?%d*)([SsMmHhDd]?)" ) if not ( tonumber( quant ) ) then return nil end if ( string.lower( unit ) == "m" ) then diff --git a/scripts/xmpp-info.nse b/scripts/xmpp-info.nse index e9b93d868..27cc398f7 100644 --- a/scripts/xmpp-info.nse +++ b/scripts/xmpp-info.nse @@ -323,7 +323,7 @@ local scan = function(host, port, server_name, tls, n) stdnse.print_debug("OK") --http://xmpp.org/extensions/xep-0198.html --sample: el-tramo.be - local version = string.match(tag.attrs.xmlns, "^urn:xmpp:sm:(\.)") + local version = string.match(tag.attrs.xmlns, "^urn:xmpp:sm:(%.)") table.insert(features_list[n], 'Stream management v' .. version) end