# itsnold/nagomio-c2 architecture

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

- Interactive diagram: https://gitdiagram.com/itsnold/nagomio-c2
- Repository: https://github.com/itsnold/nagomio-c2

## Overview

Nagomio-C2 is a separated operator UI, Rust teamserver, shared API-types crate, and C++ agent. The principal workflow is operator tasking through the UI and server, agent beacon/task execution, and response or media return. The README also documents payload building, authentication/encrypted transport, persistence, SOCKS pivoting, and broad post-exploitation capabilities. Some subsystems are represented from README descriptions because their implementation was not sampled; unverified connections are omitted or dashed.

Main entry points: [`teamserver/src/main.rs`](https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/main.rs) (HTTP API and tasking), [`agent/src/main.cpp`](https://github.com/itsnold/nagomio-c2/blob/main/agent/src/main.cpp) (Beacon and task loop), [`tauri-client/src/pages/Agents.tsx`](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/pages/Agents.tsx) (Session operations), [`tauri-client/src/App.tsx`](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/App.tsx) (Desktop shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operator["Operator UI"]
  node_app["Desktop shell<br/>[App.tsx]"]
  node_state["API state<br/>[AppContext.tsx]"]
  node_operations["Session operations<br/>[Agents.tsx]"]
  node_commands["Command templates<br/>[commandCatalog.ts]"]
  node_console["Console aliases<br/>[consoleCommands.ts]"]
  node_files["Remote file browser<br/>[FileBrowser.tsx]"]
  node_live["Live media view"]
  node_builder["Payload builder<br/>[Builder.tsx]"]
end

subgraph group_server["Teamserver"]
  node_api["HTTP API and tasking<br/>[main.rs]"]
  node_auth["Request authentication<br/>[auth.rs]"]
  node_persistence[("SQLite persistence<br/>[persistence.rs]")]
  node_requeue["Stale task recovery<br/>[requeue.rs]"]
  node_socks["SOCKS relay<br/>[socks.rs]"]
  node_audit["Audit logging<br/>[audit.rs]"]
  node_payload["Payload build service"]
end

subgraph group_agent["Agent runtime"]
  node_runtime["Beacon and task loop<br/>[main.cpp]"]
  node_modules["Command modules"]
  node_stream["Capture and streaming<br/>[stream_common.h]"]
  node_streamstate["Stream session state<br/>[stream_state.h]"]
  node_evasion["Optional evasion<br/>[evade_win.cpp]"]
end

subgraph group_transport["Wire and profiles"]
  node_profiles["Callback profiles<br/>[profiles.cpp]"]
  node_wire["Wire encryption<br/>[wire.cpp]"]
end

subgraph group_shared["Shared contracts"]
  node_protocol["Task protocol types<br/>[protocol.h]"]
  node_types["API data types<br/>[lib.rs]"]
end

node_operator(("Operator"))

node_operator -->|"opens"| node_app
node_app -->|"routes to"| node_operations
node_app -->|"routes to"| node_builder
node_app -->|"routes to"| node_live
node_operations -->|"uses API state"| node_state
node_operations -->|"parses input"| node_console
node_console -->|"builds tasks"| node_commands
node_operations -->|"uses templates"| node_commands
node_operations -->|"opens browser"| node_files
node_state -.->|"HTTP requests"| node_api
node_builder -.->|"requests builds"| node_api
node_api -->|"verifies requests"| node_auth
node_api -->|"persists state"| node_persistence
node_api -->|"recovers tasks"| node_requeue
node_api -->|"starts relay"| node_socks
node_api -->|"records audit"| node_audit
node_api -.->|"builds payloads"| node_payload
node_runtime -.->|"beacons and reports"| node_api
node_runtime -->|"configures callbacks"| node_profiles
node_runtime -->|"seals transport"| node_wire
node_runtime -.->|"dispatches tasks"| node_modules
node_modules -->|"uses capture helpers"| node_stream
node_stream -->|"uses session state"| node_streamstate
node_runtime -->|"runs optional checks"| node_evasion
node_modules -.->|"relays pivot traffic"| node_socks
node_runtime -->|"uses task types"| node_protocol
node_api -.->|"uses API contracts"| node_types

click node_app "https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/App.tsx"
click node_state "https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/components/AppContext.tsx"
click node_operations "https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/pages/Agents.tsx"
click node_commands "https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/lib/commandCatalog.ts"
click node_console "https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/lib/consoleCommands.ts"
click node_files "https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/components/FileBrowser.tsx"
click node_live "https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/pages/LiveStreamWindow.tsx"
click node_builder "https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/pages/Builder.tsx"
click node_api "https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/main.rs"
click node_auth "https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/auth.rs"
click node_persistence "https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/persistence.rs"
click node_requeue "https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/requeue.rs"
click node_socks "https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/socks.rs"
click node_audit "https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/audit.rs"
click node_payload "https://github.com/itsnold/nagomio-c2/tree/main/teamserver/src"
click node_runtime "https://github.com/itsnold/nagomio-c2/blob/main/agent/src/main.cpp"
click node_modules "https://github.com/itsnold/nagomio-c2/tree/main/agent/src/modules"
click node_stream "https://github.com/itsnold/nagomio-c2/blob/main/agent/src/modules/stream_common.h"
click node_streamstate "https://github.com/itsnold/nagomio-c2/blob/main/agent/src/modules/stream_state.h"
click node_evasion "https://github.com/itsnold/nagomio-c2/blob/main/agent/src/evade_win.cpp"
click node_profiles "https://github.com/itsnold/nagomio-c2/blob/main/agent/src/profiles.cpp"
click node_wire "https://github.com/itsnold/nagomio-c2/blob/main/agent/src/wire.cpp"
click node_protocol "https://github.com/itsnold/nagomio-c2/blob/main/agent/src/protocol.h"
click node_types "https://github.com/itsnold/nagomio-c2/blob/main/shared/src/lib.rs"

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_app,node_state,node_operations,node_commands,node_console,node_files,node_live,node_builder toneBlue
class node_api,node_auth,node_persistence,node_requeue,node_socks,node_audit,node_payload toneAmber
class node_runtime,node_modules,node_stream,node_streamstate,node_evasion toneMint
class node_profiles,node_wire toneRose
class node_protocol,node_types,node_operator toneIndigo
```

## Components

### Operator UI

- [Desktop shell](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/App.tsx): `tauri-client/src/App.tsx`
- [API state](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/components/AppContext.tsx): `tauri-client/src/components/AppContext.tsx`
- [Session operations](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/pages/Agents.tsx): `tauri-client/src/pages/Agents.tsx`
- [Command templates](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/lib/commandCatalog.ts): `tauri-client/src/lib/commandCatalog.ts`
- [Console aliases](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/lib/consoleCommands.ts): `tauri-client/src/lib/consoleCommands.ts`
- [Remote file browser](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/components/FileBrowser.tsx): `tauri-client/src/components/FileBrowser.tsx`
- [Live media view](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/pages/LiveStreamWindow.tsx): `tauri-client/src/pages/LiveStreamWindow.tsx`
- [Payload builder](https://github.com/itsnold/nagomio-c2/blob/main/tauri-client/src/pages/Builder.tsx): `tauri-client/src/pages/Builder.tsx`

### Teamserver

- [HTTP API and tasking](https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/main.rs): `teamserver/src/main.rs`
- [Request authentication](https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/auth.rs): `teamserver/src/auth.rs`
- [SQLite persistence](https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/persistence.rs): `teamserver/src/persistence.rs`
- [Stale task recovery](https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/requeue.rs): `teamserver/src/requeue.rs`
- [SOCKS relay](https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/socks.rs): `teamserver/src/socks.rs`
- [Audit logging](https://github.com/itsnold/nagomio-c2/blob/main/teamserver/src/audit.rs): `teamserver/src/audit.rs`
- [Payload build service](https://github.com/itsnold/nagomio-c2/tree/main/teamserver/src): `teamserver/src`

### Agent runtime

- [Beacon and task loop](https://github.com/itsnold/nagomio-c2/blob/main/agent/src/main.cpp): `agent/src/main.cpp`
- [Command modules](https://github.com/itsnold/nagomio-c2/tree/main/agent/src/modules): `agent/src/modules`
- [Capture and streaming](https://github.com/itsnold/nagomio-c2/blob/main/agent/src/modules/stream_common.h): `agent/src/modules/stream_common.h`
- [Stream session state](https://github.com/itsnold/nagomio-c2/blob/main/agent/src/modules/stream_state.h): `agent/src/modules/stream_state.h`
- [Optional evasion](https://github.com/itsnold/nagomio-c2/blob/main/agent/src/evade_win.cpp): `agent/src/evade_win.cpp`

### Wire and profiles

- [Callback profiles](https://github.com/itsnold/nagomio-c2/blob/main/agent/src/profiles.cpp): `agent/src/profiles.cpp`
- [Wire encryption](https://github.com/itsnold/nagomio-c2/blob/main/agent/src/wire.cpp): `agent/src/wire.cpp`

### Shared contracts

- [Task protocol types](https://github.com/itsnold/nagomio-c2/blob/main/agent/src/protocol.h): `agent/src/protocol.h`
- [API data types](https://github.com/itsnold/nagomio-c2/blob/main/shared/src/lib.rs): `shared/src/lib.rs`

### Other components

- **Operator**

## Connections

- Operator → Desktop shell: opens
- Desktop shell → Session operations: routes to (evidence: `tauri-client/src/App.tsx`)
- Desktop shell → Payload builder: routes to (evidence: `tauri-client/src/App.tsx`)
- Desktop shell → Live media view: routes to (evidence: `tauri-client/src/App.tsx`)
- Session operations → API state: uses API state (evidence: `tauri-client/src/pages/Agents.tsx`)
- Session operations → Console aliases: parses input (evidence: `tauri-client/src/pages/Agents.tsx`)
- Console aliases → Command templates: builds tasks (evidence: `tauri-client/src/lib/consoleCommands.ts`)
- Session operations → Command templates: uses templates (evidence: `tauri-client/src/pages/Agents.tsx`)
- Session operations → Remote file browser: opens browser (evidence: `tauri-client/src/pages/Agents.tsx`)
- API state → HTTP API and tasking: HTTP requests
- Payload builder → HTTP API and tasking: requests builds
- HTTP API and tasking → Request authentication: verifies requests (evidence: `teamserver/src/main.rs`)
- HTTP API and tasking → SQLite persistence: persists state (evidence: `teamserver/src/main.rs`)
- HTTP API and tasking → Stale task recovery: recovers tasks (evidence: `teamserver/src/main.rs`)
- HTTP API and tasking → SOCKS relay: starts relay (evidence: `teamserver/src/main.rs`)
- HTTP API and tasking → Audit logging: records audit (evidence: `teamserver/src/main.rs`)
- HTTP API and tasking → Payload build service: builds payloads (evidence: `teamserver/src/main.rs`)
- Beacon and task loop → HTTP API and tasking: beacons and reports
- Beacon and task loop → Callback profiles: configures callbacks (evidence: `agent/src/main.cpp`)
- Beacon and task loop → Wire encryption: seals transport (evidence: `agent/src/main.cpp`)
- Beacon and task loop → Command modules: dispatches tasks (evidence: `agent/src/main.cpp`)
- Command modules → Capture and streaming: uses capture helpers (evidence: `agent/src/modules/stream_common.h`)
- Capture and streaming → Stream session state: uses session state (evidence: `agent/src/modules/stream_common.h`)
- Beacon and task loop → Optional evasion: runs optional checks (evidence: `agent/src/main.cpp`)
- Command modules → SOCKS relay: relays pivot traffic
- Beacon and task loop → Task protocol types: uses task types (evidence: `agent/src/main.cpp`)
- HTTP API and tasking → API data types: uses API contracts
