Home

Awesome

Terraform_DigitalOcean_Scripts

Bash and terraform scripts to automate standing up C2 infra with firewall settings inside of DigitalOcean.

FYI: Each instance stood up is an Ubuntu 20 DigitalOcean instance.

The scripts were built to be run on either Linux or macOS hosts. The scripts will first check to see if you have installed terraform and if not, it will attempt to install it for you before proceeding.

NOTE: It is recommended that after running any of the scripts below to stand up your infra that you then ssh into your host, create a local user with sudo, and run any tools as that user. Running tools as root is not recommended

Image

Prerequisites

Instructions

chmod +x *.sh

./[name of bash script you want to run]

Info on the types of scripts included

1. run-ubuntu-behind-firewall.sh

This will setup an ubuntu host in DigitalOcean, create a firewall, and add this host behind the firewall. This is a general purpose host that can be used for C2.

This bash script will gather info such as:

Terraform will install the following in the DO droplet:

Terraform first runs a plan and then apply, so you will need to enter "yes" when prompted to apply:

Image

once done, you will see a message from terraform indicating succcess:

Image

You will also be able to see the newly created droplet and firewall in the DO control panel:

Image

Image

Then you can ssh into the droplet and run whatever C2 you choose (preferrably as a non-root user with sudo). If you opt to use my C2 Cradle tool, then you can do the following:

cd C2_Cradle

chmod +x run.sh

sudo ./run.sh

Then pick the C2 server you want to use and the C2 cradle will install it in Docker


2. run-ubuntu-with-gophish.sh

This will setup an ubuntu host in DigitalOcean, download and install gophish, create a firewall, and add this host behind the firewall. This is intended to be a gophish host.

This bash script will gather info such as:

Terraform will install the following in the DO droplet:

Terraform first runs a plan and then apply, so you will need to enter "yes" when prompted to apply:

Image

once done, you will see a message from terraform indicating succcess:

Image

You will also be able to see the newly created droplet and firewall in the DO control panel:

Image

Image

Then you can ssh into the droplet, switch to a non-root user with sudo, cd into the gophish directory and do the following:

sudo ./gophish &


3. run-ubuntu-with-evilginx2.sh

This will setup an ubuntu host in DigitalOcean, download and install evilginx2, create a firewall, and add this host behind the firewall. This is intended to be an evilginx2 host.

This bash script will gather info such as:

Terraform will install the following in the DO droplet:

Terraform first runs a plan and then apply, so you will need to enter "yes" when prompted to apply:

Image

once done, you will see a message from terraform indicating succcess:

Image

You will also be able to see the newly created droplet and firewall in the DO control panel:

Image

Image

Then you can ssh into the droplet, switch to a non-root user with sudo, cd into the evilginx2 directory and do the following:

sudo ./evilginx2 -p phishlets/