Skip to content

Commit e07d174

Browse files
authored
Merge pull request #20511 from mwalas-r7/fix/sni-support-for-ssl-scanner
Added SNI support for the ssl_version scanner
2 parents 2ca14c9 + 9fb4966 commit e07d174

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

modules/auxiliary/scanner/ssl/ssl_version.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def initialize
7474

7575
register_options(
7676
[
77+
OptString.new('SSLServerNameIndication', [ false, 'SSL/TLS Server Name Indication (SNI)', nil]),
7778
OptEnum.new('SSLVersion', [ true, 'SSL version to test', 'All', ['All'] + Array.new(OpenSSL::SSL::SSLContext.new.ciphers.length) { |i| (OpenSSL::SSL::SSLContext.new.ciphers[i][1]).to_s }.uniq.reverse]),
7879
OptEnum.new('SSLCipher', [ true, 'SSL cipher to test', 'All', ['All'] + Array.new(OpenSSL::SSL::SSLContext.new.ciphers.length) { |i| (OpenSSL::SSL::SSLContext.new.ciphers[i][0]).to_s }.uniq]),
7980
]
@@ -471,8 +472,11 @@ def run_host(ip)
471472

472473
begin
473474
ctx = { 'Msf' => framework, 'MsfExploit' => self }
475+
tls_server_name_indication = nil
476+
tls_server_name_indication = datastore['SSLServerNameIndication'] if datastore['SSLServerNameIndication'].present?
477+
tls_server_name_indication = datastore['RHOSTNAME'] if tls_server_name_indication.nil? && datastore['RHOSTNAME'].present?
474478
# Initialize rex-sslscan scanner
475-
scanner = Rex::SSLScan::Scanner.new(ip, rport, ctx)
479+
scanner = Rex::SSLScan::Scanner.new(ip, rport, ctx, tls_server_name_indication: tls_server_name_indication)
476480

477481
# Perform the scan
478482
scan_result = scanner.scan

0 commit comments

Comments
 (0)