# mythicagents/kharon-mtc architecture

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

- Interactive diagram: https://gitdiagram.com/mythicagents/kharon-mtc
- Repository: https://github.com/mythicagents/kharon-mtc

## Overview

Kharon is a Mythic command-and-control agent for Windows, with an agent runtime and a Mythic-side service that translates tasks and responses. The main workflow is Mythic tasking → command encoding → agent execution → encrypted callback translation and response posting. Documented capabilities include HTTP/S and SMB communication, in-memory execution, evasion, lateral movement, and host-management commands. Source excerpts establish the Mythic translator flow and selected command/helper relationships; other capability links are documented in the README, not verified in sampled implementation code.

Main entry points: [`Payload_Type/kharon/Mythic/Translator/Translator.py`](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/Translator.py) (Translator Router), [`Payload_Type/kharon/Agent/Source/Misc/Tasks.cc`](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Misc/Tasks.cc) (Task Dispatch), [`Payload_Type/kharon/Agent/Source/Main.cc`](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Main.cc) (Agent Entry), [`Payload_Type/kharon/Mythic/main.py`](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/main.py) (Mythic Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mythic["Mythic Integration"]
  node_service["Mythic Service<br/>[main.py]"]
  node_commands["Command Handlers"]
  node_command_utils["Command Utilities<br/>[u.py]"]
  node_translator["Translator Router<br/>[Translator.py]"]
  node_to_agent["Task Encoder<br/>[ToAgent.py]"]
  node_to_c2["Callback Decoder<br/>[ToC2.py]"]
  node_translator_utils["Protocol Utilities<br/>[Utils.py]"]
end

subgraph group_agent["Agent Runtime"]
  node_agent_main["Agent Entry<br/>[Main.cc]"]
  node_agent_tasks["Task Dispatch<br/>[Tasks.cc]"]
  node_loader["PIC Loader<br/>[Main.cc]"]
end

subgraph group_comms["Communication"]
  node_package["Message Packaging<br/>[Package.cc]"]
  node_transport["Transport Layer<br/>[Transport.cc]"]
  node_web["HTTP/S Channel<br/>[Web.cc]"]
  node_smb["SMB Channel<br/>[Smb.cc]"]
end

subgraph group_capabilities["Execution Capabilities"]
  node_evasion["Evasion Techniques"]
  node_memory_exec["Memory Execution<br/>[Coff.cc]"]
  node_injection["Injection<br/>[Injection.cc]"]
  node_internals["Process Internals"]
end

node_operator(("Operator"))
node_mythic["Mythic C2"]

node_operator -->|"submits tasks"| node_mythic
node_mythic -->|"routes messages"| node_service
node_service -->|"starts service"| node_translator
node_translator -->|"encodes tasks"| node_to_agent
node_translator -->|"decodes callbacks"| node_to_c2
node_translator -->|"uses protocol helpers"| node_translator_utils
node_to_agent -->|"uses protocol helpers"| node_translator_utils
node_to_c2 -->|"uses protocol helpers"| node_translator_utils
node_service -->|"loads handlers"| node_commands
node_commands -->|"imports helpers"| node_command_utils
node_mythic -->|"receives callbacks"| node_translator
node_to_agent -.->|"encodes task messages"| node_agent_main
node_agent_main -.->|"dispatches tasks"| node_agent_tasks
node_agent_tasks -.->|"packages results"| node_package
node_package -.->|"sends messages"| node_transport
node_transport -.->|"uses HTTP/S"| node_web
node_transport -.->|"uses named pipes"| node_smb
node_agent_tasks -.->|"supports in-memory execution"| node_memory_exec
node_memory_exec -.->|"supports injection methods"| node_injection
node_agent_main -.->|"applies evasion"| node_evasion
node_agent_tasks -.->|"supports host operations"| node_internals
node_loader -.->|"loads PIC agent"| node_agent_main
node_mythic -.->|"offers execution tasks"| node_memory_exec
node_mythic -.->|"offers movement and host commands"| node_internals
node_mythic -.->|"documents evasion options"| node_evasion

click node_service "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/main.py"
click node_commands "https://github.com/mythicagents/kharon-mtc/tree/main/Payload_Type/kharon/Mythic/Kharon/AgentFunctions"
click node_command_utils "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Kharon/AgentFunctions/Utils/u.py"
click node_translator "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/Translator.py"
click node_to_agent "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/ToAgent.py"
click node_to_c2 "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/ToC2.py"
click node_translator_utils "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/Utils.py"
click node_agent_main "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Main.cc"
click node_agent_tasks "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Misc/Tasks.cc"
click node_package "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Communication/Package.cc"
click node_transport "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Communication/Transport.cc"
click node_web "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Communication/Web.cc"
click node_smb "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Communication/Smb.cc"
click node_evasion "https://github.com/mythicagents/kharon-mtc/tree/main/Payload_Type/kharon/Agent/Source/Evasion"
click node_memory_exec "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Evasion/Coff.cc"
click node_injection "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Evasion/Injection.cc"
click node_internals "https://github.com/mythicagents/kharon-mtc/tree/main/Payload_Type/kharon/Agent/Source/Internals"
click node_loader "https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Loader/Main.cc"

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_service,node_commands,node_command_utils,node_translator,node_to_agent,node_to_c2,node_translator_utils toneBlue
class node_agent_main,node_agent_tasks,node_loader toneAmber
class node_package,node_transport,node_web,node_smb toneMint
class node_evasion,node_memory_exec,node_injection,node_internals toneRose
class node_operator,node_mythic toneIndigo
```

## Components

### Mythic Integration

- [Mythic Service](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/main.py): `Payload_Type/kharon/Mythic/main.py`
- [Command Handlers](https://github.com/mythicagents/kharon-mtc/tree/main/Payload_Type/kharon/Mythic/Kharon/AgentFunctions): `Payload_Type/kharon/Mythic/Kharon/AgentFunctions`
- [Command Utilities](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Kharon/AgentFunctions/Utils/u.py): `Payload_Type/kharon/Mythic/Kharon/AgentFunctions/Utils/u.py`
- [Translator Router](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/Translator.py): `Payload_Type/kharon/Mythic/Translator/Translator.py`
- [Task Encoder](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/ToAgent.py): `Payload_Type/kharon/Mythic/Translator/ToAgent.py`
- [Callback Decoder](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/ToC2.py): `Payload_Type/kharon/Mythic/Translator/ToC2.py`
- [Protocol Utilities](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Mythic/Translator/Utils.py): `Payload_Type/kharon/Mythic/Translator/Utils.py`

### Agent Runtime

- [Agent Entry](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Main.cc): `Payload_Type/kharon/Agent/Source/Main.cc`
- [Task Dispatch](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Misc/Tasks.cc): `Payload_Type/kharon/Agent/Source/Misc/Tasks.cc`
- [PIC Loader](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Loader/Main.cc): `Payload_Type/kharon/Loader/Main.cc`

### Communication

- [Message Packaging](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Communication/Package.cc): `Payload_Type/kharon/Agent/Source/Communication/Package.cc`
- [Transport Layer](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Communication/Transport.cc): `Payload_Type/kharon/Agent/Source/Communication/Transport.cc`
- [HTTP/S Channel](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Communication/Web.cc): `Payload_Type/kharon/Agent/Source/Communication/Web.cc`
- [SMB Channel](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Communication/Smb.cc): `Payload_Type/kharon/Agent/Source/Communication/Smb.cc`

### Execution Capabilities

- [Evasion Techniques](https://github.com/mythicagents/kharon-mtc/tree/main/Payload_Type/kharon/Agent/Source/Evasion): `Payload_Type/kharon/Agent/Source/Evasion`
- [Memory Execution](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Evasion/Coff.cc): `Payload_Type/kharon/Agent/Source/Evasion/Coff.cc`
- [Injection](https://github.com/mythicagents/kharon-mtc/blob/main/Payload_Type/kharon/Agent/Source/Evasion/Injection.cc): `Payload_Type/kharon/Agent/Source/Evasion/Injection.cc`
- [Process Internals](https://github.com/mythicagents/kharon-mtc/tree/main/Payload_Type/kharon/Agent/Source/Internals): `Payload_Type/kharon/Agent/Source/Internals`

### Other components

- **Operator**
- **Mythic C2**

## Connections

- Operator → Mythic C2: submits tasks (evidence: `README.md`)
- Mythic C2 → Mythic Service: routes messages (evidence: `Payload_Type/kharon/Mythic/main.py`)
- Mythic Service → Translator Router: starts service (evidence: `Payload_Type/kharon/Mythic/main.py`)
- Translator Router → Task Encoder: encodes tasks (evidence: `Payload_Type/kharon/Mythic/Translator/Translator.py`)
- Translator Router → Callback Decoder: decodes callbacks (evidence: `Payload_Type/kharon/Mythic/Translator/Translator.py`)
- Translator Router → Protocol Utilities: uses protocol helpers (evidence: `Payload_Type/kharon/Mythic/Translator/Translator.py`)
- Task Encoder → Protocol Utilities: uses protocol helpers (evidence: `Payload_Type/kharon/Mythic/Translator/ToAgent.py`)
- Callback Decoder → Protocol Utilities: uses protocol helpers (evidence: `Payload_Type/kharon/Mythic/Translator/ToC2.py`)
- Mythic Service → Command Handlers: loads handlers
- Command Handlers → Command Utilities: imports helpers (evidence: `Payload_Type/kharon/Mythic/Kharon/AgentFunctions/file-system.py`)
- Mythic C2 → Translator Router: receives callbacks (evidence: `README.md`)
- Task Encoder → Agent Entry: encodes task messages
- Agent Entry → Task Dispatch: dispatches tasks
- Task Dispatch → Message Packaging: packages results
- Message Packaging → Transport Layer: sends messages
- Transport Layer → HTTP/S Channel: uses HTTP/S
- Transport Layer → SMB Channel: uses named pipes
- Task Dispatch → Memory Execution: supports in-memory execution
- Memory Execution → Injection: supports injection methods
- Agent Entry → Evasion Techniques: applies evasion
- Task Dispatch → Process Internals: supports host operations
- PIC Loader → Agent Entry: loads PIC agent
- Mythic C2 → Memory Execution: offers execution tasks (evidence: `README.md`)
- Mythic C2 → Process Internals: offers movement and host commands (evidence: `README.md`)
- Mythic C2 → Evasion Techniques: documents evasion options (evidence: `README.md`)
