This project automates the setup of a Command and Control (C2) infrastructure using Terraform and Ansible. It aims to streamline the deployment and configuration of infrastructure components required for managing and controlling systems efficiently.
This diagram outlines the concept of the scenario used for this project:
The project follows a structured layout to organize its files and resources effectively:
├── data
│ ├── playbooks
│ ├── ssh_configs
│ ├── ssh_keys
│ └── templates
├── modules
│ ├── ansible
│ │ └── core
│ └── aws
│ ├── create-dns-record
│ ├── create-vpc
│ ├── http-c2
│ ├── http-cobalt-strike
│ └── http-redirector
├── nb_modules
│ ├── ansible
│ └── cobalt-strike
To use this project, ensure you have the following prerequisites:
- Terraform installed on your local machine (Download Terraform)
- Ansible installed on your local machine (Install Ansible)
- AWS Account with necessary permissions and credentials
- CloudFlare Account for DNS management and HTTPS configuration
- A registered Domain Name for your infrastructure
- SSH Key Pair for secure access to servers
- ...
- Clone this repository to your local machine.
- Set up your Terraform variables in the
terraform.tfvars
file based onterraform.tfvars.example
. - Review and update the necessary configurations in Terraform files (
main.tf
,variables.tf
, etc.) according to your requirements. - Run
terraform init
to initialize Terraform and download required plugins. - Run
terraform plan
to review the execution plan. - Run
terraform apply
to provision the infrastructure as defined in the Terraform configuration.
- Use
terraform output
to get information about the provisioned resources. - Use Ansible playbooks in the
data/playbooks
directory to manage and configure servers post-provisioning.