Laboratoire complet permettant :
- Simulation d'un firmware IoT vulnérable (type ESP32) compilé en C, exécuté sous QEMU
- Reverse engineering du firmware (call graph, entropie, analyse binaire)
- Identification et exploitation de vulnérabilités (buffer overflow, stack-based exploits)
- IA offensive : fuzzing intelligent (RL/PPO + Bayesian Optimization) + génération d'exploits (LSTM)
- IA défensive : détection comportementale (autoencoder), classification firmware compromis (RandomForest/MLP)
- Dashboard live via Streamlit + API FastAPI
[ Simulated Firmware (ESP32-like / QEMU) ]
|
[ Network Layer ]
|
-------------------
| |
[ IA Fuzzer ] [ IDS AI ]
| |
---------- API ----------
|
Dashboard
iot-firmware-ai-lab/
│
├── firmware/ # Firmware C vulnérable (compilé pour QEMU)
│ ├── main.c # Point d'entrée, serveur TCP
│ ├── mqtt.c # Handler MQTT simplifié
│ ├── ota.c # Mise à jour OTA (vulnérable)
│ ├── auth.c # Authentification (vulnérable)
│ └── Makefile # Compilation cross-compile ARM
│
├── analysis/ # Outils d'analyse statique/dynamique
│ ├── reverse/ # Scripts Ghidra / analyse binaire
│ ├── callgraph.py # Génération graphe d'appel
│ └── entropy_analysis.py # Analyse entropie mémoire
│
├── attack/ # IA offensive
│ ├── fuzzer_rl.py # Fuzzer guidé par Reinforcement Learning (PPO)
│ ├── bayes_optimizer.py # Optimisation bayésienne (Optuna)
│ └── exploit_generator.py # Génération d'exploits (LSTM)
│
├── defense/ # IA défensive
│ ├── autoencoder.py # Détection anomalie réseau
│ ├── classifier.py # Classification firmware sain/compromis
│ └── anomaly_detector.py # Détection OTA malveillante
│
├── api/ # Backend FastAPI
│ └── main.py
│
├── ui/ # Dashboard Streamlit
│ └── dashboard.py
│
├── docs/ # Documentation technique
│ ├── threat_model.md
│ ├── attack_strategy.md
│ └── results.md
│
├── docker/ # Containerisation
│ ├── Dockerfile
│ └── docker-compose.yml
│
├── requirements.txt
├── .gitignore
└── README.md
- Windows 11 + WSL2 Ubuntu (recommandé)
- Python 3.10+
- QEMU
- GCC ARM cross-compiler
wsl --install -d Ubuntusudo apt update
sudo apt install build-essential git python3 python3-pip python3-venv \
qemu-system gcc-arm-none-eabi binutils-arm-none-eabigit clone https://github.com/DanielMBouyou/embedded-iot-ai-hacklab.git
cd embedded-iot-ai-hacklab
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtcd firmware
makemake run
# OU directement :
qemu-system-arm -M lm3s6965evb -nographic -kernel firmware.elfcd api
uvicorn main:app --reload --host 0.0.0.0 --port 8000cd ui
streamlit run dashboard.py| Méthode | Endpoint | Description |
|---|---|---|
| POST | /fuzz/start |
Démarre le fuzzing IA |
| POST | /attack/generate |
Génère un exploit |
| GET | /status |
État du firmware |
| GET | /metrics |
Métriques (crash rate, etc.) |
| POST | /defense/train |
Entraîne le modèle défensif |
-
$Q$ = {Idle, Auth, Command, OTA, Error} -
$\Sigma$ = entrées réseau -
$\delta$ = fonction de transition
- Crash discovery rate : % d'inputs provoquant un crash
- Temps moyen pour trouver une vulnérabilité
- Success exploit rate : % d'exploits réussis
- False positive IDS : taux de fausses alertes
- Detection latency : temps de réaction IDS
- Lancer le firmware simulé
- Montrer fonctionnement normal (commandes TCP)
- Lancer fuzzing aléatoire → faible crash rate
- Lancer IA fuzzer (PPO) → crash rapide
- Générer exploit automatiquement
- Activer IDS IA
- Montrer détection en temps réel sur dashboard
- Intégration Ghidra automation (scripting headless)
- Symbolic execution (angr)
- Graph Neural Networks sur call graph
- Analyse dynamique mémoire (Valgrind)
MIT License – Projet éducatif uniquement. Usage en environnement contrôlé.
Développé par DanielMBouyou