Skip to content

Commit dae1f26

Browse files
committed
Land rapid7#7521, Modernize TLS protocol configuration for SMTP / SQL Server
2 parents eca4b73 + 6577728 commit dae1f26

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

lib/metasploit/framework/mssql/tdssslproxy.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ def cleanup
5151
def setup_ssl
5252
@running = true
5353
@t1 = Thread.start { ssl_setup_thread }
54-
ssl_context = OpenSSL::SSL::SSLContext.new(:TLSv1)
55-
@ssl_socket = OpenSSL::SSL::SSLSocket.new(@s1, ssl_context)
54+
ctx = OpenSSL::SSL::SSLContext.new(:SSLv23)
55+
ctx.ciphers = "ALL:!ADH:!EXPORT:!SSLv2:!SSLv3:+HIGH:+MEDIUM"
56+
@ssl_socket = OpenSSL::SSL::SSLSocket.new(@s1, ctx)
5657
@ssl_socket.connect
5758
end
5859

lib/msf/core/exploit/smtp_deliver.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,9 @@ def swap_sock_plain_to_ssl(nsock=self.sock)
228228
end
229229

230230
def generate_ssl_context
231-
ctx = OpenSSL::SSL::SSLContext.new
232-
ctx.key = OpenSSL::PKey::RSA.new(1024){ }
233-
234-
ctx.session_id_context = Rex::Text.rand_text(16)
235-
236-
return ctx
231+
ctx = OpenSSL::SSL::SSLContext.new(:SSLv23)
232+
ctx.ciphers = "ALL:!ADH:!EXPORT:!SSLv2:!SSLv3:+HIGH:+MEDIUM"
233+
ctx
237234
end
238235

239236
end

modules/exploits/linux/misc/nagios_nrpe_arguments.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def check
154154

155155
end
156156

157-
# NRPE uses unauthenticated Annonymous-Diffie-Hellman
157+
# NRPE uses unauthenticated Anonymous-Diffie-Hellman
158158

159159
# setting the global SSL => true will break as we would be overlaying
160160
# an SSLSocket on another SSLSocket which hasnt completed its handshake
@@ -163,7 +163,7 @@ def connect(global = true, opts={})
163163
self.sock = super(global, opts)
164164

165165
if datastore['NRPESSL'] or @force_ssl
166-
ctx = OpenSSL::SSL::SSLContext.new("TLSv1")
166+
ctx = OpenSSL::SSL::SSLContext.new(:TLSv1)
167167
ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
168168
ctx.ciphers = "ADH"
169169

0 commit comments

Comments
 (0)