Skip to content

Commit 842a7a3

Browse files
author
HD Moore
committed
Change SSLCert to HandlerSSLCert to avoid conflicts with modules
1 parent 9ed8c59 commit 842a7a3

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

lib/msf/core/handler/reverse_http.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def setup_handler
138138
'MsfExploit' => self,
139139
},
140140
comm,
141-
(ssl?) ? datastore["SSLCert"] : nil
141+
(ssl?) ? datastore["HandlerSSLCert"] : nil
142142
)
143143

144144
self.service.server_name = datastore['MeterpreterServerName']

lib/msf/core/handler/reverse_https.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ def initialize(info = {})
3838

3939
register_options(
4040
[
41-
OptPort.new('LPORT', [ true, "The local listener port", 8443 ])
41+
OptPort.new('LPORT', [ true, "The local listener port", 8443 ]),
42+
], Msf::Handler::ReverseHttps)
43+
44+
register_advanced_options(
45+
[
46+
OptPath.new('HandlerSSLCert', [false, "Path to a SSL certificate in unified PEM format"])
4247
], Msf::Handler::ReverseHttps)
4348

4449
end

lib/msf/core/handler/reverse_tcp.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def wrap_aes_socket(sock)
189189
m.reset
190190
key = m.digest(datastore["AESPassword"] || "")
191191

192-
Rex::ThreadFactory.spawn('AESEncryption', false) {
192+
Rex::ThreadFactory.spawn('Session-AESEncrypt', false) {
193193
c1 = OpenSSL::Cipher.new('aes-128-cfb8')
194194
c1.encrypt
195195
c1.key=key
@@ -202,7 +202,7 @@ def wrap_aes_socket(sock)
202202
end
203203
sock.close()
204204
}
205-
Rex::ThreadFactory.spawn('AESEncryption', false) {
205+
Rex::ThreadFactory.spawn('Session-AESDecrypt', false) {
206206
c2 = OpenSSL::Cipher.new('aes-128-cfb8')
207207
c2.decrypt
208208
c2.key=key

lib/msf/core/handler/reverse_tcp_ssl.rb

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ def initialize(info = {})
4444
super
4545
register_advanced_options(
4646
[
47-
OptPath.new('SSLCert', [ false, 'Path to a custom SSL certificate (default is randomly generated)']),
48-
OptAddress.new('ReverseListenerBindAddress', [ false, 'The specific IP address to bind to on the local system']),
49-
OptInt.new('ReverseListenerBindPort', [ false, 'The port to bind to on the local system if different from LPORT' ])
47+
OptPath.new('HandlerSSLCert', [false, "Path to a SSL certificate in unified PEM format"])
5048
], Msf::Handler::ReverseTcpSsl)
5149

5250
end
@@ -57,8 +55,8 @@ def initialize(info = {})
5755
# if it fails to start the listener.
5856
#
5957
def setup_handler
60-
if datastore['Proxies']
61-
raise RuntimeError, 'TCP connect-back payloads cannot be used with Proxies'
58+
if datastore['Proxies'] and not datastore['ReverseAllowProxy']
59+
raise RuntimeError, 'TCP connect-back payloads cannot be used with Proxies. Can be overriden by setting ReverseAllowProxy to true'
6260
end
6361

6462
ex = false
@@ -81,7 +79,7 @@ def setup_handler
8179
'LocalHost' => ip,
8280
'LocalPort' => local_port,
8381
'Comm' => comm,
84-
'SSLCert' => datastore['SSLCert'],
82+
'SSLCert' => datastore['HandlerSSLCert'],
8583
'Context' =>
8684
{
8785
'Msf' => framework,

0 commit comments

Comments
 (0)