# uzankhan/ghost-troke-madiff architecture

> Architecture diagram of the GitHub repository uzankhan/ghost-troke-madiff, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uzankhan/ghost-troke-madiff
- Repository: https://github.com/uzankhan/ghost-troke-madiff

## Overview

Ghost Stroke is an ESP32-S3 firmware prototype that exposes a Wi-Fi web control panel and uses USB keyboard emulation to trigger host-side actions. Its main workflow is browser interaction through the device’s HTTP interface, followed by firmware dispatch to HID-driven host actions; configuration and status/log feedback are additional dashboard capabilities. The README documents reverse-shell, keylogging, and persistence features. These responsibilities share Malware.cc; the available excerpts show only parts of its routes and implementations, so undocumented route-to-feature links are omitted.

Main entry points: [`Malware.cc`](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Device firmware"]
  node_esp32["ESP32 firmware<br/>[Malware.cc]"]
  node_wifi["Wi-Fi access point<br/>[Malware.cc]"]
  node_hid["USB keyboard HID<br/>[Malware.cc]"]
end

subgraph group_interface["Control interface"]
  node_http["HTTP server<br/>[Malware.cc]"]
  node_dashboard["Web dashboard<br/>[Malware.cc]"]
  node_config["Configuration<br/>[Malware.cc]"]
  node_status["Status and logs<br/>[Malware.cc]"]
end

subgraph group_host["Host actions"]
  node_commands["App and command actions<br/>[Malware.cc]"]
  node_powershell["PowerShell actions<br/>[Malware.cc]"]
end

subgraph group_research["Research features"]
  node_reverse["Reverse-shell behavior<br/>[Malware.cc]"]
  node_keylogger["Keylogging behavior<br/>[Malware.cc]"]
  node_persistence["Task persistence<br/>[Malware.cc]"]
  node_selfdestruct["Self-destruct action<br/>[Malware.cc]"]
end

node_operator(("Operator"))
node_browser["Browser"]
node_host(("Connected host"))
node_remote(("Configured remote endpoint"))

node_operator -->|"uses"| node_browser
node_browser -->|"opens"| node_dashboard
node_dashboard -->|"sends requests"| node_http
node_wifi -->|"hosts access"| node_http
node_esp32 -->|"starts"| node_wifi
node_esp32 -->|"registers routes"| node_http
node_http -->|"updates"| node_config
node_http -->|"dispatches"| node_keylogger
node_http -->|"serves panel"| node_esp32
node_esp32 -->|"initializes"| node_hid
node_commands -->|"types actions"| node_hid
node_powershell -->|"types commands"| node_hid
node_reverse -->|"types payload"| node_hid
node_keylogger -->|"types payload"| node_hid
node_persistence -->|"deploys with persistence"| node_keylogger
node_selfdestruct -->|"types action"| node_hid
node_hid -->|"emulates keystrokes"| node_host
node_reverse -.->|"connects to target"| node_remote
node_http -.->|"reports feedback"| node_status

click node_esp32 "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_wifi "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_http "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_dashboard "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_config "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_status "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_hid "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_commands "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_powershell "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_reverse "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_keylogger "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_persistence "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"
click node_selfdestruct "https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc"

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_esp32,node_wifi,node_hid,node_browser toneBlue
class node_http,node_dashboard,node_config,node_status toneAmber
class node_commands,node_powershell toneMint
class node_reverse,node_keylogger,node_persistence,node_selfdestruct toneRose
class node_operator,node_host,node_remote toneIndigo
```

## Components

### Device firmware

- [ESP32 firmware](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [Wi-Fi access point](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [USB keyboard HID](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`

### Control interface

- [HTTP server](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [Web dashboard](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [Configuration](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [Status and logs](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`

### Host actions

- [App and command actions](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [PowerShell actions](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`

### Research features

- [Reverse-shell behavior](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [Keylogging behavior](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [Task persistence](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`
- [Self-destruct action](https://github.com/uzankhan/ghost-troke-madiff/blob/main/Malware.cc): `Malware.cc`

### Other components

- **Operator**
- **Browser**
- **Connected host**
- **Configured remote endpoint**

## Connections

- Operator → Browser: uses (evidence: `README.md`)
- Browser → Web dashboard: opens (evidence: `README.md`)
- Web dashboard → HTTP server: sends requests (evidence: `Malware.cc`)
- Wi-Fi access point → HTTP server: hosts access (evidence: `Malware.cc`)
- ESP32 firmware → Wi-Fi access point: starts (evidence: `Malware.cc`)
- ESP32 firmware → HTTP server: registers routes (evidence: `Malware.cc`)
- HTTP server → Configuration: updates (evidence: `Malware.cc`)
- HTTP server → Keylogging behavior: dispatches (evidence: `Malware.cc`)
- HTTP server → ESP32 firmware: serves panel (evidence: `Malware.cc`)
- ESP32 firmware → USB keyboard HID: initializes (evidence: `Malware.cc`)
- App and command actions → USB keyboard HID: types actions (evidence: `Malware.cc`)
- PowerShell actions → USB keyboard HID: types commands (evidence: `Malware.cc`)
- Reverse-shell behavior → USB keyboard HID: types payload (evidence: `Malware.cc`)
- Keylogging behavior → USB keyboard HID: types payload (evidence: `Malware.cc`)
- Task persistence → Keylogging behavior: deploys with persistence (evidence: `Malware.cc`)
- Self-destruct action → USB keyboard HID: types action (evidence: `Malware.cc`)
- USB keyboard HID → Connected host: emulates keystrokes (evidence: `README.md`)
- Reverse-shell behavior → Configured remote endpoint: connects to target
- HTTP server → Status and logs: reports feedback (evidence: `README.md`)
