prompt command for the Mythic's Medusa agent.
This command allows an operator to dynamically execute AI-generated code based on prompts (orders).
The following diagram summarize the concept:
┌───────────────┐
│ │
│ AI │
│ API Endpoint │
│ │ 3. Generate code
└──▲────────┬───┘ and send back
│ │ to C2
2. Ask to generate │ │
code based on │ │
prompt │ │
┌────────┐ ┌┴────────▼─┐ 4. Get jobs ┌─────────────┐
│ │ │ │◄────────────────────┤ │
│ User ├───────────────────►│ C2 │ │ Implant │
│ │ 1. Issue prompt │ ├────────────────────►│ │
└────────┘ command └───────────┘ └─────────────┘
5. Send 6. Receive code
generated code and execute it
reflectively
- Install Mythic C2: https://docs.mythic-c2.net/installation
- Install the HTTP profile:
[Mythic folder]/mythic-cli install github https://github.com/MythicC2Profiles/http - Install the medusa agent:
[Mythic folder]/mythic-cli install github https://github.com/MythicAgents/Medusa - Set your OpenAI API key in the
api_keyvariable in theagent_functions/prompt.pyfile - Copy the following files in the Mythic server:
agent_code/prompt.py->[Mythic folder]/InstalledServices/medusa/medusa/agent_code/prompt.pyagent_functions/prompt.py->[Mythic folder]/InstalledServices/medusa/medusa/mythic/agent_functions/prompt.py
- Restart the
medusacontainer:[Mythic folder]/mythic-cli restart medusa
- Execute a medusa agent on a Windows/Linux/MacOS system
- Load the prompt command inside your agent:
load prompt - Use the prompt command:
prompt(it will pop the option box)

