1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-01 12:29:03 +00:00

Fix some bad patterns with excessive backtracking

This commit is contained in:
dmiller
2016-09-21 03:55:11 +00:00
parent da594ae5b8
commit d1fb502144
5 changed files with 10 additions and 7 deletions

View File

@@ -54,7 +54,7 @@ action = function(host, port)
local try = nmap.new_try(catch)
try(client_ident:connect(host, 113))
try(client_ident:connect(host, 1113))
try(client_service:connect(host, port))
local localip, localport, remoteip, remoteport =
@@ -70,7 +70,7 @@ action = function(host, port)
owner = nil
else
owner = string.match(owner,
"%d+%s*,%s*%d+%s*:%s*USERID%s*:%s*.+%s*:%s*(.+)\r?\n")
"%d+%s*,%s*%d+%s*:%s*USERID%s*:%s*[^:]+%s*:[ \t]*([^\r\n]+)\r?\n")
end
try(client_ident:close())

View File

@@ -70,7 +70,7 @@ action = function(host, port)
end
socket:close()
if string.match(response, 'HTTP/1.1 200%s+.+HTTPAPI/2.0') then
if string.match(response, 'HTTP/1.1 200%s.+HTTPAPI/2.0') then
return true, 'IP-HTTPS is supported. This indicates that this host supports Microsoft DirectAccess.'
end
end

View File

@@ -370,7 +370,7 @@ local function check_exim(smtp_opts)
for _, line in pairs(stdnse.strsplit("\r?\n", response)) do
if not smtp_opts.ehlo_host or not smtp_opts.domain_ip then
smtp_opts.ehlo_host, smtp_opts.domain_ip =
line:match("%d+.*Hello%s(.*)%s%[(.*)%]")
line:match("%d.-Hello%s(.*)%s%[([^]]*)%]")
end
if not smtp_server.size then
smtp_server.size = line:match("%d+%-SIZE%s(%d+)")