Giter Site home page Giter Site logo

azuregoat's Introduction

AzureGoat : A Damn Vulnerable Azure Infrastructure

1

Compromising an organization's cloud infrastructure is like sitting on a gold mine for attackers. And sometimes, a simple misconfiguration or a vulnerability in web applications, is all an attacker needs to compromise the entire infrastructure. Since the cloud is relatively new, many developers are not fully aware of the threatscape and they end up deploying a vulnerable cloud infrastructure. Microsoft Azure cloud has become the second-largest vendor by market share in the cloud infrastructure providers (as per multiple reports), just behind AWS. There are numerous tools and vulnerable applications available for AWS for the security professional to perform attack/defense practices, but it is not the case with Azure. There are far fewer options available to the community.

AzureGoat is a vulnerable by design infrastructure on Azure featuring the latest released OWASP Top 10 web application security risks (2021) and other misconfiguration based on services such as App Functions, CosmosDB, Storage Accounts, Automation and Identities. AzureGoat mimics real-world infrastructure but with added vulnerabilities. It features multiple escalation paths and is focused on a black-box approach.

AzureGoat uses IaC (Terraform) to deploy the vulnerable cloud infrastructure on the user's Azure account. This gives the user complete control over code, infrastructure, and environment. Using AzureGoat, the user can learn/practice:

  • Cloud Pentesting/Red-teaming
  • Auditing IaC
  • Secure Coding
  • Detection and mitigation

The project is divided into modules and each module is a separate web application, powered by varied tech stacks and development practices.

Presented at

Developed with ❤️ by INE

drawing

Built With

  • Azure
  • React
  • Python 3
  • Terraform

Vulnerabilities

The project is scheduled to encompass all significant vulnerabilities including the OWASP TOP 10 2021, and popular cloud misconfigurations. Currently, the project contains the following vulnerabilities/misconfigurations.

  • XSS
  • SQL Injection
  • Insecure Direct Object reference
  • Server Side Request Forgery on App Function Environment
  • Sensitive Data Exposure and Password Reset
  • Storage Account Misconfigurations
  • Identity Misconfigurations

Getting Started

Prerequisites

  • An Azure Account

Installation

To ease the deployment process the user just needs to clone this repo, login to azure cli then initialize and apply the Terraform file. This workflow will deploy the whole infrastructure and output the hosted application's URL.

Here are the steps to follow:

Step 1. Clone the repo

git clone https://github.com/ine-labs/AzureGoat

Step 2. Login to Azure CLI

az login

And follow the steps to sign in.

Step 3. Create a resource group with the name "azuregoat_app".

Step 4. Use terraform to deploy AzureGoat

terraform init
terraform apply --auto-approve

Modules

Module 1

The first module features a serverless blog application utilizing Azure App Functions, Storage Accounts, CosmosDB, and Azure Automation. It consists of various web application vulnerabilities and facilitates exploitation of misconfigured Azure resources.

Overview of escalation paths for module-1

6

Contributors

Nishant Sharma, Director, Lab Platform, INE [email protected]

Jeswin Mathai, Chief Architect, Lab Platform, INE [email protected]

Rachna Umaraniya, Cloud Developer, INE [email protected]

Sherin Stephen, Software Engineer (Cloud), INE [email protected]

Shantanu Kale, Cloud Developer, INE [email protected]

Sanjeev Mahunta, Software Engineer (Cloud), INE [email protected]

D Yashwanth Babu, Software Engineer (Cloud), INE [email protected]

Solutions

The offensive manuals are available in the attack-manuals directory, and the defensive manuals are available in the defence-manuals directory.

Module 1 Exploitation Videos: https://www.youtube.com/playlist?list=PLcIpBb4raSZGdYHKpqIu5Boc2ziga4oGY

Documentation

For more details refer to the "AzureGoat.pdf" PDF file. This file contains the slide deck used for presentations.

Screenshots

Blog Application HomePage

1

Blog Application Login Portal

2

Blog Application Register Page

3

Blog Application Logged in Dashboard

4

Blog Application User Profile

5

Contribution Guidelines

  • Contributions in the form of code improvements, module updates, feature improvements, and any general suggestions are welcome.
  • Improvements to the functionalities of the current modules are also welcome.
  • The source code for each module can be found in modules/module-<Number>/src this can be used to modify the existing application code.

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Sister Projects

azuregoat's People

Contributors

jeswinmathai avatar mkcn avatar nishantsharmax avatar sherinsteph avatar sskale1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azuregoat's Issues

Deprecated resource: `azurerm_app_service_plan`

Hi there, I am getting this while running terraform init:

Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Warning: Deprecated Resource
│ 
│   with azurerm_app_service_plan.app_service_plan,
│   on main.tf line 152, in resource "azurerm_app_service_plan" "app_service_plan":
│  152: resource "azurerm_app_service_plan" "app_service_plan" {
│ 
│ The `azurerm_app_service_plan` resource has been superseded by the `azurerm_service_plan` resource. Whilst this resource will continue to be available in the 2.x and 3.x releases it is feature-frozen
│ for compatibility purposes, will no longer receive any updates and will be removed in a future major release of the Azure Provider.
│ 
│ (and 2 more similar warnings elsewhere)

Privilege Escalation not possible

I am trying to make 05-Privilege Escalation but my privileges stay "Contributor"

I tried like 5 times and also waited long periods of time but no "Owner" role for me :-(

vm-resource

ac-resource

role-assign

exploit-ps1

commands

Doesnt deploy over cloudshell. Terraform issue.

Hi I tried to deploy the lab on the cloud using cloudshell and i get struck at the same error.

azurerm_storage_blob.app_files_prod["shared/files/.ssh/config.txt"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/illustrations/illustration_login.png"]: Creation complete after 2s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/illustrations/illustration_login.png]
azurerm_storage_blob.app_files_prod["shared/files/.ssh/keys/justin.pub"]: Creation complete after 2s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/shared/files/.ssh/keys/justin.pub]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/products/product_21.jpg"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/avatars/avatar_4.jpg"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/avatars/avatar_3.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/avatars/avatar_3.jpg]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/covers/cover_7.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/covers/cover_7.jpg]
azurerm_storage_blob.app_files_prod["shared/scripts/deploy_node.sh"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/shared/scripts/deploy_node.sh]
azurerm_storage_blob.app_files_prod["shared/scripts/php-deploy.sh"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/shared/scripts/php-deploy.sh]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/products/product_13.jpg"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/icons/ic_flag_de.svg"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/products/product_14.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/products/product_14.jpg]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/avatars/avatar_7.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/avatars/avatar_7.jpg]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/covers/cover_8.jpg"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/media/register.4206b16c0ce018f0307d.jpg"]: Creating...
azurerm_storage_blob.app_files_prod["shared/files/.ssh/config.txt"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/shared/files/.ssh/config.txt]
azurerm_storage_blob.app_files_prod["shared/files/.ssh/keys/sophia.pub"]: Creating...
azurerm_storage_blob.app_files_prod["shared/files/.ssh/keys/mary.pem"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/avatars/avatar_12.jpg"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/avatars/avatar_4.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/avatars/avatar_4.jpg]
azurerm_storage_blob.app_files_prod["images/20220525173359279634.png"]: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/products/product_13.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/products/product_13.jpg]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/products/product_21.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/products/product_21.jpg]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/covers/cover_8.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/covers/cover_8.jpg]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/products/product_18.jpg"]: Creating...
azurerm_storage_blob.config_update_prod: Creating...
azurerm_storage_blob.app_files_prod["webfiles/build/static/icons/ic_flag_de.svg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/icons/ic_flag_de.svg]
azurerm_storage_blob.app_files_prod["webfiles/build/static/media/register.4206b16c0ce018f0307d.jpg"]: Creation complete after 2s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/media/register.4206b16c0ce018f0307d.jpg]
azurerm_storage_blob.app_files_prod["shared/files/.ssh/keys/mary.pem"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/shared/files/.ssh/keys/mary.pem]
azurerm_storage_blob.app_files_prod["shared/files/.ssh/keys/john.pub"]: Creating...
azurerm_storage_blob.app_files_prod["shared/files/.ssh/keys/sophia.pub"]: Creation complete after 2s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/shared/files/.ssh/keys/sophia.pub]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/avatars/avatar_12.jpg"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/avatars/avatar_12.jpg]
azurerm_cosmosdb_account.db: Still creating... [1m50s elapsed]
azurerm_storage_blob.app_files_prod["images/20220525173359279634.png"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/images/20220525173359279634.png]
azurerm_storage_blob.config_update_prod: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/modules/module-1/resources/storage_account/shared/files/.ssh/config.txt]
azurerm_storage_blob.app_files_prod["shared/files/.ssh/keys/john.pub"]: Creation complete after 1s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/shared/files/.ssh/keys/john.pub]
azurerm_storage_blob.app_files_prod["webfiles/build/static/mock-images/products/product_18.jpg"]: Creation complete after 2s [id=https://appazgoat3299488storage.blob.core.windows.net/prod-appazgoat3299488-storage-container/webfiles/build/static/mock-images/products/product_18.jpg]
azurerm_cosmosdb_account.db: Still creating... [2m0s elapsed]
azurerm_cosmosdb_account.db: Still creating... [2m10s elapsed]
azurerm_cosmosdb_account.db: Still creating... [2m20s elapsed]
azurerm_cosmosdb_account.db: Creation complete after 2m22s [id=/subscriptions/44520894-a01e-4f6d-9612-0310dbd2c8d4/resourceGroups/azuregoat_app/providers/Microsoft.DocumentDB/databaseAccounts/ine-cosmos-db-data-3299488]

│ Warning: Deprecated Resource

│ with azurerm_app_service_plan.app_service_plan,
│ on main.tf line 145, in resource "azurerm_app_service_plan" "app_service_plan":
│ 145: resource "azurerm_app_service_plan" "app_service_plan" {

│ The azurerm_app_service_plan resource has been superseded by the azurerm_service_plan resource. Whilst this resource will continue to be available in the 2.x and 3.x
│ releases it is feature-frozen for compatibility purposes, will no longer receive any updates and will be removed in a future major release of the Azure Provider.


│ Error: Provider produced inconsistent result after apply

│ When applying changes to azurerm_app_service_plan.app_service_plan, provider "provider["registry.terraform.io/hashicorp/azurerm"]" produced an unexpected new value: Root
│ resource was present, but now absent.

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent result after apply

│ When applying changes to azurerm_network_security_group.net_sg, provider "provider["registry.terraform.io/hashicorp/azurerm"]" produced an unexpected new value: Root resource
│ was present, but now absent.

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.


│ Error: Provider produced inconsistent result after apply

│ When applying changes to azurerm_public_ip.VM_PublicIP, provider "provider["registry.terraform.io/hashicorp/azurerm"]" produced an unexpected new value: Root resource was
│ present, but now absent.

│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

local-exec provisioner error

Hello! hoping to get some help or insight to this error when deploying the TF scripts. I ran pip3 install --pre azure-cosmos which updated. but still getting this local-exec provisioner error. Am I missing another dependency?
image

For all Mac OSX users

Sed works slighty different on Mac devices.

Change: "sed -i" to "sed -i ''" in the main.tf file

Error Cosmo DB resource: `azurerm_cosmosdb_account`

Hi there, I am getting this while running terraform apply --auto-approve in Azure CloudShell

╷
│ Error: creating Database Account: (Name "ine-cosmos-db-data-15019585" / Resource Group "azuregoat_app"): waiting for the CosmosDB Account "ine-cosmos-db-data-15019585" (Resource Group "azuregoat_app") to finish creating/updating: Code="ServiceUnavailable" Message="Database account creation failed. Operation Id: 39f485cb-8cdd-4a07-a77d-c6a1d3ba0661, Error : Message: {\"code\":\"ServiceUnavailable\",\"message\":\"Sorry, we are currently experiencing high demand in East US region, and cannot fulfill your request at this time Wed, 10 Jul 2024 14:22:24 GMT. To request region access for your subscription, please follow this link https://aka.ms/cosmosdbquota for more details on how to create a region access request.\\r\\nActivityId: e4ddd100-6db7-4089-8eb7-1d014a871087, Microsoft.Azure.Documents.Common/2.14.0\"}, Request URI: /serviceReservation, RequestStats: , SDK: Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0, Microsoft.Azure.Documents.Common/2.14.0"
│ 
│   with azurerm_cosmosdb_account.db,
│   on main.tf line 30, in resource "azurerm_cosmosdb_account" "db":
│   30: resource "azurerm_cosmosdb_account" "db" {
│ 
│ Error: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="SkuNotAvailable" Message="The requested VM size for resource 'Following SKUs have failed for Capacity Restrictions: Standard_B1s' is currently not available in location 'eastus'. Please try another size or deploy to a different location or different zone. See https://aka.ms/azureskunotavailable for details." Target="vmSize"
│ 
│   with azurerm_virtual_machine.dev-vm,
│   on main.tf line 381, in resource "azurerm_virtual_machine" "dev-vm":
│  381: resource "azurerm_virtual_machine" "dev-vm" {

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.