# cobalt-strike/external-c2 architecture

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

- Interactive diagram: https://gitdiagram.com/cobalt-strike/external-c2
- Repository: https://github.com/cobalt-strike/external-c2

## Overview

External-C2 specifies a framed protocol linking a third-party controller/client, Cobalt Strike’s External C2 service, and a Beacon session. The repository’s sole source file implements a quick client that connects to the service, requests and runs a stage, opens its named pipe, then relays frames. The README documents broader controller behavior and session tasks; those components are shown as external. The map reflects the sampled client source and documented protocol, not an inspected server implementation.

Main entry points: [`extc2example.c`](https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c) (Client workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Example client"]
  node_entry["Program entry<br/>[extc2example.c]"]
  node_orchestrator["Client workflow<br/>[extc2example.c]"]
  node_framing["Frame helpers<br/>[extc2example.c]"]
  node_memory["Stage execution<br/>[extc2example.c]"]
end

subgraph group_external["External C2 system"]
  node_service["External C2 service"]
  node_controller["Third-party controller"]
end

subgraph group_beacon["Beacon session"]
  node_pipe["Beacon named pipe"]
  node_beacon["Beacon payload"]
end

node_user(("Client operator"))

node_user -->|"starts client"| node_entry
node_entry -->|"calls go"| node_orchestrator
node_orchestrator -->|"uses frames"| node_framing
node_orchestrator -->|"connects; requests stage"| node_service
node_service -->|"returns stage and tasks"| node_orchestrator
node_orchestrator -->|"runs received stage"| node_memory
node_memory -->|"starts payload"| node_beacon
node_beacon -->|"serves named pipe"| node_pipe
node_orchestrator -->|"opens pipe; relays frames"| node_pipe
node_controller -->|"connects; exchanges frames"| node_service

click node_entry "https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c"
click node_orchestrator "https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c"
click node_framing "https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c"
click node_memory "https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c"

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_entry,node_orchestrator,node_framing,node_memory,node_user toneBlue
class node_service,node_controller toneAmber
class node_pipe,node_beacon toneMint
```

## Components

### Example client

- [Program entry](https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c): `extc2example.c`
- [Client workflow](https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c): `extc2example.c`
- [Frame helpers](https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c): `extc2example.c`
- [Stage execution](https://github.com/cobalt-strike/external-c2/blob/main/extc2example.c): `extc2example.c`

### External C2 system

- **External C2 service**
- **Third-party controller**

### Beacon session

- **Beacon named pipe**
- **Beacon payload**

### Other components

- **Client operator**

## Connections

- Client operator → Program entry: starts client (evidence: `extc2example.c`)
- Program entry → Client workflow: calls go (evidence: `extc2example.c`)
- Client workflow → Frame helpers: uses frames (evidence: `extc2example.c`)
- Client workflow → External C2 service: connects; requests stage (evidence: `extc2example.c`)
- External C2 service → Client workflow: returns stage and tasks (evidence: `README.md`)
- Client workflow → Stage execution: runs received stage (evidence: `extc2example.c`)
- Stage execution → Beacon payload: starts payload (evidence: `extc2example.c`)
- Beacon payload → Beacon named pipe: serves named pipe (evidence: `README.md`)
- Client workflow → Beacon named pipe: opens pipe; relays frames (evidence: `extc2example.c`)
- Third-party controller → External C2 service: connects; exchanges frames (evidence: `README.md`)
