forked from rapid7/metasploit-framework
-
Notifications
You must be signed in to change notification settings - Fork 2
/
https.rb
48 lines (41 loc) · 1.46 KB
/
https.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
module Msf::Payload::Adapter::Fetch::Server::Https
include Msf::Payload::Adapter::Fetch::Server::HTTP
# This mixin supports both HTTP and HTTPS fetch handlers. If you only want
# HTTP, use the HTTP mixin that imports this, but removes the HTTPS options
def initialize(*args)
super
register_options(
[
Msf::OptBool.new('FETCH_CHECK_CERT', [true, 'Check SSL certificate', false])
]
)
register_advanced_options(
[
Msf::OptPath.new('FetchSSLCert', [ false, 'Path to a custom SSL certificate (default is randomly generated)', '']),
Msf::OptBool.new('FetchSSLCompression', [ false, 'Enable SSL/TLS-level compression', false ]),
Msf::OptString.new('FetchSSLCipher', [ false, 'String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"']),
Msf::OptEnum.new('FetchSSLVersion',
'Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate)',
enums: Rex::Socket::SslTcp.supported_ssl_methods)
]
)
end
def fetch_protocol
'HTTPS'
end
def ssl_cert
datastore['FetchSSLCert']
end
def ssl_compression
datastore['FetchSSLCompression']
end
def ssl_cipher
datastore['FetchSSLCipher']
end
def ssl_version
datastore['FetchSSLVersion']
end
def start_https_fetch_handler(srvname, srvexe)
start_http_fetch_handler(srvname, srvexe, true, ssl_cert, ssl_compression, ssl_cipher, ssl_version)
end
end