Skip to content

Commit 4a9ef30

Browse files
committed
Use SSLVerifyMode and SSLCipher from the Exploit::Remote::Tcp mixin
1 parent b206de7 commit 4a9ef30

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

lib/msf/core/exploit/tcp.rb

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,17 @@ def connect(global = true, opts={})
100100
end
101101

102102
nsock = Rex::Socket::Tcp.create(
103-
'PeerHost' => opts['RHOST'] || rhost,
104-
'PeerPort' => (opts['RPORT'] || rport).to_i,
105-
'LocalHost' => opts['CHOST'] || chost || "0.0.0.0",
106-
'LocalPort' => (opts['CPORT'] || cport || 0).to_i,
107-
'SSL' => dossl,
108-
'SSLVersion' => opts['SSLVersion'] || ssl_version,
109-
'Proxies' => proxies,
110-
'Timeout' => (opts['ConnectTimeout'] || connect_timeout || 10).to_i,
111-
'Context' =>
103+
'PeerHost' => opts['RHOST'] || rhost,
104+
'PeerPort' => (opts['RPORT'] || rport).to_i,
105+
'LocalHost' => opts['CHOST'] || chost || "0.0.0.0",
106+
'LocalPort' => (opts['CPORT'] || cport || 0).to_i,
107+
'SSL' => dossl,
108+
'SSLVersion' => opts['SSLVersion'] || ssl_version,
109+
'SSLVerifyMode' => opts['SSLVerifyMode'] || ssl_verify_mode,
110+
'SSLCipher' => opts['SSLCipher'] || ssl_cipher,
111+
'Proxies' => proxies,
112+
'Timeout' => (opts['ConnectTimeout'] || connect_timeout || 10).to_i,
113+
'Context' =>
112114
{
113115
'Msf' => framework,
114116
'MsfExploit' => self,
@@ -269,6 +271,20 @@ def connect_timeout
269271
datastore['ConnectTimeout']
270272
end
271273

274+
#
275+
# Returns the SSL certification verification mechanism
276+
#
277+
def ssl_verify_mode
278+
datastore['SSLVerifyMode']
279+
end
280+
281+
#
282+
# Returns the SSL cipher to use for the context
283+
#
284+
def ssl_cipher
285+
datastore['SSLCipher']
286+
end
287+
272288
protected
273289

274290
attr_accessor :sock

0 commit comments

Comments
 (0)