mirror of
https://github.com/nmap/nmap.git
synced 2026-09-26 10:12:59 +00:00
shortport.ssl: don't send 2 probes if the first gives obviously not-ssl response
This commit is contained in:
parent
c892dab9a3
commit
7a790d3665
1 changed files with 12 additions and 6 deletions
|
|
@ -259,12 +259,18 @@ function ssl(host, port)
|
|||
\x08\0\x06\0\x03\x01\0",
|
||||
}) do
|
||||
local status, resp = comm.exchange(host, port, probe)
|
||||
if status and resp and (
|
||||
resp:match("^\x16\x03[\0-\x03]..\x02...\x03[\0-\x03]") or
|
||||
resp:match("^\x15\x03[\0-\x03]\0\x02\x02[F\x28]")
|
||||
) then
|
||||
v = true
|
||||
break
|
||||
if status and resp then
|
||||
if resp:match("^\x16\x03[\0-\x03]..\x02...\x03[\0-\x03]")
|
||||
or resp:match("^\x15\x03[\0-\x03]\0\x02\x02[F\x28]") then
|
||||
-- Definitely SSL
|
||||
v = true
|
||||
break
|
||||
elseif not resp:match("^[\x16\x15]\x03") then
|
||||
-- Something definitely not SSL
|
||||
v = false
|
||||
break
|
||||
end
|
||||
-- Something else? better try the other probes
|
||||
end
|
||||
end
|
||||
host.registry.ssl[port.number .. port.protocol] = v or false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue