# nicholasaleks/damn-vulnerable-drone architecture

> Architecture diagram of the GitHub repository nicholasaleks/damn-vulnerable-drone, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nicholasaleks/damn-vulnerable-drone
- Repository: https://github.com/nicholasaleks/damn-vulnerable-drone

## Overview

##### Project Type and Purpose
- This project is a full-scale drone hacking simulator built around the ArduPilot/MAVLink environment. It intentionally introduces vulnerabilities to provide a simulated environment where offensive security professionals and pentesters can practice drone attack techniques.
- The README clearly describes the goal of emulating various drone components (flight controller, companion computer, ground control station, simulator via Gazebo, etc.) in Docker containers. The system also supports different deployment modes (Full-Deploy vs. Half-Baked).

##### Analyzing the File Structure
- There are several top-level directories:
- “companion-computer”: Contains the web interface, configuration files (e.g., DHCP, DNS, SSH, MAVLink router), endpoints (routes), static and template resources.
- “flight-controller”: Contains the ArduPilot configuration and scripts to initialize the flight controller.
- “ground-control-station”: Contains configuration (e.g., wpa_supplicant) and mission/stage scripts.
- “qgc”: Contains launcher scripts and configs for QGroundControl.
- “simulator”: Has Docker configurations, Gazebo assets (3D models, worlds) as well as a management interface (mgmt folder) and a gzweb subcomponent.
- The presence of Dockerfiles in several directories and a top-level docker-compose.yaml indicates that each major component is containerized.
- The “simulator/mgmt” folder further confirms that there is a dedicated management web console for initializing flight states and triggering attack scenarios.

- Flight Controller: Represents the ArduPilot firmware running in a container. Mark it with its Docker IP (10.13.0.2) with connection lines to the simulator.
- Companion Computer: Handles higher-level processing like telemetry, camera streaming, and interfaces with both the flight controller and the ground control station. It is assigned Docker IP 10.13.0.3 and a simulated wireless IP (192.168.13.1).
- Ground Control Station (GCS): Provides the remote pilot’s interface, mission planning and control. It has Docker IP 10.13.0.4 and wireless IP (192.168.13.14). Indicate that it communicates via the MAVLink protocol.
- Simulator (Gazebo): Represents the 3D simulation environment and the underlying physics engine. It communicates with the flight controller and is usually running at Docker IP 10.13.0.5.
- Management Web Console: Although not explicitly a separate container by name, it is part of the “simulator/mgmt” folder, and provides UI control to trigger flight states and attack scenarios.
- Additional components: QGroundControl integration and supporting Docker overlays (e.g., for the “qgc” container) can be included for completeness.
- Simulated networks: the dedicated simulation network (10.13.0.0/24) as well as the simulated wireless network (192.168.13.0/24) used between the companion computer and the ground control station.

##### Architectural Patterns and Design Principles
- Microservice or containerized architecture – each major component runs in its own Docker container.
- That the system follows a layered approach where lower-level systems (flight controller) interface with higher-level ones (companion computer) and then the UI layer (ground control and management web console).

Happy diagramming!

## Diagram (Mermaid)

```mermaid
graph TD
    %% Docker Compose Network (10.13.0.0/24)
    subgraph "Docker Compose Network (10.13.0.0/24)"
        FC["Flight Controller (ArduPilot & SITL)\nDocker IP:10.13.0.2"]:::backend
        CC["Companion Computer\nDocker IP:10.13.0.3\nWireless IP:192.168.13.1"]:::backend
        SIM["Simulator (Gazebo)\nDocker IP:10.13.0.5"]:::backend
        QGC["QGroundControl Integration"]:::backend
    end

    %% Wireless Network (192.168.13.0/24)
    subgraph "Wireless Network (192.168.13.0/24)"
        GCS["Ground Control Station (GCS)\nDocker IP:10.13.0.4\nWireless IP:192.168.13.14"]:::frontend
    end

    %% Management Console
    subgraph "Management Console"
        MGMT["Management Web Console\n(simulation mgmt UI)"]:::frontend
    end

    %% Connections between components
    CC -->|"controls"| FC
    FC -->|"telemetry_to"| SIM
    SIM -->|"simulation_data_to"| FC
    CC -->|"commands_telemetry"| GCS
    GCS -->|"MAVLink"| CC
    SIM -->|"ui_management"| MGMT
    GCS -->|"optional_QGC"| QGC

    %% Click Events
    click FC "https://github.com/nicholasaleks/damn-vulnerable-drone/tree/master/flight-controller"
    click CC "https://github.com/nicholasaleks/damn-vulnerable-drone/tree/master/companion-computer"
    click GCS "https://github.com/nicholasaleks/damn-vulnerable-drone/tree/master/ground-control-station"
    click SIM "https://github.com/nicholasaleks/damn-vulnerable-drone/tree/master/simulator"
    click MGMT "https://github.com/nicholasaleks/damn-vulnerable-drone/tree/master/simulator/mgmt"
    click QGC "https://github.com/nicholasaleks/damn-vulnerable-drone/tree/master/qgc"

    %% Styles for color coding
    classDef backend fill:#ffcccc,stroke:#990000,stroke-width:2px;
    classDef frontend fill:#cce5ff,stroke:#003366,stroke-width:2px;
```
