mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-11-05 14:57:30 +01:00
Land #12286, RDP lib: lower SSL security level for compatibility with older implementations
This commit is contained in:
commit
73eab2c34a
@ -24,6 +24,10 @@ module Exploit::Remote::RDP
|
||||
OptAddress.new('RDP_CLIENT_IP', [ true, 'The client IPv4 address to report during connect', '192.168.0.100']),
|
||||
Opt::RPORT(3389)
|
||||
], Msf::Exploit::Remote::RDP)
|
||||
register_advanced_options(
|
||||
[
|
||||
OptInt.new('RDP_TLS_SECURITY_LEVEL', [ true, 'Change default TLS security level. "0" (default) means everything is permitted. "1" rejects very weak parameters and "2" is even stricter.', 0 ])
|
||||
], Msf::Exploit::Remote::RDP)
|
||||
end
|
||||
|
||||
|
||||
@ -1008,9 +1012,15 @@ module Exploit::Remote::RDP
|
||||
def swap_sock_plain_to_ssl(nsock)
|
||||
ctx = OpenSSL::SSL::SSLContext.new
|
||||
ctx.min_version = OpenSSL::SSL::TLS1_VERSION
|
||||
ctx.security_level = datastore['RDP_TLS_SECURITY_LEVEL']
|
||||
ssl = OpenSSL::SSL::SSLSocket.new(nsock, ctx)
|
||||
|
||||
ssl.connect
|
||||
begin
|
||||
ssl.connect
|
||||
rescue Errno::ECONNRESET
|
||||
vprint_error("Retry with advanced option RDP_TLS_SECURITY_LEVEL=0")
|
||||
raise
|
||||
end
|
||||
|
||||
nsock.extend(Rex::Socket::SslTcp)
|
||||
nsock.sslsock = ssl
|
||||
|
Loading…
Reference in New Issue
Block a user