1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Pass "ssl" as the third paramater to connect() in pop3.lua capabilities() and

smtp-commands.nse if version detection set the port service_tunnel to "ssl".
This commit is contained in:
jah
2009-02-03 02:43:24 +00:00
parent b05f66d43a
commit c622a1518e
2 changed files with 5 additions and 3 deletions

View File

@@ -149,7 +149,8 @@ function capabilities(host, port)
local socket = nmap.new_socket()
local capas = {}
socket:set_timeout(10000)
if not socket:connect(host.ip, port.number) then return nil, "Could Not Connect" end
local proto = (port.version and port.version.service_tunnel == "ssl" and "ssl") or "tcp"
if not socket:connect(host.ip, port.number, proto) then return nil, "Could Not Connect" end
status, line = socket:receive_lines(1)
if not stat(line) then return nil, "No Response" end

View File

@@ -71,10 +71,11 @@ action = function(host, port)
local try = nmap.new_try(catch)
local attempt = try(socket:connect(host.ip, port.number, port.protocol))
local proto = (port.version and port.version.service_tunnel == "ssl" and "ssl") or port.protocol
local attempt = try(socket:connect(host.ip, port.number, proto))
if attempt then
if nmap.verbosity() >= 2 or nmap.debugging() >= 1 then -- only tell you it fails if you are debugging or verbose X 2
return "Problem connecting to " .. host.ip .. " on port " .. port.number .. " using protocol " .. port.protocol
return ("Problem connecting to %s on port %d using protocol %s%s"):format(host.ip, port.number, port.protocol, (proto == "ssl" and " (ssl)") or "")
else
return -- if you aren't debugging, just return with nothing
end