So you want to make a new Payload Type
The first step is to copy down the example repository https://github.com/MythicMeta/ExampleContainers. Inside of thePayload_Type
folder, there are two projects - one for GoLang and one for Python depending on which language you prefer to code your agent definitions in (this has nothing to do with the language of your agent itself, it’s simply the language to define commands and parameters). Pick whichever service you’re interested in and copy that folder into your Mythic/InstalledServices
folder. If you want your new container to be referenced as my_agent
then copy the folder over to Mythic/InstalledServices/my_agent
.
Docker does not allow capital letters in container names. So, if you plan on using Mythic
mythic-cli
to control and install your agent, then your agent’s name can’t have any capital letters in it. Only lowercase, numbers, and _. It’s a silly limitation by Docker, but it’s what we’re working with.python_services
folder this would mean deleting the mywebhook
, translator
, and websocket
folders. For the go_services
folder, this would mean deleting the http
, my_logger
, my_webhooks
, no_actual_translation
folders. For both cases, this will result in removing some imports at the top of the remaining main.py
and main.go
files.
For the python_services
folder, we’ll update the apfell/agent_functions/builder.py
file. This file can technically be anywhere that main.py
can reach and import, but for convenience it’s in a folder, agent_functions
along with all of the command definitions for the agent. Below is an example from that builder that defines the agent:
sudo ./mythic-cli add my_agent
and sudo ./mythic-cli start my_agent
and you’ll see the container build, start, and you’ll see it sync with the Mythic server (more about that process at Container Syncing).
Congratulations! You now have a payload type that Mythic recognizes!