Hacktricks-skills mythic-c2-framework
How to set up and use the Mythic C2 framework for authorized red teaming and security testing. Use this skill whenever the user needs to install Mythic, configure agents (Apollo, Poseidon, etc.), set up C2 profiles, or execute common red team operations like lateral movement, privilege escalation, or credential access. Make sure to use this skill when the user mentions Mythic, C2 frameworks, red teaming, penetration testing, or authorized security assessments involving command and control infrastructure.
git clone https://github.com/abelrguezr/hacktricks-skills
skills/windows-hardening/mythic/SKILL.MDMythic C2 Framework
Mythic is an open-source, modular command and control (C2) framework designed for authorized red teaming and security testing. It allows security professionals to manage and deploy various agents (payloads) across different operating systems, including Windows, Linux, and macOS.
⚠️ IMPORTANT: This skill is for authorized security testing only. Only use Mythic on systems you own or have explicit written permission to test. Unauthorized use is illegal and unethical.
Quick Start
Installation
-
Clone the Mythic repository:
git clone https://github.com/its-a-feature/Mythic cd Mythic -
Follow the official installation instructions in the Mythic repo
-
Start the Mythic server:
sudo ./mythic-cli start -
Access the web interface at
http://localhost:8080
Managing Agents
Agents are the payloads that perform tasks on target systems. Mythic doesn't include agents by default - you install them separately.
Installing Agents
# Install from MythicAgents repository sudo ./mythic-cli install github https://github.com/MythicAgents/<agent-name> # Example: Install Apollo (Windows agent) sudo ./mythic-cli install github https://github.com/MythicAgents/Apollo.git # Example: Install Poseidon (Linux/macOS agent) sudo ./mythic-cli install github https://github.com/MythicAgents/Poseidon.git
You can add agents even while Mythic is running.
Available Agents
| Agent | Platform | Description |
|---|---|---|
| Apollo | Windows | C# .NET 4.0 agent, similar to Cobalt Strike Beacon |
| Poseidon | Linux/macOS | Golang agent for Unix-like systems |
| Forge | All | Loads COFF/BOF modules for stealthy execution |
C2 Profiles
C2 profiles define how agents communicate with the Mythic server (protocol, encryption, etc.).
Installing C2 Profiles
# Install from MythicC2Profiles repository sudo ./mythic-cli install github https://github.com/MythicC2Profiles/<profile-name> # Example: Install HTTP profile sudo ./mythic-cli install github https://github.com/MythicC2Profiles/http
Manage profiles through the Mythic web interface after installation.
Apollo Agent Commands (Windows)
Common Actions
| Command | Description |
|---|---|
| Print file contents |
| Change directory |
| Copy files |
| List files and directories |
| Print current directory |
| List running processes |
| Download file from target |
| Upload file to target |
| Query registry keys |
| Write registry values |
| Change agent check-in interval |
| Show available commands |
| Mark tasks as cleared |
Privilege Escalation
| Command | Description |
|---|---|
| Enable privileges on current thread token |
| Escalate to SYSTEM level |
| Create new logon session for impersonation |
| Steal token from another process |
| Pass-the-Hash attack |
| Extract credentials from memory/SAM |
| Revert to original token |
| Change parent process for jobs |
| Bypass print spooler security |
| Sync Kerberos keys for offline cracking |
| Add Kerberos ticket to session |
Process Execution
| Command | Description |
|---|---|
| Inject .NET assembly into remote process |
| Execute .NET assembly in agent context |
| Execute COFF file in memory |
| Execute unmanaged PE executable |
| Execute .NET assembly in disposable AppDomain |
| Execute binary using system PATH |
| Inject shellcode into remote process |
| Inject agent shellcode into remote process |
| Spawn new agent session in executable |
| Change default binary for x64 jobs |
| Change default binary for x86 jobs |
PowerShell & Scripting
| Command | Description |
|---|---|
| Import .ps1 script to agent cache |
| Execute PowerShell command |
| Inject PowerShell loader (no logging) |
| Execute PowerShell in specified process |
| Execute shell command (cmd.exe) |
Lateral Movement
| Command | Description |
|---|---|
| Lateral movement via PsExec |
| Lateral movement via WMI |
| Execute command via WMI |
| List domain controllers |
| List local groups |
| List group members |
| List remote shares |
| Enable SOCKS5 proxy |
| Reverse port forward |
| List named pipes |
Mythic Forge (BOF/COFF Execution)
Install the Forge agent to load pre-compiled payloads:
./mythic-cli install github https://github.com/MythicAgents/forge.git
Load collections:
forge_collections {"collectionName":"SharpCollection"} forge_collections {"collectionName":"SliverArmory"}
Loaded modules appear as commands like
forge_bof_sa-whoami or forge_bof_sa-netuser.
Poseidon Agent Commands (Linux/macOS)
Common Actions
| Command | Description |
|---|---|
| Print file contents |
| Change directory |
| Change file permissions |
| View config and host info |
| Copy files |
| Execute web request |
| Upload file to target |
| Download file from target |
| Execute shell command via /bin/sh |
| Execute command from disk |
| Open interactive PTY |
Sensitive Information Search
| Command | Description |
|---|---|
| Find interesting/sensitive files |
| Get environment variables |
Lateral Movement
| Command | Description |
|---|---|
| SSH to host with PTY |
| SSH to host(s) with credentials |
| Link to another agent over TCP |
| Link via webshell P2P profile |
| Reverse port forward |
| SOCKS5 proxy |
| Scan for open ports |
Common Workflows
1. Initial Setup
# Install Mythic git clone https://github.com/its-a-feature/Mythic cd Mythic # Install required agents sudo ./mythic-cli install github https://github.com/MythicAgents/Apollo.git sudo ./mythic-cli install github https://github.com/MythicAgents/Poseidon.git sudo ./mythic-cli install github https://github.com/MythicAgents/forge.git # Install C2 profiles sudo ./mythic-cli install github https://github.com/MythicC2Profiles/http # Start server sudo ./mythic-cli start
2. Deploy Agent to Target
- In Mythic web UI, select your agent type
- Configure C2 profile
- Generate payload (executable, script, etc.)
- Deploy to target system
- Monitor for check-ins in the web interface
3. Execute Commands
- Select the agent in the web interface
- Choose a command from the available list
- Configure parameters
- Execute and view results
4. Lateral Movement
# Enumerate domain net_dclist {"domain":"YOURDOMAIN.local"} # Find targets net_shares {"computer":"TARGET-PC"} # Move laterally jump_psexec {"computer":"TARGET-PC", "username":"admin", "password":"password"}
Best Practices
- Always have authorization - Written permission for all testing
- Use appropriate C2 profiles - Match your testing environment
- Document everything - Keep records of all actions taken
- Test in isolated environments - Use lab environments for practice
- Follow responsible disclosure - Report findings appropriately
Resources
Troubleshooting
Agent not checking in
- Verify C2 profile is correctly configured
- Check firewall rules allow communication
- Confirm agent was deployed correctly
- Review Mythic server logs
Commands not executing
- Ensure agent is active and checking in
- Verify command syntax
- Check agent has required permissions
- Review agent logs in web interface
Installation issues
- Ensure all dependencies are installed
- Check Python version compatibility
- Verify database is running (PostgreSQL)
- Review installation logs