# arno0x/dbc2 architecture

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

- Interactive diagram: https://gitdiagram.com/arno0x/dbc2
- Repository: https://github.com/arno0x/dbc2

## Overview

DBC2 is a Dropbox-relayed controller and endpoint-agent system. At a high level, an operator starts the controller, which discovers agents and exchanges encrypted data through Dropbox; agents poll the relay and return status or results. The repository also contains staging, PowerShell modules, and native loading code, but those operational branches are omitted here. Relationships shown are limited to the README’s documented architecture and the sampled controller startup and crypto code; unsampled implementation details are not inferred.

Main entry points: [`lib/agentHandler.py`](https://github.com/arno0x/dbc2/blob/master/lib/agentHandler.py) (Agent task handling), [`lib/pollingThread.py`](https://github.com/arno0x/dbc2/blob/master/lib/pollingThread.py) (Polling and results), [`lib/dropboxHandler.py`](https://github.com/arno0x/dbc2/blob/master/lib/dropboxHandler.py) (Dropbox API client), [`dropboxC2.py`](https://github.com/arno0x/dbc2/blob/master/dropboxC2.py) (Controller startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controller["Controller"]
  node_controller_app["Controller startup<br/>[dropboxC2.py]"]
  node_console["Command console<br/>[console.py]"]
  node_agent_tasks["Agent task handling<br/>[agentHandler.py]"]
  node_polling["Polling and results<br/>[pollingThread.py]"]
  node_status["Agent and task state<br/>[statusHandler.py]"]
  node_crypto["Data encryption<br/>[crypto.py]"]
end

subgraph group_relay["Communication"]
  node_dropbox_client["Dropbox API client<br/>[dropboxHandler.py]"]
  node_dropbox[("Dropbox service")]
end

subgraph group_endpoint["Endpoint"]
  node_agent["Endpoint agent<br/>[dbc2_agent.cs]"]
  node_agent_dropbox["Agent Dropbox handler<br/>[dropboxHandler.cs]"]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_controller_app
node_controller_app -->|"opens console"| node_console
node_console -.->|"issues tasks"| node_agent_tasks
node_agent_tasks -->|"records tasks"| node_status
node_agent_tasks -->|"encrypts task data"| node_crypto
node_agent_tasks -->|"uploads commands"| node_dropbox_client
node_polling -->|"polls and reads"| node_dropbox_client
node_polling -->|"updates agent state"| node_status
node_dropbox_client -->|"transfers data"| node_dropbox
node_agent -.->|"uses relay handler"| node_agent_dropbox
node_agent_dropbox -->|"polls and exchanges"| node_dropbox
node_dropbox -->|"relays agent data"| node_polling

click node_controller_app "https://github.com/arno0x/dbc2/blob/master/dropboxC2.py"
click node_console "https://github.com/arno0x/dbc2/blob/master/lib/console.py"
click node_agent_tasks "https://github.com/arno0x/dbc2/blob/master/lib/agentHandler.py"
click node_polling "https://github.com/arno0x/dbc2/blob/master/lib/pollingThread.py"
click node_status "https://github.com/arno0x/dbc2/blob/master/lib/statusHandler.py"
click node_crypto "https://github.com/arno0x/dbc2/blob/master/lib/crypto.py"
click node_dropbox_client "https://github.com/arno0x/dbc2/blob/master/lib/dropboxHandler.py"
click node_agent "https://github.com/arno0x/dbc2/blob/master/agent/source/dbc2_agent.cs"
click node_agent_dropbox "https://github.com/arno0x/dbc2/blob/master/agent/source/dropboxHandler.cs"

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_controller_app,node_console,node_agent_tasks,node_polling,node_status,node_crypto toneBlue
class node_dropbox_client,node_dropbox toneAmber
class node_agent,node_agent_dropbox toneMint
class node_operator toneIndigo
```

## Components

### Controller

- [Controller startup](https://github.com/arno0x/dbc2/blob/master/dropboxC2.py): `dropboxC2.py`
- [Command console](https://github.com/arno0x/dbc2/blob/master/lib/console.py): `lib/console.py`
- [Agent task handling](https://github.com/arno0x/dbc2/blob/master/lib/agentHandler.py): `lib/agentHandler.py`
- [Polling and results](https://github.com/arno0x/dbc2/blob/master/lib/pollingThread.py): `lib/pollingThread.py`
- [Agent and task state](https://github.com/arno0x/dbc2/blob/master/lib/statusHandler.py): `lib/statusHandler.py`
- [Data encryption](https://github.com/arno0x/dbc2/blob/master/lib/crypto.py): `lib/crypto.py`

### Communication

- [Dropbox API client](https://github.com/arno0x/dbc2/blob/master/lib/dropboxHandler.py): `lib/dropboxHandler.py`
- **Dropbox service**

### Endpoint

- [Endpoint agent](https://github.com/arno0x/dbc2/blob/master/agent/source/dbc2_agent.cs): `agent/source/dbc2_agent.cs`
- [Agent Dropbox handler](https://github.com/arno0x/dbc2/blob/master/agent/source/dropboxHandler.cs): `agent/source/dropboxHandler.cs`

### Other components

- **Operator**

## Connections

- Operator → Controller startup: starts (evidence: `readme.md`)
- Controller startup → Command console: opens console (evidence: `dropboxC2.py`)
- Command console → Agent task handling: issues tasks
- Agent task handling → Agent and task state: records tasks (evidence: `lib/agentHandler.py`)
- Agent task handling → Data encryption: encrypts task data (evidence: `lib/agentHandler.py`)
- Agent task handling → Dropbox API client: uploads commands (evidence: `lib/agentHandler.py`)
- Polling and results → Dropbox API client: polls and reads (evidence: `lib/pollingThread.py`)
- Polling and results → Agent and task state: updates agent state (evidence: `lib/pollingThread.py`)
- Dropbox API client → Dropbox service: transfers data (evidence: `lib/dropboxHandler.py`)
- Endpoint agent → Agent Dropbox handler: uses relay handler
- Agent Dropbox handler → Dropbox service: polls and exchanges (evidence: `readme.md`)
- Dropbox service → Polling and results: relays agent data (evidence: `readme.md`)
