Share
## https://sploitus.com/exploit?id=20B0B80E-8F18-519B-9C29-A0CDC6C4AEEC
# π End-to-end security assessment of vehicle subsystems
[! [Methodology](https://img.shields.io/badge/Methodology-ISO%2FSAE_21434-blue)](https://www.iso.org/standard/70918.html)
[! [Python](https://img.shields.io/badge/Python-3.11+-green)](https://python.org)
[! [Docker](https://img.shields.io/badge/Docker-Compose-blue)](https://docs.docker.com/compose/)
[! [License](https://img.shields.io/badge/License-MIT-yellow)](LICENSE)
**Professional-grade Vehicle Cybersecurity Assessment Platform**, demonstrating the complete ISO/SAE 21434 security engineering workflow: TARA analysis β vulnerability assessment β vulnerability exploitation β defense β intrusion detection.
> π― Built specifically for cybersecurity engineers entering the automotive security field. Demonstrates real-world vehicle security skills applicable to Chinese automotive OEMs and Tier-1 suppliers.
## π Catalog.
- [Project Conduct Process](# - Project Conduct Process)
- [Architecture](#-Architecture)
- [Quick Start](#-Quick Start)
- [Project Structure](#-Project Structure)
- [Phases](#-Phases)
- [Vulnerability Matrix](#-Vulnerability Matrix)
- [Attack Demo](#-Attack Demo)
- [Defense Results](#-Defense Results)
- [IDS Detection](#-ids-detection)
- [Tools](#-Tools)
- [Skill Show](#-Skill Show)
## πΊοΈ Project Conduct Process
The execution of this project strictly follows the vehicle network security engineering process specified in the ISO/SAE 21434 standard, building a complete vehicle subsystem from scratch, and then progressively completing security assessment, attack verification, defense hardening, and intrusion detection.
### Overall methodology
``##
Environment build β TARA threat analysis β vulnerability assessment β attack exploitation β defense implementation β intrusion detection β final report
(Step 1) (Step 2) (Step 3) (Step 4) (Step 5) (Step 6) (Step 7)
``
### Detailed execution steps
---
#### π§ Step 1: Build the simulation environment (`environment/`)
**Objective**: build a complete remote vehicle control subsystem containing the full link from the cloud to the CAN bus.
| Substeps | What to do | Output | Verification Methods |
|:---|:---|:---|:---|
| 1.1 | Write `docker-compose.yml`, define 5 services (PostgreSQL, EMQX, Cloud API, T-BOX, ECU) | `docker-compose.yml` | `docker compose up -d` All started successfully | | 1.2 | Develop
| 1.2 | Develop **Cloud API** (Flask) to implement 20+ REST endpoints for user authentication, vehicle management, remote commands, etc. | `cloud-api/` All code | `curl` Test register/login/send commands |
| 1.3 | Develop **T-BOX gateway** (Python) for MQTT β CAN bi-directional bridging | `tbox-simulator/` All code | MQTT messages are correctly forwarded to CAN bus |
| 1.4 | Develop **ECU simulator** (Python) for body control + UDS diagnostic service | `ecu-simulator/` All code | CAN messages trigger correct vehicle state changes |
| 1.5 | Write `setup.sh` one-click deployment script + SQL seed data | `setup.sh`, `init-db.sql` | Execute `. /setup.sh` and end-to-end command flow works |
| 1.6 | Develop 3 security assessment tools | `tools/` all code | each tool runs independently and produces results |
**The key to this step**: 19 vulnerabilities** (V-01 through V-19) were intentionally planted in the code** that mimic common security flaws in real vehicle systems to provide targets for subsequent security assessments and attack demonstrations.
---
#### π Step 2: TARA Threat Analysis and Risk Assessment (`tara/`)
**Objective**: perform a systematic threat analysis and risk assessment of the system built in step 1 according to ISO/SAE 21434.
| Substeps | Output Documentation | Content |
|:---|:---|:---|
| 2.1 | `project-definition.md` | System description, architecture diagram, data flow diagram (DFD), external interfaces, communication protocols, security assumptions |
| 2.2 | `asset-inventory.md` | Identify 25 security assets (data/functional/communication/physical/software) and assign a C/I/A rating to each | 2.3 | `asset-inventory.md` | Identify and assign a C/I/A rating to each
| 2.3 | `threat-scenarios.md` | Identify 26 threat scenarios using the STRIDE methodology and build an attack tree | 2.4 | `threat-scenarios.md` | Identify 25 security assets (data/functional/communication/physical/software) and assign a C/I/A rating to each
2.4 | `attack-paths.md` | Describes each step of four high-risk attack paths in detail, labeling existing security control points | 2.5 | `threat-scenarios.md` | Identifies 26 threat scenarios using the STRIDE methodology to build an attack tree.
| 2.5 | `risk-assessment.md` | 5Γ4 risk matrix (Impact I0-I3 Γ Feasibility E0-E3) with R1-R4 ratings | 2.6 | `attack-paths.md` | Detailed description of each step of the 4 high-risk attack paths, with existing security control points labeled
| 2.6 | `security-requirements.md` | Derivation of 22 security requirements from R3/R4 risks, creation of traceability matrix | 2.7 | `risk-assessment.md` | 5Γ4 risk matrix (impacts I0-I3 Γ feasibility E0-E3)
**Expected results**: 15 R4 (severe) risks + 11 R3 (high) risks, clear baseline of security requirements.
---
#### π Step 3: Vulnerability Assessment (`assessment/`)
**Objective**: perform systematic security testing of every component of the system to discover and document all vulnerabilities.
| Sub-steps | Test Objects | Test Methods |
|:---|:---|:---|
| 3.1 | Cloud API | Authentication Bypass Testing, BOLA Testing, SQL Injection, JWT Weakness, Rate Limiting, CORS, Error Handling |
| 3.2 | MQTT Broker | TLS Configuration Check, ACL Testing, Subject Enumeration, Credential Strength, Message Injection | 3.3 | TQTT Broker | TLS Configuration Check, ACL Testing, Subject Enumeration, Credential Strength, Message Injection
| 3.3 | T-BOX Gateway | Port Scanning, Credential Extraction, CAN Interface Accessibility, Firewall Rule Analysis | 3.4 | CAN Interface Accessibility, Firewall Rule Analysis
| 3.4 | CAN Bus | Sniffing and Protocol Reversal, Message Injection, Replay Attacks, DoS Flooding, UDS Service Enumeration | 3.5 | Aggregate | T-BOX Gateway | Port Scanning, Credential Extraction, CAN Interface Accessibility, Firewall Rules Analysis
| 3.5 | Aggregation | Generate Vulnerability Matrix (19 vulnerabilities with CVSS scores, reproduction steps, remediation scenarios) + Attack Chain Mapping
---
#### βοΈ Step 4: Attack Exploitation (`exploitation/`)
**Objective**: develop a runnable PoC attack script to validate the actual harm of the vulnerability from the attacker's perspective.
| Attack Scenarios | Exploit Vulnerability | Attack Link | Run Command |
|:---|:---|:---|:---|:---|
| **Remote Control Chain** | V-01, V-04, V-05, V-06 | Low-privilege login β BOLA overpass β Unsigned command injection β Take control of someone else's vehicle | `python exploit.py --base-url http://localhost:5000` |
| **CAN injection** | V-15, V-16 | Direct connection to vcan0 β Reverse CAN protocol β Inject forged messages β Control doors/engine | `sudo python can_inject.py --channel vcan0` |
| **MQTT injection** | V-11, V-12, V-13, V-14 | Steal credentials β connect to Broker β issue forged commands β fleet-level impact | `python mqtt_attack.py --host localhost` |
| **UDS Exploit** | V-17 | Enumerate UDS Services β XOR Crack SecurityAccess β Read/Write DID β ECU Control | `sudo python uds_exploit.py --channel vcan0` |
---
#### π‘οΈ Step 5: Defense Implementation (`defense/`)
**Objective**: implement the security requirements derived in step 2, fix all vulnerabilities, and verify the effectiveness of the defense.
| Substeps | Hardened Content | Fixed Vulnerabilities |
|:---|:---|:---|
| 5.1 | **API Hardening**: add Ownership Authentication Middleware, Password Policies, Rate Limiting, HMAC Signatures, Parameterized Queries, CORS Limitations, OTP Authentication, RBAC | V-01 to V-10 |
| 5.2 | **MQTT Security**: enable TLS, per-vehicle independent credentials, topic-level ACLs, message signature verification | V-11 through V-14 | 5.3 | **MQTT Security**: enable TLS, per-vehicle independent credentials, topic-level ACLs, message signature verification
| 5.3 | **CAN SecOC**: Enforce secure in-vehicle communication (counters + AES-CMAC) to prevent replay and injection | V-15, V-16 | 5.4 | *MQTT Security**: Enable TLS, per-vehicle independent credentials, subject-level ACLs, message signature validation
| 5.4 | **Gateway Filtering**: CAN ID whitelisting, frequency restriction, content validation, source authentication | V-15, V-16 (enhanced) |
| 5.5 | **Validation**: retest with attack scripts from step 4 β Generate pre- and post-enforcement comparison report | `validation-results.md` |
**Expected Results**: **90.5% of attacks completely blocked**, remaining 9.5% mitigated to acceptable residual risk.
---
#### π‘ Step 6: Intrusion Detection System (`ids/`)
**Objective**: build a multi-layer IDS to achieve real-time detection of attacks and cross-layer correlation analysis.
| Components | Functionality | Detection Capability |
|:---|:---|:---|
| `can_ids.py` | CAN Bus Anomaly Detection | Whitelist Filtering, Frequency Anomaly, Content Checking, Sequence Anomaly |
| `mqtt_ids.py` | MQTT Traffic Monitoring | Authentication Monitoring, Subject Access Monitoring, Message Frequency, Load Checking |
| `api_monitor.py` | API Attack Detection | Brute Force Detection, BOLA Detection, SQL Injection Detection, Endpoint Scanning Detection | `correlation_ids.py` | MQTT Traffic Monitor
| `correlation_engine.py` | Cross-layer correlation engine | 7 attack chain pattern matching, duplicate alarm suppression, confidence calculation | `dashboard.py` | API attack detection | Violent crack detection, BOLA detection, SQL injection detection, endpoint scan detection
| `dashboard.py` | Endpoint real-time dashboard | Three-layer status panel, real-time alarms, attack chain timeline |
**Expected results**: **85% detection rate**, false alarm rate below 5%, average detection delay 2.3 seconds.
---
#### π Step 7: Final Report (`report/`)
**Objective**: to produce a two-tier report for management and technical teams.
| reports | readers | content |
|:---|:---|:---|
| `executive-summary.md` | management | One-page summary: Key Findings Top 5, Risk Overview, Prioritized Recommendations, Security Posture Score |
| `technical-report.md` | Technical Team | Full technical report: methodology, TARA summary, vulnerability details, exploitation results, defense validation, IDS performance, lessons learned |
---
### Process Overview Diagram
``
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Vehicle Subsystem End-to-End Security Assessment Process β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
β Step 1 β β β Step 2 β β Step 3 β β Step 4 β β Step 5 β β Step 6 β β β Step 7 β
β ποΈ ββββββ π ββββββ π ββββββ βοΈ ββββββ π‘οΈ ββββββ π‘ βββββ π β
β Environment Setup β β TARA Analysis β β Vulnerability Assessment β β Attack Exploitation β β Defense Implementation β β Intrusion Detection β β Final Report β
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
β 5 Services β β 25 Assets β β 19 Vulnerabilities β β 4 PoCs β β 22 Hardenings β β 5 IDSs β β 2 Reports β
β 19 Vulnerabilities β β 26 Threats β β CVSS Score β β Operational β β 90.5% Blocking β β 85% Detection Rate β β Management+Technology β
β Intentionally implanted β β 22 requirements β β Attack chain diagram β β Attack script β β Residual receivable β β Low false positives β β Technical level β
ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
β β β β β β β β β β β
β β β β β β β β β β β β β β β β β β β β β
environment/ tara/ assessment/ exploitation/ defense/ ids/ report/
```
### Corresponds to ISO/SAE 21434 standard.
| Steps in this project | Correspondence to ISO/SAE 21434 Clause | Description |:---|:---|:---|
|:--- |:--- |:--- | Step 1.
| Step 1 Environment Setup | Clause 9 - Conceptual Phase | Define Relevant Items, System Boundaries, Preliminary Architecture | Step 2 TARA
| Step 2 TARA Analysis | Clause 15 - Threat Analysis and Risk Assessment | Asset Identification, Threat Scenarios, Impact Ratings, Attack Feasibility, Value at Risk Determination |
| Step 3 Vulnerability Assessment | Clause 10 - Product Development (Cybersecurity Validation) | Systematic Testing, Vulnerability Discovery, CVSS Scoring |
| Step 4 Attack Exploitation | Clause 10 - Product Development (Penetration Testing) | Attack Path Verification, PoC Development, Proof of Hazard |
| Step 5 Defense Implementation | Clause 10 - Product Development (Cybersecurity Measures) | Security Requirements Implementation, Vulnerability Remediation, Verification Testing |
| Step 6 Intrusion Detection | Clause 12 - Production/Operation (Cybersecurity Monitoring) | Real-Time Detection, Incident Response, Continuous Monitoring | Step 7 Final Reporting
| Step 7 Final Reporting | Clause 15 - Risk Assessment Reporting | TARA Reporting, Vulnerability Reporting, Verification Reporting |
## π Architecture
Γ°ΕΈ "Γ°ΕΈ "Γ°ΕΈ "Γ°ΕΈ "Γ°ΕΈ
ββββββββββββββββ HTTPS/JSON ββββββββββββββββ MQTT ββββββββββββββββ
β Mobile Apps β ββββββββββββββββββββ Cloud API β βββββββββββββββββ MQTT Proxy β
β (External) β β (Flask) β β (EMQX) β
ββββββββββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββ¬ββββββββ
β PostgreSQL β MQTT
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β Database β β T-BOX β
ββββββββββββββββ β Gateway β
ββββββββ¬β β ββββββββ
β CAN (vcan0)
βΌ
ββββββββββββββββ
β Body Control β
β ECU (BCM) β
ββββββββββββββββ
```
**Five components** to simulate the complete remote vehicle control chain:
1. **Cloud API** (Flask + JWT + PostgreSQL) - user authentication, vehicle management, command distribution
2. **MQTT proxy** (EMQX) - real-time message relaying
3. **T-BOX Gateway** (Python) - telematics unit connecting the cloud to the CAN bus
4. **CAN bus** (SocketCAN vcan0) - 500kbps legacy CAN
5. **Body Control ECU** (Python + UDS) - door locks, engine, lights, HVAC simulation
## π Quick Start
### Prerequisites
- **Linux** (Ubuntu 22.04+) with `docker`, `python3.11+`, `curl` installed.
- Windows users: using WSL2
### One-click installation
``bash``
## Clone and install
cd environment
chmod +x setup.sh
. /setup.sh
# This script will:
# 1. create the virtual CAN interface (vcan0)
# 2. start all 5 Docker services
# 3. initialize the database with seed data
# 4. verify end-to-end command flow
``
### Manual installation
``## bash
# 1. Create the CAN interface
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
# 2. Start the service
cd environment
docker compose up -d --build
# 3. Initialize the database
curl -X POST http://localhost:5000/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"username": "alice", "email": "alice@example.com", "password": "password123"}'
```
### Quick test
```bash.
### Login
TOKEN=$(curl -s -X POST http://localhost:5000/api/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"username": "alice", "password": "password123"}' \
| python3 -c "import sys,json; print(json.load(sys.stdin)['access_token'])")
# Send command
curl -X POST http://localhost:5000/api/v1/vehicles/SIMULATED12345678/commands \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"command_type": "lock", "parameters":{}}'
# Monitor CAN bus
candump vcan0
\ -d '{"command_type": "lock": "parameters":{}}'
### Service endpoints
| Service | URL | credentials |
|:---|:---|:---|
| **Cloud API** | http://localhost:5000 | - |
| **API Health Check** | http://localhost:5000/health | - |
| **EMQX Dashboard** | http://localhost:18083 | admin / admin123 |
| **MQTT proxy** | localhost:1883 | tbox_client / tbox_pass_2024 |
| **PostgreSQL** | localhost:5432 | admin / admin123 / vehicle_security |
### Test account
| username | password | role | vehicle |
|:---|:---|:---|:---|
| alice | password123 | owner | SIMULATED12345678, SIMULATED87654321 |
| bob | bob2024 | owner | SIMULATED1111111111 |
## π Project structure
``
vehicle-security-assessment/
βββ README.md # β current file
β
βββ environment/ # Docker + application code
β βββ docker-compose.yml # 5 Service Orchestration
β βββ setup.sh # 1-click install scripts
β βββ init-db.sql # Database schema + seed data
β βββ cloud-api/ # Flask REST API (Python)
β β βββ app.py # Application factory
β βββ config.py # Configuration (V-03, V-04, V-08)
β β βββ models.py # SQLAlchemy models
β βββ auth.py # /api/v1/auth/* Endpoints
β βββ vehicles.py # /api/v1/vehicles/* (V-01, V-06)
β β βββ commands.py # /api/v1/vehicles/*/commands/* (V-05, V-09)
β βββ diagnostics.py # /api/v1/vehicles/*/diagnostics/* (V-10)
β β βββ mqtt_publisher.py # MQTT Client (V-11, V-12)
β βββ crypto_utils.py # HMAC utilities (V-05)
β βββ tbox-simulator/ # T-BOX gateway (Python)
β β βββ tbox_simulator/ # T-BOX Gateway (Python)
β β βββ main.py # Entry point
β β βββ config.py # Configuration (V-11, V-12, V-14,V-15,V-16)
β β βββ mqtt_client.py # MQTT connection
β β βββ can_bridge.py # CAN bus interface
β β βββ command_processor.py # Command Routing (V-14)
β β βββ firewall.py # CAN firewall (V-15, V-16)
β β βββ crypto_utils.py # HMAC/SecOC
β βββ uds_handler.py # UDS forwarding
β βββ ecu-simulator/ # Body Control ECU (Python)
β β βββ ecu_simulator/ # Body Control ECU (Python)
β β βββ main.py # Entry point
β β βββ state.py # Vehicle state management
β β βββ body_control.py # door/engine/light/HVAC control
β β βββ can_handler.py # CAN Message Handler
β β βββ uds_server.py # UDS Diagnostics (V-17)
β βββ logger.py # Event Logging
β βββ mqtt-broker/ # EMQX Configuration (V-11, V-13)
β βββ emqx.conf
β
βββ tara/ # Phase 1: TARA Analysis
β βββ project-definition.md # System description + DFD
β βββ asset-inventory.md # 25 assets with C/I/A ratings
β βββ threat-scenarios.md # 26 STRIDE threats + attack tree
β βββ attack-paths.md # 4 detailed attack paths
β βββ risk-assessment.md # impact Γ feasibility matrix
β βββ security-requirements.md # 22 requirements + traceability
β ββ security-requirements.md # 22 requirements + traceability
βββ assessment/ # Stage 2: Vulnerability Assessment
β ββ api-assessment.md # 10 API vulnerabilities
β βββ mqtt-assessment.md # 4 MQTT vulnerabilities
β βββ tbox-assessment.md # T-BOX security test
β βββ can-assessment.md # CAN bus security test
β βββ vulnerability-summary.md # Full Vulnerability Matrix
β
β βββ exploitation/ # Phase 3: Attack Demonstration
β βββ attack-remote-control/ # API β Vehicle Chain of Control
β β βββ exploit.py # Runnable PoC Scripts
β βββ README.md # Step-by-step instructions
β βββ attack-can-injection/ # Direct CAN injection
β β βββ can_inject.py # Runnable PoC Scripts
β βββ README.md
β βββ attack-mqtt-injection/ # MQTT proxy vulnerability exploitation
β β βββ mqtt_attack.py # Runnable PoC scripts
β β βββ README.md
β βββ attack-uds-abuse/ # UDS diagnostic exploit
β βββ uds_exploit.py # Runnable PoC script β βββ README.md β βββ attack-uds-abuse/ # UDS diagnostic exploit
β βββ README.md
β ββ README.md
βββ defense/ # Phase 4: Defense Implementation
β βββ api-hardening/ # Hardened APIs (SR-01 to SR-10)
β βββ mqtt-security/ # TLS + ACL Configuration (SR-13 to SR-15)
β βββ can-secoc/ # SecOC implementation (SR-12, SR-20)
β βββ gateway-filter/ # Enhanced Firewall (SR-17 to SR-19)
β βββ validation-results.md # Before and after enhancements
β βββ validation-results.md
βββ ids/ # Phase 5: Intrusion Detection
β ββ can_ids.py # CAN bus anomaly detection
β βββ mqtt_ids.py # MQTT Traffic Monitoring
β βββ api_monitor.py # API Attack Detection
β βββ correlation_engine.py # Cross-layer attack chain detection
β βββ dashboard.py # Terminal real-time dashboards
β βββ detection-results.md # Detection rate analysis
β
β βββ tools/ # Security assessment tools
β βββ can_analyzer.py # CAN protocol reverse engineering
β βββ mqtt_fuzzer.py # MQTT protocol fuzzer tester
β βββ api_scanner.py # API security scanner
β βββ api_scanner.py # API security scanner β
βββ report/ # Final report
βββ executive-summary.md # One-page management summary β βββ technical-report.md # API security scanner
βββ technical-report.md # Comprehensive technical report
``
## π¬ phases
### Phase 1: TARA Analysis
- 25 assets covering 5 categories (data, functional, communications, physical, software)
- 26 threat scenarios analyzed using the STRIDE methodology
- "Unauthorized Remote Vehicle Control" Full Attack Tree
- 5Γ4 Risk Matrix: 15 Critical (R4), 11 High Risk (R3)
- 22 derived security requirements with full traceability
### Phase 2: Vulnerability Assessment
- Systematic testing of all 5 components
- 19 vulnerability documents with CVSS scores, reproduction steps and remediation options
- Attack chain mapping, showing combinations of vulnerabilities
### Phase 3: Exploitation
- **4 runnable Python PoC scripts** with detailed README instructions
- Demonstrates the complete remote control chain
- CAN injection with replay and DoS
- MQTT proxy intrusion affecting entire fleet
- Breaking UDS security access in 1 attempt
### Phase 4: Defense Implementation
- 22 security requirements implemented
- **90.5% of attacks completely blocked
- All R3/R4 risks eliminated
- Pre- and post-hardening validation results documented
### Phase 5: Intrusion Detection
- Multi-layer IDS (CAN + MQTT + API)
- Cross-layer correlation engine with 7 attack pattern definitions
- Endpoint-based real-time dashboard
- **85% Detection rate** with less than 5% false alarm rate
## π΄ Vulnerability Matrix
| ID | Component | Vulnerability | CVSS | Risk |
|:---:|:---|:---|:---:|:---:|:---:|
| V-01 | Cloud API | BOLA - No Ownership Authentication | 9.1 | R4 |
| V-01 | Cloud API | BOLA - No Ownership Authentication | 9.1 | R4 | V-02 | Cloud API | Weak Password Policies | 5.3 | R3 |
| V-03 | Cloud API | Hard-Coded JWT Key ("secret123") | 8.0 | R4 | V-02 | Cloud API | Weak Password Policy | 5.3 | R3
| V-04 | Cloud API | Login without Rate Limit | 7.5 | R3 | V-03 | Cloud API | Hard-Coded JWT Key ("secret123")
| V-05 | Cloud API | Command Signature Optional | 8.6 | R4 |
| V-06 | Cloud API | SQL Injection in Vehicle Search | 9.8 | R4 | V-06 | Cloud API | SQL Injection in Vehicle Search | 9.8 | R4 | V-07 | Cloud API
| V-07 | Cloud API | Detailed Error Messages Leaked | 5.3 | R3 | V-08 | Cloud API | SQL Injection in Vehicle Search | 9.8 | R4 | Cloud API
| V-08 | Cloud API | CORS Allow All Sources (*) | 6.5 | R3 | V-08 | Cloud API | CORS Allow All Sources (*) | 6.5 | R4 |
| V-09 | Cloud API | No OTP Validation for Sensitive Commands | 7.4 | R3 | V-08 | Cloud API | CORS Allow All Sources (*) | 6.5 | R3 |
| V-10 | Cloud API | Diagnostic Interface without Role Checking | 8.1 | R3 | V-11 | MQTAG | Cloud API
| V-11 | MQTT | No TLS encryption | 7.5 | R4 | V-12 | MQTT | Shared T-BOX credentials | 8.0 | R4 |
| V-12 | MQTT | Shared T-BOX Credentials | 8.0 | R4 | V-12 | MQTT | Shared T-BOX Credentials | 7.5 | R4
| V-15 | T-BOX | Firewall No Source Checking | 7.5 | R4 |
| V-16 | T-BOX | Firewall no content validation | 6.5 | R3 |
| V-17 | ECU | Weak UDS SecurityAccess (XOR) | 6.5 | R3 |
| V-18 | Infrastructure | Weak Database Passwords | 7.5 | R3 |
| V-19 | Infrastructure | Weak MQTT Dashboard Password | 6.5 | R3 |
## βοΈ Attack Demo
### 1. Remote control via cloud APIs
```bash
cd exploitation/attack-remote-control
python exploit.py --base-url http://localhost:5000
```
Exploitation Vulnerabilities: V-01 (BOLA), V-04 (No Rate Limit), V-05 (No Signature), V-06 (SQL Injection)
### 2. Direct CAN bus injection
```bash
sudo python exploitation/attack-can-injection/can_inject.py --channel vcan0
```
Exploitation Vulnerabilities: V-15 (no source checking), V-16 (no content validation), CAN protocol weaknesses
### 3. MQTT proxy vulnerability exploitation
```bash
python exploitation/attack-mqtt-injection/mqtt_attack.py --host localhost
```
Exploitation Vulnerabilities: v-11 (no TLS), v-12 (shared credentials), v-13 (no ACL), v-14 (no signature checking)
### 4. UDS Diagnostics Vulnerability Exploits
```bash
sudo python exploitation/attack-uds-abuse/uds_exploit.py --channel vcan0
```
Exploitation Vulnerability: V-17 (Weak XOR SecurityAccess)
## π‘οΈ Defense results
| Attack | Pre-Hardened | Post-Hardened | Status |
|:---|:---|:---|:---:---:|
| BOLA | Full Access | 403 Banned | β
Blocked |
| SQL Injection | Data Extraction | ORM Queries | β
Blocked |
| JWT Forgery | Token Forgery | Random 256-bit Keys | β
Blocked
| JWT Forging | Token Forgery | Random 256-bit Key β
Blocked | Brute Force | Unlimited | 5x/minute + Lockout β
Blocked
| Unsigned Commands | Executable | Signature Verification Required β
Blocked | CAN Injection | Executable | Random 256-bit Keys β
Blocked
| CAN Injection | Executable | SecOC MAC Invalid | β
Blocked | | CAN Replay | Executable | Signature Verification β
Blocked
| CAN Replay | Executable | Counter Expired | β
Blocked | CAN DoS | 500 | CAN DoS | 500 | Signature Verification β
Blocked
| CAN DoS | 500 bars/sec | 10 bars/sec limit | β οΈ Mitigated |
| MQTT Eavesdropping | Visible in Plaintext | TLS 1.3 | β
Blocked |
| MQTT Injection | Executable | Signature Invalid | β
Blocked |
| UDS Cracking | 1 attempt | AES Challenge | β οΈ mitigated |
**Overall: 90.5% fully blocked, 9.5% mitigated to an acceptable residual risk**
## π IDS Detection
| Attacks | CAN IDS | MQTT IDS | API Monitoring | Correlation Engine | Detection Results |
|:---|:---:|:---:|:---:|:---:|:---:|
| Remote Control Chain | β β β β β β β β β β β β β β
|
| CAN Injection | β | - | - | - | β
|
| MQTT Injection | - | β | - | - β
|
| UDS Brute Force | | β | - | - | - β
|
| CAN DoS | β | - | - | - β
|
| CAN Replay | β | - | - | - β
|
| API Brute Force | - | - | β | - β
| β
|
| SQL Injection | - | - | β | - | β
|
**Detection Rate: 85% | False Alarm Rate:
Built for automotive cybersecurity engineers entering the vehicle security space.
All simulations are containerized - no real vehicle hardware required.