This project allows operators to set up multiple Mythic C2 servers in Azure. Optionally, Azure CDN redirectors can be created as well. The idea is that you are able to create multiple "projects" that you can manage from this Terraform code. This way, operators can manage the resources for their infrastructure in a central place, as code.
Inside the main.tf file is a projects map. You can add projects to that map. Every project will get their own Mythic C2 instance. Different variables can be added to configure Mythic, like the credentials and the C2 agent to install. For example:
locals {
projects = {
# Custom Mythic deployment.
hackeverything = {
vm-username = "adminuser"
mythic_version = "v3.2.2"
mythic_admin_user = "asdf"
mythic_c2_profile = "https://github.com/MythicC2Profiles/httpx"
mythic_agent = "https://github.com/MythicAgents/Xenon"
cdn_frontdoor_endpoints = 2
}
# Default Mythic deployment.
hacksomething = {}
}
}Currently, it's just the basic Mythic C2 installation as documented. The Mythic portal listens on localhost. You could use ssh local port forwarding to access it, e.g.
ssh -L 127.0.0.1:7443:127.0.0.1:7443 <VM-USERNAME>@<IP>There are two secrets that you will need:
- The SSH key for the VM
- The password for the Mythic Web Console
You need to know the name of the Azure Key Vault, which can be found in the Azure Portal, and the name of your project. Use the az command to get the secrets.
# SSH Key
az keyvault secret show --vault-name <KEY VAULT NAME> --name <PROJECT-sshkey> | jq .value -r
# Web Console Password
az keyvault secret show --vault-name <KEY VAULT NAME> --name <PROJECT-mythic-admin>
This project was primarily used for learning more about Terraform, Mythic and Azure.