Skip to content

Latest commit

 

History

History
119 lines (79 loc) · 3.07 KB

install_with_azure.md

File metadata and controls

119 lines (79 loc) · 3.07 KB

Azure setup

terraform icon_azure icon_ansible

Architecture

Warning LLMNR, NBTNS and other poisoning network attacks will not work in azure environment. Only network coerce attacks will work.

Prerequisites

Azure configuration

You need to login to Azure with the CLI.

az login

Automatic installation

# check prerequisites
./goad.sh -t check -l GOAD -p azure
# Install
./goad.sh -t install -l GOAD -p azure

azure check

Manual installation

Build the infrastructure with Terraform.

  1. Initialize Terraform
cd terraform
terraform init
  1. Generate the terraform plan with the password
cd ad/GOAD/providers/azure/terraform
terraform plan -out tfplan

Note: The plan is useful to check if the terraform configuration is correct

  1. Apply the terraform plan
terraform apply tfplan

Note: The terraform apply command will take a few minutes to complete

At the end of the terraform apply, the output will show the public ip of the Ubuntu VM. This VM will be used to run the ansible playbook to provision the Windows VM.

Windows VM provisionning with Ansible

  1. Rsync source on Ubuntu VM
cd ../../../../../ # to the repository root folder
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
rsync -a --exclude-from='.gitignore' -e "ssh -i $CURRENT_DIR/ad/GOAD/providers/azure/ssh_keys/ubuntu-jumpbox.pem" "$CURRENT_DIR/" goad@$public_ip:~/GOAD/
  1. Run the setup.sh script to install Ansible and download GOAD on the Ubuntu VM
ssh -i ad/GOAD/providers/azure/ssh_keys/ubuntu-jumpbox.pem goad@<ubuntu-jumpbox-ip> 'bash -s' < scripts/setup_azure.sh

Note: To get the public ip of the Ubuntu VM, you can run terraform output in the terraform directory

  1. Connect to the Ubuntu VM
ssh -i ssh_keys/ubuntu-jumpbox.pem goad@<ubuntu-jumpbox-ip>
  1. Run the playbook to provision the Windows VM
cd ansible
export ANSIBLE_COMMAND="ansible-playbook -i ../ad/GOAD/data/inventory -i ../ad/GOAD/providers/azure/inventory"
../scripts/provisionning.sh

Tips

  • To connect to the Windows VM, you can use proxychains and xfreerdp through the Ubuntu VM
ssh -i ssh_keys/ubuntu-jumpbox.pem goad@<ubuntu_public_ip> -D 1080
proxychains xfreerdp /u:goadmin /p:<password> /v:<windows_private_ip> +clipboard /dynamic-resolution /cert-ignore

Note: The password is the one generated at step 2 of the terraform section

  • If the command terraform destroy fails, you can delete the resource group using the CLI
az group delete --name GOAD