# sweetsoftware/ares architecture

> Architecture diagram of the GitHub repository sweetsoftware/ares, 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/sweetsoftware/ares
- Repository: https://github.com/sweetsoftware/ares

## Overview

Ares pairs an operator-facing command-and-control web server with an endpoint agent. The central workflow is an agent checking in for queued instructions, executing them, and reporting output or uploaded files; operators manage agents and queue commands through the web UI/API. The README also documents agent-side file, shell, Python, screenshot, persistence, cleanup, and termination commands, plus an agent builder. The graph uses README relationships where source excerpts are incomplete; the main agent loop and some documented capabilities were not fully sampled.

Main entry points: [`agent/agent.py`](https://github.com/sweetsoftware/ares/blob/master/agent/agent.py) (Agent Runtime), [`server/api/__init__.py`](https://github.com/sweetsoftware/ares/blob/master/server/api/__init__.py) (Agent API), [`server/webui/__init__.py`](https://github.com/sweetsoftware/ares/blob/master/server/webui/__init__.py) (Admin Web UI), [`server/models.py`](https://github.com/sweetsoftware/ares/blob/master/server/models.py) (Domain Models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_server["C2 Server"]
  node_server_app["Flask App<br/>[ares.py]"]
  node_web["Admin Web UI<br/>[__init__.py]"]
  node_api["Agent API<br/>[__init__.py]"]
  node_models["Domain Models<br/>[models.py]"]
  node_database[("SQLite Database<br/>[config.py]")]
  node_uploads["Uploaded Files<br/>[__init__.py]"]
end

subgraph group_agent["Endpoint Agent"]
  node_agent_runtime["Agent Runtime<br/>[agent.py]"]
  node_agent_config["Agent Settings<br/>[config.py]"]
  node_shell["Shell Commands<br/>[agent.py]"]
  node_file_ops["File Transfer<br/>[agent.py]"]
  node_python_exec["Python Execution<br/>[agent.py]"]
  node_archive_capture["Archive and Screenshot<br/>[agent.py]"]
  node_persistence["Persistence and Cleanup<br/>[agent.py]"]
end

subgraph group_build["Agent Build"]
  node_builder["Agent Builder<br/>[builder.py]"]
  node_template["Build Settings<br/>[template_config.py]"]
end

node_operator(("Operator"))
node_host(("Compromised Host"))

node_operator -->|"administers"| node_web
node_web -->|"queries and updates"| node_models
node_api -->|"queues and records"| node_models
node_server_app -->|"registers"| node_web
node_server_app -->|"registers"| node_api
node_server_app -->|"initializes"| node_models
node_models -->|"persists records"| node_database
node_web -.->|"requests commands"| node_api
node_agent_runtime -->|"reads settings"| node_agent_config
node_host -->|"runs"| node_agent_runtime
node_agent_runtime -->|"checks in"| node_api
node_agent_runtime -->|"reports output"| node_api
node_api -->|"returns commands"| node_agent_runtime
node_agent_runtime -->|"dispatches to"| node_shell
node_agent_runtime -->|"dispatches to"| node_file_ops
node_agent_runtime -->|"dispatches to"| node_python_exec
node_agent_runtime -->|"dispatches to"| node_archive_capture
node_agent_runtime -->|"dispatches to"| node_persistence
node_file_ops -->|"uploads files"| node_api
node_api -->|"stores uploads"| node_uploads
node_operator -->|"configures build"| node_builder
node_builder -->|"fills settings"| node_template
node_builder -->|"packages agent"| node_agent_runtime

click node_server_app "https://github.com/sweetsoftware/ares/blob/master/server/ares.py"
click node_web "https://github.com/sweetsoftware/ares/blob/master/server/webui/__init__.py"
click node_api "https://github.com/sweetsoftware/ares/blob/master/server/api/__init__.py"
click node_models "https://github.com/sweetsoftware/ares/blob/master/server/models.py"
click node_database "https://github.com/sweetsoftware/ares/blob/master/server/config.py"
click node_uploads "https://github.com/sweetsoftware/ares/blob/master/server/api/__init__.py"
click node_agent_runtime "https://github.com/sweetsoftware/ares/blob/master/agent/agent.py"
click node_agent_config "https://github.com/sweetsoftware/ares/blob/master/agent/config.py"
click node_shell "https://github.com/sweetsoftware/ares/blob/master/agent/agent.py"
click node_file_ops "https://github.com/sweetsoftware/ares/blob/master/agent/agent.py"
click node_python_exec "https://github.com/sweetsoftware/ares/blob/master/agent/agent.py"
click node_archive_capture "https://github.com/sweetsoftware/ares/blob/master/agent/agent.py"
click node_persistence "https://github.com/sweetsoftware/ares/blob/master/agent/agent.py"
click node_builder "https://github.com/sweetsoftware/ares/blob/master/agent/builder.py"
click node_template "https://github.com/sweetsoftware/ares/blob/master/agent/template_config.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_server_app,node_web,node_api,node_models,node_database,node_uploads toneBlue
class node_agent_runtime,node_agent_config,node_shell,node_file_ops,node_python_exec,node_archive_capture,node_persistence toneAmber
class node_builder,node_template toneMint
class node_operator,node_host toneIndigo
```

## Components

### C2 Server

- [Flask App](https://github.com/sweetsoftware/ares/blob/master/server/ares.py): `server/ares.py`
- [Admin Web UI](https://github.com/sweetsoftware/ares/blob/master/server/webui/__init__.py): `server/webui/__init__.py`
- [Agent API](https://github.com/sweetsoftware/ares/blob/master/server/api/__init__.py): `server/api/__init__.py`
- [Domain Models](https://github.com/sweetsoftware/ares/blob/master/server/models.py): `server/models.py`
- [SQLite Database](https://github.com/sweetsoftware/ares/blob/master/server/config.py): `server/config.py`
- [Uploaded Files](https://github.com/sweetsoftware/ares/blob/master/server/api/__init__.py): `server/api/__init__.py`

### Endpoint Agent

- [Agent Runtime](https://github.com/sweetsoftware/ares/blob/master/agent/agent.py): `agent/agent.py`
- [Agent Settings](https://github.com/sweetsoftware/ares/blob/master/agent/config.py): `agent/config.py`
- [Shell Commands](https://github.com/sweetsoftware/ares/blob/master/agent/agent.py): `agent/agent.py`
- [File Transfer](https://github.com/sweetsoftware/ares/blob/master/agent/agent.py): `agent/agent.py`
- [Python Execution](https://github.com/sweetsoftware/ares/blob/master/agent/agent.py): `agent/agent.py`
- [Archive and Screenshot](https://github.com/sweetsoftware/ares/blob/master/agent/agent.py): `agent/agent.py`
- [Persistence and Cleanup](https://github.com/sweetsoftware/ares/blob/master/agent/agent.py): `agent/agent.py`

### Agent Build

- [Agent Builder](https://github.com/sweetsoftware/ares/blob/master/agent/builder.py): `agent/builder.py`
- [Build Settings](https://github.com/sweetsoftware/ares/blob/master/agent/template_config.py): `agent/template_config.py`

### Other components

- **Operator**
- **Compromised Host**

## Connections

- Operator → Admin Web UI: administers (evidence: `README.md`)
- Admin Web UI → Domain Models: queries and updates (evidence: `server/webui/__init__.py`)
- Agent API → Domain Models: queues and records (evidence: `server/api/__init__.py`)
- Flask App → Admin Web UI: registers (evidence: `server/ares.py`)
- Flask App → Agent API: registers (evidence: `server/ares.py`)
- Flask App → Domain Models: initializes (evidence: `server/ares.py`)
- Domain Models → SQLite Database: persists records (evidence: `server/config.py`)
- Admin Web UI → Agent API: requests commands (evidence: `server/api/__init__.py`)
- Agent Runtime → Agent Settings: reads settings (evidence: `agent/agent.py`)
- Compromised Host → Agent Runtime: runs (evidence: `README.md`)
- Agent Runtime → Agent API: checks in (evidence: `agent/agent.py`)
- Agent Runtime → Agent API: reports output (evidence: `agent/agent.py`)
- Agent API → Agent Runtime: returns commands (evidence: `server/api/__init__.py`)
- Agent Runtime → Shell Commands: dispatches to (evidence: `agent/agent.py`)
- Agent Runtime → File Transfer: dispatches to (evidence: `agent/agent.py`)
- Agent Runtime → Python Execution: dispatches to (evidence: `agent/agent.py`)
- Agent Runtime → Archive and Screenshot: dispatches to (evidence: `agent/agent.py`)
- Agent Runtime → Persistence and Cleanup: dispatches to (evidence: `README.md`)
- File Transfer → Agent API: uploads files (evidence: `agent/agent.py`)
- Agent API → Uploaded Files: stores uploads (evidence: `server/api/__init__.py`)
- Operator → Agent Builder: configures build (evidence: `README.md`)
- Agent Builder → Build Settings: fills settings (evidence: `agent/builder.py`)
- Agent Builder → Agent Runtime: packages agent (evidence: `agent/builder.py`)
