{"id":28761666,"url":"https://github.com/optionalctf/c2structor","last_synced_at":"2025-06-17T07:30:24.330Z","repository":{"id":299518959,"uuid":"940506059","full_name":"optionalCTF/C2structor","owner":"optionalCTF","description":"Automated C2 Deployment in AWS using Terraform and Ansible","archived":false,"fork":false,"pushed_at":"2025-05-27T12:11:04.000Z","size":10,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T00:34:07.681Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/optionalCTF.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-28T09:46:37.000Z","updated_at":"2025-05-27T12:11:08.000Z","dependencies_parsed_at":"2025-06-17T00:34:08.971Z","dependency_job_id":"580ee3a1-9cca-499b-8faf-cdf0d289d1b9","html_url":"https://github.com/optionalCTF/C2structor","commit_stats":null,"previous_names":["optionalctf/c2structor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/optionalCTF/C2structor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optionalCTF%2FC2structor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optionalCTF%2FC2structor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optionalCTF%2FC2structor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optionalCTF%2FC2structor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/optionalCTF","download_url":"https://codeload.github.com/optionalCTF/C2structor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optionalCTF%2FC2structor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260313439,"owners_count":22990391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-17T07:30:18.010Z","updated_at":"2025-06-17T07:30:24.242Z","avatar_url":"https://github.com/optionalCTF.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C2structor\nC2structor aims to optimise and reduce overhead in relation to infrastructure deployment for red team engagements. In it's current state infrastructure is deployed onto AWS using Terraform and Ansible playbooks while providing a relatively straight-forward user experience by controlling deployment through the `terraform.tfvars` file. For full capabilities see below.\n\n\nIt should be noted at this point that IOCs have been left intact. Additionally, although security groups are generated and assigned, they have not been configured with OPSEC in mind with the exception to restricting SSH access to an authorised IP range (such as a VPN). The generated security groups should be reviewed and restricted appropriately. \n\n\n## Capabilities\n- Havoc C2 deployment hosted behind a CloudFront Edge Redirector and Caddy internal Redirector\n- Gophish server deployment\n- Evilginx2 server deployment\n\nIt should be noted that the Evilginx2 deployment will create an EC2 instance with Evilginx2 built in `/opt/evilginx2/build/evilginx`, this is by design as each configuration should be tailored to your engagement rather than using a boiler plate configuration.\n\nFor full automated deployment of CloudFront, a Route53 domain is required. Though an option exists to disable Route53, this would result in additional configuration on the operators end.\n\n## Requirements\n- Terraform\n- AWS CLI\n- AWS IAM user with capabilities to deploy resources\n\n\n## Deployment\nC2structor can be configured and deployed with the following steps\n\n### Clone the Repo\n```\n$ git clone https://github.com/optionalCTF/C2structor.git\n$ cd C2structor\n```\n\n### Configure Deployment\nC2structor is controlled through the `terraform.tfvars` configuration file. Here you can specify which resources you would like to deploy as well as specify Route53 Hosted Zones, domain names and preferred sub-domain.\nExample Configuration\n```\n# Deploy Gophish Server (Default disabled)\ngophish_enabled = false\n\n# Deploy Evilginx Server (Default disabled)\nevilginx_enabled = false\n\n# Deploy Teamserver and redirectors (Default true)\nts-enabled = true\n\n# Authorised IP for SSH Access (Expects CIDR block e.g 8.8.8.8/32)\nauthorised_ip_block = \"8.8.8.8/32\"\n```\nIf a teamserver is being deployed, you will need to toggle Route53 (default is enabled) and specify the domain and subdomain for the CloudFront origin.\nIf Route53 is in-use, you will also need to specify the Hosted Zone ID to allow dynamic DNS records. \n\n### Initialise Terraform\n```\n$ terraform init\n$ terraform plan \n$ terraform apply\n```\n\nOnce Terraform has deployed your resources, outputs will go into `/outputs`, this will contain the SSH key for setting up local forwarding and if Gophish was deployed, the admin credentials to login.\n\n## Disclaimer\nC2structor is designed to aid deployment but will require manual modifications to remove IOCs, it is also recommended that manual adjustments are made to security groups to restrict public access to resources where necessary. IOCs were left by design and security groups are purposely lax to prevent blatant abuse.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptionalctf%2Fc2structor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptionalctf%2Fc2structor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptionalctf%2Fc2structor/lists"}