mythic_rabbitmq
in order to send/receive messages. They also need to connect to the mythic_server
to transfer files and potentially use gRPC. By default, these container is bound on localhost only. In order to have an external agent connect up, you will need to adjust this in the Mythic/.env
file to have RABBITMQ_BIND_LOCALHOST_ONLY=false
and MYTHIC_SERVER_BIND_LOCALHOST_ONLY=false
and restart Mythic (sudo ./mythic-cli restart
).pip3 install mythic-container
(this has all of the definitions and functions for the container to sync with Mythic and issue RPC commands). Make sure you get the right version of this PyPi package for the version of Mythic you’re using (#current-payloadtype-versions). Alternatively, go get -u github.com/MythicMeta/MythicContainer
for golang.
/pathA
). Essentially, your /pathA
path will be the new InstalledServices/[agent name]
folder. Create a sub folder for your actual agent’s code to live, like /pathA/agent_code
. You can create a Visual Studio project here and simply configure it however you need.
/pathA/agent_functions
.
/pathA/rabbitmq_config.json
with the parameters you need
mythic_server_host
value should be the IP address of the main Mythic install
rabbitmq_host
value should be the IP address of the main Mythic install unless you’re running rabbitmq on another host.
Mythic/.env
file, by running sudo ./mythic-cli config get rabbitmq_password
, or if you run sudo ./mythic-cli config payload
you’ll see it there too.
mythic_rabbitmq
in order to send/receive messages. By default, this container is bound on localhost only. In order to have an external agent connect up, you will need to adjust this in the Mythic/.env
file to have RABBITMQ_BIND_LOCALHOST_ONLY=false
and restart Mythic (sudo ./mythic-cli restart
). You’ll also need to set MYTHIC_SERVER_BIND_LOCALHOST_ONLY=false
.
python3.11 main.py
and now you should see this container pop up in the UI
rabbitmq_password
, then you need to make sure that the password from Mythic/.env
after you start Mythic for the first time is copied over to your vm. You can either add this to your rabbitmq_config.json
file or set it as an environment variable (MYTHIC_RABBITMQ_PASSWORD
).agent_code
folder in any IDE you want.
When an agent is installed via mythic-cli
, the entire agent folder (agent_code
and mythic
) is mapped into the Docker container.
This means that any edits you make to the code is automatically reflected inside of the container without having to restart it (pretty handy).
The only caveat here is if you make modifications to the python or golang definition files will require you to restart your container to load up the changes sudo ./mythic-cli start [payload name]
.
If you’re making changes to those from a non-Docker instance, simply stop your python3.11 main.py
and start it again. This effectively forces those files to be loaded up again and re-synced over to Mythic. Edits to go files will naturally need to be rebuilt though.
agent_code
directory and you want to just “run” the project, complete with breakpoints and configurations so you can test. The only problem is that your local build needs to be known by Mythic in some way so that the Mythic UI can look up information about your agent, your “installed” commands, your encryption keys, etc.
To do this, you first need to generate a payload in the Mythic UI (or via Mythic’s Scripting). You’ll select any C2 configuration information you need, any commands you want baked in, etc. When you click to build, all of that configuration will get sent to your payload type’s “build” function in mythic/agent_functions/builder.py
. Even if you don’t have your container running or it fails to build, no worries, Mythic will first save everything off into the database before trying to actually build the agent. In the Mythic UI, now go to your payloads page and look for the payload you just tried to build. Click to view the information about the payload and you’ll see a summary of all the components you selected during the build process, along with some additional pieces of information (payload UUID and generated encryption keys).
Take that payload UUID and the rest of the configuration and stamp it into your agent_code
build. For some agents this is as easy as modifying the values in a Makefile, for some agents this can all be set in a config
file of some sort, but however you want to specify this information is up to you. Once all of that is set, you’re free to run your agent from within your IDE of choice and you should see a callback in Mythic. At this point, you can do whatever code mods you need, re-run your code, etc.