mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +00:00
Check TLS body protocol for compatibility in ssl-enum-ciphers
Haven't seen this, and it shouldn't happen, but it's possible for a server to send the same protocol version in the record, but a different one in the body. This wouldn't be valid, so we should reject it.
This commit is contained in:
@@ -372,6 +372,10 @@ local function find_ciphers_group(host, port, protocol, group)
|
||||
elseif record["type"] ~= "handshake" or record["body"][1]["type"] ~= "server_hello" then
|
||||
ctx_log(2, protocol, "Unexpected record received.")
|
||||
break
|
||||
elseif record["body"][1]["protocol"] ~= protocol then
|
||||
ctx_log(1, protocol, "Protocol rejected.")
|
||||
protocol_worked = nil
|
||||
break
|
||||
else
|
||||
protocol_worked = true
|
||||
name = record["body"][1]["cipher"]
|
||||
|
||||
Reference in New Issue
Block a user