Laboratoire complet d'attaque furtive IA sur réseau CAN automobile simulé.
Construire un laboratoire de cybersécurité embarquée permettant :
- Simulation d'un réseau CAN automobile (vcan0)
- Génération de trafic ECU réaliste (Engine, ABS, Steering, Cluster)
- Injection d'attaques CAN (naïves + IA stealth via LSTM)
- Détection par IDS : règles classiques, Isolation Forest, Autoencoder, CUSUM
- Démonstration live avec dashboard Streamlit + API FastAPI
[ ECU Simulators ] ---> [ Virtual CAN (vcan0) ] ---> [ Logger ]
|
v
[ Feature Pipeline ]
|
--------------------------------
| |
[ IA Attacker ] [ IDS System ]
| |
--------------------------------
|
v
[ API + Dashboard ]
wsl --install -d Ubuntusudo apt update && sudo apt install -y can-utils python3 python3-pip python3-venv git build-essential
# Setup Virtual CAN
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
# Vérifier
ip link show vcan0# Cloner le repo
git clone https://github.com/DanielMBouyou/CAN-BUS-HACKING.git
cd CAN-BUS-HACKING
# Créer environnement virtuel
python3 -m venv .venv
source .venv/bin/activate
# Installer le projet
pip install -e ".[dev]"cd docker
docker compose up --buildpython -m canlab.sim.buspython -m canlab.data.ingest
python -m canlab.data.featurespython -m canlab.ids.rulespython -m canlab.attack.injector# Terminal 1 : API
uvicorn canlab.api.main:app --host 0.0.0.0 --port 8000
# Terminal 2 : Dashboard
streamlit run src/canlab/ui/app_streamlit.py| ECU | ID (hex) | Fréquence | Payload |
|---|---|---|---|
| Engine | 0x100 | 10 ms | RPM |
| ABS | 0x110 | 20 ms | Wheel speed |
| Steering | 0x120 | 50 ms | Angle |
| Cluster | 0x130 | 100 ms | Speed display |
- Precision / Recall / F1
- False Positive Rate
- Detection Delay
- Attack Success Rate
can-stealth-attack-ai/
├── README.md
├── pyproject.toml
├── docker/
│ ├── Dockerfile
│ └── docker-compose.yml
├── docs/
│ ├── threat_model.md
│ ├── architecture.md
│ ├── demo_script.md
│ └── metrics.md
├── src/
│ └── canlab/
│ ├── config.py
│ ├── sim/ # Simulation ECU + bus
│ ├── data/ # Ingestion + feature engineering
│ ├── attack/ # IA attaquante (LSTM + Optuna)
│ ├── ids/ # Systèmes IDS
│ ├── api/ # FastAPI
│ └── ui/ # Streamlit dashboard
├── tests/
└── data/
├── raw/
├── processed/
└── features/
pytest tests/ -vMIT
DanielMBouyou — GitHub