# 0xehab/freepbx-cve-2025-57819-rce architecture

> Architecture diagram of the GitHub repository 0xehab/freepbx-cve-2025-57819-rce, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/0xehab/freepbx-cve-2025-57819-rce
- Repository: https://github.com/0xehab/freepbx-cve-2025-57819-rce

## Overview

This is a single-file Python proof of concept, not the FreePBX product itself. Its workflow creates an administrator through unauthenticated SQL injection, authenticates, uploads and verifies a webshell, then runs a command or attempts a reverse shell. The graph follows the orchestrator and HTTP requests shown in exploit.py; it does not infer internal FreePBX implementation details.

Main entry points: [`exploit.py`](https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py) (Exploit client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Exploit workflow"]
  node_cli["CLI workflow<br/>[exploit.py]"]
  node_exploit["Exploit client<br/>[exploit.py]"]
end

subgraph group_target["Target interactions"]
  node_admin_insert["Admin creation<br/>[exploit.py]"]
  node_freepbx["FreePBX target"]
  node_login["Admin login<br/>[exploit.py]"]
  node_upload["Webshell upload<br/>[exploit.py]"]
end

subgraph group_execution["Command execution"]
  node_webshell["Webshell endpoint"]
  node_command["Single command<br/>[exploit.py]"]
  node_reverse["Reverse shell<br/>[exploit.py]"]
  node_listener(("Listener"))
end

node_operator(("Operator"))

node_operator -->|"supplies options"| node_cli
node_cli -->|"runs workflow"| node_exploit
node_exploit -->|"creates admin"| node_admin_insert
node_admin_insert -->|"injects SQL"| node_freepbx
node_exploit -->|"authenticates"| node_login
node_login -->|"posts credentials"| node_freepbx
node_exploit -->|"uploads shell"| node_upload
node_upload -->|"posts traversal upload"| node_freepbx
node_exploit -->|"verifies shell"| node_webshell
node_exploit -->|"selects mode"| node_command
node_command -->|"sends command"| node_webshell
node_exploit -->|"fires payloads"| node_reverse
node_reverse -->|"runs shell payload"| node_webshell
node_operator -->|"provides callback"| node_listener
node_listener -->|"receives connection"| node_reverse

click node_cli "https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py"
click node_exploit "https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py"
click node_admin_insert "https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py"
click node_login "https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py"
click node_upload "https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py"
click node_command "https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py"
click node_reverse "https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.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_cli,node_exploit toneBlue
class node_admin_insert,node_freepbx,node_login,node_upload toneAmber
class node_webshell,node_command,node_reverse,node_listener toneMint
class node_operator toneIndigo
```

## Components

### Exploit workflow

- [CLI workflow](https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py): `exploit.py`
- [Exploit client](https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py): `exploit.py`

### Target interactions

- [Admin creation](https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py): `exploit.py`
- **FreePBX target**
- [Admin login](https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py): `exploit.py`
- [Webshell upload](https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py): `exploit.py`

### Command execution

- **Webshell endpoint**
- [Single command](https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py): `exploit.py`
- [Reverse shell](https://github.com/0xehab/freepbx-cve-2025-57819-rce/blob/main/exploit.py): `exploit.py`
- **Listener**

### Other components

- **Operator**

## Connections

- Operator → CLI workflow: supplies options (evidence: `README.md`)
- CLI workflow → Exploit client: runs workflow (evidence: `exploit.py`)
- Exploit client → Admin creation: creates admin (evidence: `exploit.py`)
- Admin creation → FreePBX target: injects SQL (evidence: `exploit.py`)
- Exploit client → Admin login: authenticates (evidence: `exploit.py`)
- Admin login → FreePBX target: posts credentials (evidence: `exploit.py`)
- Exploit client → Webshell upload: uploads shell (evidence: `exploit.py`)
- Webshell upload → FreePBX target: posts traversal upload (evidence: `exploit.py`)
- Exploit client → Webshell endpoint: verifies shell (evidence: `exploit.py`)
- Exploit client → Single command: selects mode (evidence: `exploit.py`)
- Single command → Webshell endpoint: sends command (evidence: `exploit.py`)
- Exploit client → Reverse shell: fires payloads (evidence: `exploit.py`)
- Reverse shell → Webshell endpoint: runs shell payload (evidence: `exploit.py`)
- Operator → Listener: provides callback (evidence: `README.md`)
- Listener → Reverse shell: receives connection (evidence: `exploit.py`)
