How mythicagents/kharon-mtc works
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: Translator.py Translator Router · Tasks.cc Task Dispatch · Main.cc Agent Entry · main.py Mythic Service
Components 20
Mythic Integration
- Mythic Service
Payload_Type/kharon/Mythic/main.py - Command Handlers
Payload_Type/kharon/Mythic/Kharon/AgentFunctions - Command Utilities
Payload_Type/kharon/Mythic/Kharon/AgentFunctions/Utils/u.py - Translator Router
Payload_Type/kharon/Mythic/Translator/Translator.py - Task Encoder
Payload_Type/kharon/Mythic/Translator/ToAgent.py - Callback Decoder
Payload_Type/kharon/Mythic/Translator/ToC2.py - Protocol Utilities
Payload_Type/kharon/Mythic/Translator/Utils.py
Agent Runtime
- Agent Entry
Payload_Type/kharon/Agent/Source/Main.cc - Task Dispatch
Payload_Type/kharon/Agent/Source/Misc/Tasks.cc - PIC Loader
Payload_Type/kharon/Loader/Main.cc
Communication
- Message Packaging
Payload_Type/kharon/Agent/Source/Communication/Package.cc - Transport Layer
Payload_Type/kharon/Agent/Source/Communication/Transport.cc - HTTP/S Channel
Payload_Type/kharon/Agent/Source/Communication/Web.cc - SMB Channel
Payload_Type/kharon/Agent/Source/Communication/Smb.cc
Execution Capabilities
- Evasion Techniques
Payload_Type/kharon/Agent/Source/Evasion - Memory Execution
Payload_Type/kharon/Agent/Source/Evasion/Coff.cc - Injection
Payload_Type/kharon/Agent/Source/Evasion/Injection.cc - Process Internals
Payload_Type/kharon/Agent/Source/Internals
Other components
- Operator
- Mythic C2
Connections 25
- Operator → Mythic C2: submits tasks
README.md - Mythic C2 → Mythic Service: routes messages
Payload_Type/kharon/Mythic/main.py - Mythic Service → Translator Router: starts service
Payload_Type/kharon/Mythic/main.py - Translator Router → Task Encoder: encodes tasks
Payload_Type/kharon/Mythic/Translator/Translator.py - Translator Router → Callback Decoder: decodes callbacks
Payload_Type/kharon/Mythic/Translator/Translator.py - Translator Router → Protocol Utilities: uses protocol helpers
Payload_Type/kharon/Mythic/Translator/Translator.py - Task Encoder → Protocol Utilities: uses protocol helpers
Payload_Type/kharon/Mythic/Translator/ToAgent.py - Callback Decoder → Protocol Utilities: uses protocol helpers
Payload_Type/kharon/Mythic/Translator/ToC2.py - Mythic Service → Command Handlers: loads handlers
- Command Handlers → Command Utilities: imports helpers
Payload_Type/kharon/Mythic/Kharon/AgentFunctions/file-system.py - Mythic C2 → Translator Router: receives callbacks
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
README.md - Mythic C2 → Process Internals: offers movement and host commands
README.md - Mythic C2 → Evasion Techniques: documents evasion options
README.md