Skip to content

TerraformGoat is HXSecurity research lab's "Vulnerable by Design" multi cloud deployment tool.

License

Notifications You must be signed in to change notification settings

HXSecurity/TerraformGoat

Repository files navigation

🌟 Terraform Goat

License: Apache-2.0 GitHub release Github Stars PRs Welcome tweet

English | 中文

TerraformGoat is HuoCorp research lab's "Vulnerable by Design" multi cloud deployment tool.

Currently supported cloud vendors include Alibaba Cloud, Tencent Cloud, Huawei Cloud, Amazon Web Services, Google Cloud Platform, Microsoft Azure.

🎯 Scenarios

ID Cloud Service Company Types Of Cloud Services Vulnerable Environment
1 Tencent Cloud Object Storage Bucket Object Traversal
2 Tencent Cloud Object Storage Unrestricted File Upload
3 Tencent Cloud Elastic Computing Service CVM SSRF
4 Alibaba Cloud Object Storage Bucket Object Traversal
5 Alibaba Cloud Object Storage Object ACL Writable
6 Alibaba Cloud Object Storage Special Bucket Policy
7 Alibaba Cloud Object Storage Unrestricted File Upload
8 Alibaba Cloud Elastic Computing Service ECS SSRF
9 Huawei Cloud Object Storage Object ACL Writable
10 Huawei Cloud Object Storage Special Bucket Policy
11 Huawei Cloud Object Storage Unrestricted File Upload
12 Huawei Cloud Object Storage Bucket Object Traversal
13 Huawei Cloud Elastic Computing Service ECS SSRF
14 Amazon Web Services Object Storage Bucket Object Traversal
15 Amazon Web Services Object Storage Special Bucket Policy
16 Amazon Web Services Object Storage Unrestricted File Upload
17 Amazon Web Services Object Storage Object ACL Writable
18 Amazon Web Services Elastic Computing Service EC2 SSRF
19 Google Cloud Platform Object Storage Bucket Object Traversal
20 Google Cloud Platform Object Storage Object ACL Writable
21 Google Cloud Platform Object Storage Bucket ACL Writable
22 Google Cloud Platform Object Storage Unrestricted File Upload
23 Google Cloud Platform Elastic Computing Service VM Command Execution
24 Microsoft Azure Object Storage Blob Public Access
25 Microsoft Azure Elastic Computing Service VM Command Execution

💫 Install

TerraformGoat is built using Dockerfile, so you need to install the Docker environment first. For the Docker installation method, please refer to: https://docs.docker.com/get-docker/

git clone https://github.com/HuoCorp/TerraformGoat.git
cd TerraformGoat
docker build -t terraformgoat:v0.0.2 .

img

After docker build is complete, start and enter the container

docker run -itd --name terraformgoat terraformgoat:v0.0.2
docker exec -it terraformgoat /bin/bash

When entering the container, you need to select the cloud service to run

img

After selecting the cloud service you want to use, the relevant dependencies will be installed. After the relevant dependencies are installed, you can use TerraformGoat.

Using the build of the Alibaba Cloud ECS SSRF vulnerability scenario as a demo:

asciicast

🚀 Uninstall

docker stop terraformgoat
docker rm terraformgoat
docker rmi terraformgoat:v0.0.2

⚠️ Notice

  1. The README of each vulnerable environment is executed within the TerraformGoat container environment, so the TerraformGoat container environment needs to be deployed first.
  2. Due to the horizontal risk of intranet horizontal on the cloud in some scenarios, it is strongly recommended that users use their own test accounts to configure the scenarios, avoid using the cloud account of the production environment, and install TerraformGoat using Dockerfile to isolate the user's local cloud vendor token and the test account token.
  3. TerraformGoat is used for educational purposes only, It is not allowed to use it for illegal and criminal purposes, any consequences arising from TerraformGoat are the responsibility of the person using it, and not the HuoCorp organization.

🎊 Contributing

Contributions are welcomed and greatly appreciated. Further reading — CONTRIBUTING.md for details on contribution workflow.

🪪 License

TerraformGoat is under the Apache 2.0 license. See the LICENSE file for details.