# shenal01/stegoc2 architecture

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

- Interactive diagram: https://gitdiagram.com/shenal01/stegoc2
- Repository: https://github.com/shenal01/stegoc2

## Overview

This repository implements a steganography-based command-and-control workflow: a commander embeds a command in an image and uploads it; an agent retrieves the image, executes the concealed command, and uploads an image containing the output; a receiver can fetch and reveal that output. The README is empty. The relationships shown are supported by the sampled source; external services are represented only where the code makes requests to them.

Main entry points: [`agent.py`](https://github.com/shenal01/stegoc2/blob/main/agent.py) (Run mission), [`receiver.py`](https://github.com/shenal01/stegoc2/blob/main/receiver.py) (Fetch response), [`commander.py`](https://github.com/shenal01/stegoc2/blob/main/commander.py) (Commander CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_command["Command delivery"]
  node_commander["Commander CLI<br/>[commander.py]"]
  node_command_stego["Embed command<br/>[commander.py]"]
end

subgraph group_agent["Agent execution"]
  node_agent_cli["Agent entry<br/>[agent.py]"]
  node_command_fetch["Fetch image<br/>[agent.py]"]
  node_mission["Run mission<br/>[agent.py]"]
  node_result_stego["Encode output<br/>[agent.py]"]
  node_result_upload["Upload output<br/>[agent.py]"]
end

subgraph group_results["Result retrieval"]
  node_receiver["Receiver CLI<br/>[receiver.py]"]
  node_result_fetch["Fetch response<br/>[receiver.py]"]
  node_result_reveal["Reveal output<br/>[receiver.py]"]
end

node_operator(("Operator"))
node_catbox["Catbox hosting"]
node_shell["Command shell"]
node_telegram["Telegram API"]

node_operator -->|"provides command"| node_commander
node_commander -->|"calls"| node_command_stego
node_command_stego -->|"uploads image"| node_catbox
node_operator -->|"provides image URL"| node_agent_cli
node_agent_cli -->|"calls"| node_command_fetch
node_command_fetch -->|"fetches image"| node_catbox
node_agent_cli -->|"calls"| node_mission
node_mission -->|"executes command"| node_shell
node_mission -->|"embeds output"| node_result_stego
node_mission -->|"uploads response"| node_result_upload
node_result_upload -->|"uploads image"| node_catbox
node_mission -->|"sends result URL"| node_telegram
node_operator -->|"provides response URL"| node_receiver
node_receiver -->|"calls"| node_result_fetch
node_result_fetch -->|"fetches image"| node_catbox
node_result_fetch -->|"reveals payload"| node_result_reveal

click node_commander "https://github.com/shenal01/stegoc2/blob/main/commander.py"
click node_command_stego "https://github.com/shenal01/stegoc2/blob/main/commander.py"
click node_agent_cli "https://github.com/shenal01/stegoc2/blob/main/agent.py"
click node_command_fetch "https://github.com/shenal01/stegoc2/blob/main/agent.py"
click node_mission "https://github.com/shenal01/stegoc2/blob/main/agent.py"
click node_result_stego "https://github.com/shenal01/stegoc2/blob/main/agent.py"
click node_result_upload "https://github.com/shenal01/stegoc2/blob/main/agent.py"
click node_receiver "https://github.com/shenal01/stegoc2/blob/main/receiver.py"
click node_result_fetch "https://github.com/shenal01/stegoc2/blob/main/receiver.py"
click node_result_reveal "https://github.com/shenal01/stegoc2/blob/main/receiver.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_commander,node_command_stego toneBlue
class node_agent_cli,node_command_fetch,node_mission,node_result_stego,node_result_upload toneAmber
class node_receiver,node_result_fetch,node_result_reveal,node_telegram toneMint
class node_operator,node_catbox,node_shell toneIndigo
```

## Components

### Command delivery

- [Commander CLI](https://github.com/shenal01/stegoc2/blob/main/commander.py): `commander.py`
- [Embed command](https://github.com/shenal01/stegoc2/blob/main/commander.py): `commander.py`

### Agent execution

- [Agent entry](https://github.com/shenal01/stegoc2/blob/main/agent.py): `agent.py`
- [Fetch image](https://github.com/shenal01/stegoc2/blob/main/agent.py): `agent.py`
- [Run mission](https://github.com/shenal01/stegoc2/blob/main/agent.py): `agent.py`
- [Encode output](https://github.com/shenal01/stegoc2/blob/main/agent.py): `agent.py`
- [Upload output](https://github.com/shenal01/stegoc2/blob/main/agent.py): `agent.py`

### Result retrieval

- [Receiver CLI](https://github.com/shenal01/stegoc2/blob/main/receiver.py): `receiver.py`
- [Fetch response](https://github.com/shenal01/stegoc2/blob/main/receiver.py): `receiver.py`
- [Reveal output](https://github.com/shenal01/stegoc2/blob/main/receiver.py): `receiver.py`

### Other components

- **Operator**
- **Catbox hosting**
- **Command shell**
- **Telegram API**

## Connections

- Operator → Commander CLI: provides command (evidence: `commander.py`)
- Commander CLI → Embed command: calls (evidence: `commander.py`)
- Embed command → Catbox hosting: uploads image (evidence: `commander.py`)
- Operator → Agent entry: provides image URL (evidence: `agent.py`)
- Agent entry → Fetch image: calls (evidence: `agent.py`)
- Fetch image → Catbox hosting: fetches image (evidence: `agent.py`)
- Agent entry → Run mission: calls (evidence: `agent.py`)
- Run mission → Command shell: executes command (evidence: `agent.py`)
- Run mission → Encode output: embeds output (evidence: `agent.py`)
- Run mission → Upload output: uploads response (evidence: `agent.py`)
- Upload output → Catbox hosting: uploads image (evidence: `agent.py`)
- Run mission → Telegram API: sends result URL (evidence: `agent.py`)
- Operator → Receiver CLI: provides response URL (evidence: `receiver.py`)
- Receiver CLI → Fetch response: calls (evidence: `receiver.py`)
- Fetch response → Catbox hosting: fetches image (evidence: `receiver.py`)
- Fetch response → Reveal output: reveals payload (evidence: `receiver.py`)
