# acecilia/openwrtinvasion architecture

> Architecture diagram of the GitHub repository acecilia/openwrtinvasion, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/acecilia/openwrtinvasion
- Repository: https://github.com/acecilia/openwrtinvasion

## Overview

OpenWRTInvasion is a command-line exploit for obtaining root access on supported Xiaomi routers. The main workflow collects router credentials, obtains or prompts for a stok, builds and uploads a crafted archive, then triggers the router’s speed-test endpoint to execute the payload. The payload can fetch helper files from a local TCP server or a remote repository; the README describes connecting to the resulting root-access services and installing OpenWrt. Source excerpts show the controller and local server, but not the payload script’s internals.

Main entry points: [`remote_command_execution_vulnerability.py`](https://github.com/acecilia/openwrtinvasion/blob/master/remote_command_execution_vulnerability.py) (Exploit controller), [`tcp_file_server.py`](https://github.com/acecilia/openwrtinvasion/blob/master/tcp_file_server.py) (Local file server), [`script.sh`](https://github.com/acecilia/openwrtinvasion/blob/master/script.sh) (Exploit script), [`set_english.py`](https://github.com/acecilia/openwrtinvasion/blob/master/set_english.py) (Language configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_exploit["Exploit workflow"]
  node_controller["Exploit controller"]
  node_router["Xiaomi router"]
  node_archive["Payload archive"]
  node_payload["Exploit script<br/>[script.sh]"]
  node_localserver["Local file server<br/>[tcp_file_server.py]"]
  node_supportfiles["Helper files"]
  node_remotefiles["Remote file source"]
end

subgraph group_access["Router access"]
  node_rootservices["Root access services"]
end

subgraph group_firmware["Firmware installation"]
  node_firmware["OpenWrt firmware images"]
end

subgraph group_utility["Router utilities"]
  node_routerutility["Language configuration<br/>[set_english.py]"]
end

node_operator(("Operator"))

node_operator -->|"runs"| node_controller
node_controller -->|"authenticates"| node_router
node_controller -->|"creates"| node_archive
node_controller -->|"uploads archive"| node_router
node_controller -->|"triggers execution"| node_router
node_controller -->|"starts optionally"| node_localserver
node_localserver -->|"serves files from"| node_supportfiles
node_payload -.->|"fetches files"| node_localserver
node_payload -.->|"fetches files"| node_remotefiles
node_router -->|"provides access"| node_rootservices
node_operator -->|"connects"| node_rootservices
node_operator -->|"downloads and flashes"| node_firmware
node_operator -->|"runs separately"| node_routerutility
node_routerutility -->|"uploads configuration"| node_router

click node_controller "https://github.com/acecilia/openwrtinvasion/blob/master/remote_command_execution_vulnerability.py"
click node_archive "https://github.com/acecilia/openwrtinvasion/blob/master/remote_command_execution_vulnerability.py"
click node_payload "https://github.com/acecilia/openwrtinvasion/blob/master/script.sh"
click node_localserver "https://github.com/acecilia/openwrtinvasion/blob/master/tcp_file_server.py"
click node_supportfiles "https://github.com/acecilia/openwrtinvasion/tree/master/script_tools"
click node_firmware "https://github.com/acecilia/openwrtinvasion/tree/master/firmwares/OpenWrt/06-06-2020"
click node_routerutility "https://github.com/acecilia/openwrtinvasion/blob/master/set_english.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_controller,node_router,node_archive,node_payload,node_localserver,node_supportfiles,node_remotefiles toneBlue
class node_rootservices toneAmber
class node_firmware toneMint
class node_routerutility toneRose
class node_operator toneIndigo
```

## Components

### Exploit workflow

- [Exploit controller](https://github.com/acecilia/openwrtinvasion/blob/master/remote_command_execution_vulnerability.py): `remote_command_execution_vulnerability.py`
- **Xiaomi router**
- [Payload archive](https://github.com/acecilia/openwrtinvasion/blob/master/remote_command_execution_vulnerability.py): `remote_command_execution_vulnerability.py`
- [Exploit script](https://github.com/acecilia/openwrtinvasion/blob/master/script.sh): `script.sh`
- [Local file server](https://github.com/acecilia/openwrtinvasion/blob/master/tcp_file_server.py): `tcp_file_server.py`
- [Helper files](https://github.com/acecilia/openwrtinvasion/tree/master/script_tools): `script_tools`
- **Remote file source**

### Router access

- **Root access services**

### Firmware installation

- [OpenWrt firmware images](https://github.com/acecilia/openwrtinvasion/tree/master/firmwares/OpenWrt/06-06-2020): `firmwares/OpenWrt/06-06-2020`

### Router utilities

- [Language configuration](https://github.com/acecilia/openwrtinvasion/blob/master/set_english.py): `set_english.py`

### Other components

- **Operator**

## Connections

- Operator → Exploit controller: runs (evidence: `README.md`)
- Exploit controller → Xiaomi router: authenticates (evidence: `remote_command_execution_vulnerability.py`)
- Exploit controller → Payload archive: creates (evidence: `remote_command_execution_vulnerability.py`)
- Exploit controller → Xiaomi router: uploads archive (evidence: `remote_command_execution_vulnerability.py`)
- Exploit controller → Xiaomi router: triggers execution (evidence: `remote_command_execution_vulnerability.py`)
- Exploit controller → Local file server: starts optionally (evidence: `remote_command_execution_vulnerability.py`)
- Local file server → Helper files: serves files from
- Exploit script → Local file server: fetches files
- Exploit script → Remote file source: fetches files
- Xiaomi router → Root access services: provides access (evidence: `README.md`)
- Operator → Root access services: connects (evidence: `README.md`)
- Operator → OpenWrt firmware images: downloads and flashes (evidence: `README.md`)
- Operator → Language configuration: runs separately (evidence: `set_english.py`)
- Language configuration → Xiaomi router: uploads configuration (evidence: `set_english.py`)
