./install_docker_ubuntu.sh
script to install it for you. If you’re running on debian, use the ./install_docker_debian.sh
instead.20.10.22
or above (latest version is 23.0.1
) for Mythic and the docker containers to work properly. If you do sudo apt upgrade
and sudo apt install docker-compose-plugin
on a new version of Ubuntu or Debian, then you should be good. You can check your version with sudo docker version
.mythic-cli
binary. However, to help with GitHub sizes, the mythic-cli
binary is no longer distributed with the main Mythic repository. Instead, you will need to make the binary via sudo make
from the main Mythic folder. This will create the build container for the mythic-cli, build the binary, and copy it into your main Mythic folder automatically. From there on, you can use the mythic-cli
binary like normal. Make sure you use the mythic-cli
binary from the main Mythic folder.
If you’re running Mythic on macOS, instead of running sudo make
run sudo make macos
and you’ll get an architecture appropriate machO binary to use.
Mythic/.env
, which means for your configuration you can either add/edit values there or add them to your environment.
sudo ./mythic-cli start
for the first time or you can create it ahead of time with just the variables you want to configure. mythic-cli status
is an easy way to pre-generate the .env
file so you can modify it without it being used by any containers yet.mythic-cli
as root for Docker and you set your environment variables as a user, be sure to run sudo -E ./mythic-cli
so that your environment variables are carried over into your sudo call. The following are the default values that Mythic will generate on first execution of sudo ./mythic-cli start
unless overridden:
MYTHIC_SERVER_PORT
will be the port opened on the server where you’re running Mythic. The NGINX_PORT
is the one that’s opened by Nginx and acts as a reverse proxy to all other services. The NGINX_PORT
is the one you’ll connect to for your web user interface and should be the only port you need to expose externally (unless you prefer to SSH port forward your web UI port).
allowed_ip_blocks
allow you to restrict access to everything within Mythic. This should be set as a series of netblocks with NO host bits set - i.e. 127.0.0.0/16,192.168.10.0/24,10.0.0.0/8
*_BIND_LOCALHOST_ONLY
- these settings determine if the associated container binds the port to 127.0.0.1:port
or 0.0.0.0:port
. These are all set to true (except for the nginx container) by default so that you’re not exposing these services externally.
false
so that your remote services can access Mythic. If you change these, you will need to run sudo ./mythic-cli start
to make sure these changes are leveraged by Docker.mythic_server
container starts for the first time, it goes through an initialization step where it uses the password and username from Mythic/.env
to create the mythic_admin_user
user. Once the database exists, the mythic_server
container no longer uses that value.
mythic-cli
binary is used to start/stop/configure/install components of Mythic. You can see the help menu at any time with mythic-cli -h
, mythic-cli --help
or mythic-cli help
.
mythic-cli
binary with:
-f
at the end, then Mythic will automatically overwrite the current version that’s installed, otherwise you’ll be prompted for each piece.
basic_logger
via the mythic cli sudo ./mythic-cli install github https://github.com/MythicC2Profiles/basic_logger
. This profile listens to the emit_log
RabbitMQ queue and allows you to configure how you want to save/modify the logs. By default they just go to stdout, but you can configure it to write out to files or even submit the events to your own SIEM.
sudo ./mythic-cli build basic_logger
to rebuild with your updated code.
sudo ./mythic-cli stop
and if you want to start it again run sudo ./mythic-cli start
. If Mythic is currently running and you need to make a change, you can run sudo ./mythic-cli restart
again without any issue, that command will automatically stop things and then restart them.
The default username is mythic_admin
, but that user’s password is randomly generated when Mythic is started for the first time. You can find this random value in the Mythic/.env
file. Once Mythic has started at least once, this value is no longer needed, so you can edit or remove this entry from the Mythic/.env
file.
./mythic-cli install github <url> [branch] [-f]
command to install an agent from a GitHub (or GitLab) repository.sudo ./mythic-cli status
to give a status update on all of the docker containers. They should all be up and running. If one is exited or has only been up for less than 30 seconds, that container might be your issue. All of the Mythic services will also report back a health check which can be useful to determine if a certain container is having issues. The status command gives a lot of information about what services are running, on which ports, and if they’re externally accessible or not.sudo ./mythic-cli logs [container_name]
. For example, to see the output of mythic_server, run sudo ./mythic-cli logs mythic_server
. This will help track down if the last thing that happened was an error of some kind.
mythic_nginx
is failing to start, you can look at its logs with sudo ./mythic-cli logs mythic_nginx
. If you see Address family not supported by protocol
, then it likely means that the nginx container is trying to use IPv4 and IPv6, but your host doesn’t support one of them. To fix this, you can edit the .env file to adjust the following as necessary:
sudo ./mythic-cli build mythic_nginx
and it should come up.
ghcr.io/itsafeature
in the FROM line in your Dockerfiles instead of the itsafeaturemythic/
line which is hosted on DockerHub. When the Mythic repo gets a new tag
, these images are pre-built, mythic-cli is updated, and the associated push
on GitHub is updated with the new tag version.
When you use the new mythic-cli
to start Mythic, the .env
variable GLOBAL_DOCKER_LATEST
is used to determine which version of the Docker images to use. This variable is written out and saved as part of mythic-cli
itself.
git pull
that you always run sudo make
to get the latest mythic-cli
as well.*_USE_BUILD_CONTEXT
- This variable changes the docker-compose
file to either set a build-context
to read the local Dockerfile when building or to not use the local build context and just set the image to use to be the one hosted on GitHub. In most cases, you’re fine to leave this as false
and just use the image hosted on GitHub. If you wanted to use another image version or if you wanted add stuff to the image that gets generated for a container, you can set this to true
and modify the Dockerfile associated with the service.
*_USE_VOLUME
- This variable identifies if the local file system is mounted into the image at run-time or if a custom volume is created and mounted instead. When this is set to true
, then a custom volume is created and mounted into the container at run time so that your local filesystem isn’t used. When this is false
, then your local filesystem is mounted like normal. One reason to mount the local file system instead of using a volume is if you wanted to make changes to something on disk and have it reflected in the container. Similarly, you can set this to false
so that your database and downloaded files are all contained within the Mythic
folder. Setting this to true
will mean that volumes are used, so your saved files and database are in Docker’s volume directory and not locally within the Mythic folder. It’s just something to consider when it comes time to save things off or if you wanted to pull the files from disk.
*_INSTALL_LOCATION
- This variable gives either the folder path or the “url;branch” that was used to install the agent in the first place. This is used by mythic-cli
commands like ./mythic-cli update -s [agent name]
to determine if the agent has any updates available.
*_REMOTE_IMAGE
- This variable tracks the remote image that’s pre-built for the agent (if one exists). This is used in conjunction with the *_INSTALL_LOCATION
to see if there are any updates for the agent.
config.json
so that Mythic can also track the version associated with your agent.
Specifically, you need to create the .github/workflows/[name].yml
file so that GitHub will be able to handle your actions. An example from the apollo
payload is shown below:
RELEASE_BRANCH
- This might need to change depending on if your branch name is master
or main
.
remote_images.apollo
(line 112) to remote_images.[your name]
so that your config.json
is updated appropriately. If you have multiple installs (ex: a payload in the payload_type folder and a c2 profile in the c2_profiles folder), then you should include this action multiple times to add each entry to your remote_images
dictionary.