AzureC2Relay is an Azure Function that validates and relays Cobalt Strike beacon traffic by verifying the incoming requests based on a Cobalt Strike Malleable C2 profile. Any incoming requests that do not share the profiles user-agent, URI paths, headers, and query parameters, will be redirected to a configurable decoy website. The validated C2 traffic is relayed to a team server within the same virtual network that is further restricted by a network security group. Allowing the VM to only expose SSH.
Deploy
AzureC2Relay is deployed via terraform azure modules as well as some local az cli commands
Make sure you have terraform, az cli, and the dotnet core 3.1 runtimes installed
Modify the first variables defined in config.tf to suit your needs
Replace the dummy “cobaltstrike-dist.tgz” with an actual cobaltstrike download
Edit/Replace the Malleable profile inside the Ressources folder (Make sure the profile filename matches the variables you set in step 1)
login with azure az login
run terraform init
run terraform apply -auto-approve to deploy the infra
Wait for the CDN to become active and enjoy!
Once terraform completes it will provide you with the needed ssh command, the CobaltStrike teamserver will be running inside an tmux session on the deployed VM
When you have done using the infra, you can remove it with terraform destroy -auto-approve