# omerkkemal/phontomgate architecture

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

- Interactive diagram: https://gitdiagram.com/omerkkemal/phontomgate
- Repository: https://github.com/omerkkemal/phontomgate

## Overview

PhantomGate is a cross-platform agent that the README describes as polling a SpecterPanel C2 for instructions, dispatching work, and returning results. The sampled code shows both a Kivy app that starts the agent in a background thread and a loop that handles remote instructions. Major capabilities such as command execution, code injection, botnet simulation, and system information are documented, but much of their implementation is omitted from the excerpts; those branches are therefore shown at a high level. The README calls the GUI Flet, while the sampled main.py uses Kivy.

Main entry points: [`PhantomGate.py`](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py) (Instruction loop), [`main.py`](https://github.com/omerkkemal/phontomgate/blob/main/main.py) (Kivy app), [`setting.py`](https://github.com/omerkkemal/phontomgate/blob/main/setting.py) (Agent settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and UI"]
  node_gui["Kivy app<br/>[main.py]"]
  node_headless["Headless entry<br/>[PhantomGate.py]"]
end

subgraph group_agent["Agent Runtime"]
  node_loop["Instruction loop<br/>[PhantomGate.py]"]
  node_transport["Encrypted API<br/>[PhantomGate.py]"]
  node_registration["Target registration<br/>[PhantomGate.py]"]
  node_dispatch["Command dispatch<br/>[PhantomGate.py]"]
end

subgraph group_capabilities["Agent Capabilities"]
  node_shell["Remote shell<br/>[PhantomGate.py]"]
  node_injection["Code injection<br/>[PhantomGate.py]"]
  node_botnet["Botnet simulation<br/>[PhantomGate.py]"]
  node_sysinfo["System information<br/>[PhantomGate.py]"]
end

subgraph group_state["Configuration and State"]
  node_settings["Agent settings<br/>[setting.py]"]
  node_targetdb[("Target database<br/>[PhantomGate.py]")]
  node_peopleui[("People UI database<br/>[main.py]")]
end

node_user(("Operator"))
node_c2["SpecterPanel C2"]

node_user -->|"starts"| node_gui
node_user -->|"starts"| node_headless
node_gui -->|"starts thread"| node_loop
node_gui -->|"initializes records"| node_targetdb
node_gui -->|"reads and writes"| node_peopleui
node_headless -->|"runs"| node_loop
node_loop -->|"reads target state"| node_targetdb
node_loop -->|"registers target"| node_registration
node_loop -->|"polls instructions"| node_transport
node_transport -->|"exchanges encrypted data"| node_c2
node_loop -->|"dispatches instructions"| node_dispatch
node_dispatch -->|"runs commands"| node_shell
node_dispatch -->|"handles payloads"| node_injection
node_dispatch -->|"handles tasks"| node_botnet
node_dispatch -->|"collects information"| node_sysinfo
node_transport -->|"uses configuration"| node_settings

click node_gui "https://github.com/omerkkemal/phontomgate/blob/main/main.py"
click node_headless "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_loop "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_transport "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_registration "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_dispatch "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_shell "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_injection "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_botnet "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_sysinfo "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_settings "https://github.com/omerkkemal/phontomgate/blob/main/setting.py"
click node_targetdb "https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py"
click node_peopleui "https://github.com/omerkkemal/phontomgate/blob/main/main.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_gui,node_headless toneBlue
class node_loop,node_transport,node_registration,node_dispatch toneAmber
class node_shell,node_injection,node_botnet,node_sysinfo toneMint
class node_settings,node_targetdb,node_peopleui toneRose
class node_user,node_c2 toneIndigo
```

## Components

### Entry and UI

- [Kivy app](https://github.com/omerkkemal/phontomgate/blob/main/main.py): `main.py`
- [Headless entry](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`

### Agent Runtime

- [Instruction loop](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`
- [Encrypted API](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`
- [Target registration](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`
- [Command dispatch](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`

### Agent Capabilities

- [Remote shell](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`
- [Code injection](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`
- [Botnet simulation](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`
- [System information](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`

### Configuration and State

- [Agent settings](https://github.com/omerkkemal/phontomgate/blob/main/setting.py): `setting.py`
- [Target database](https://github.com/omerkkemal/phontomgate/blob/main/PhantomGate.py): `PhantomGate.py`
- [People UI database](https://github.com/omerkkemal/phontomgate/blob/main/main.py): `main.py`

### Other components

- **Operator**
- **SpecterPanel C2**

## Connections

- Operator → Kivy app: starts (evidence: `README.md`)
- Operator → Headless entry: starts (evidence: `README.md`)
- Kivy app → Instruction loop: starts thread (evidence: `main.py`)
- Kivy app → Target database: initializes records (evidence: `main.py`)
- Kivy app → People UI database: reads and writes (evidence: `main.py`)
- Headless entry → Instruction loop: runs (evidence: `PhantomGate.py`)
- Instruction loop → Target database: reads target state (evidence: `PhantomGate.py`)
- Instruction loop → Target registration: registers target (evidence: `README.md`)
- Instruction loop → Encrypted API: polls instructions (evidence: `README.md`)
- Encrypted API → SpecterPanel C2: exchanges encrypted data (evidence: `README.md`)
- Instruction loop → Command dispatch: dispatches instructions (evidence: `README.md`)
- Command dispatch → Remote shell: runs commands (evidence: `README.md`)
- Command dispatch → Code injection: handles payloads (evidence: `README.md`)
- Command dispatch → Botnet simulation: handles tasks (evidence: `README.md`)
- Command dispatch → System information: collects information (evidence: `README.md`)
- Encrypted API → Agent settings: uses configuration (evidence: `PhantomGate.py`)
