Az - Enumeration Tools
Tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 Discord 그룹 또는 텔레그램 그룹에 참여하거나 Twitter 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
Linux에서 PowerShell 설치
Tip
linux에서는 PowerShell Core를 설치해야 합니다:
sudo apt-get update
sudo apt-get install -y wget apt-transport-https software-properties-common
# Ubuntu 20.04
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
# Update repos
sudo apt-get update
sudo add-apt-repository universe
# Install & start powershell
sudo apt-get install -y powershell
pwsh
# Az cli
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
MacOS에 PowerShell 설치
다음은 documentation:
brew가 아직 설치되어 있지 않다면 설치하세요:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- PowerShell의 최신 안정 버전을 설치하세요:
brew install powershell/tap/powershell
- PowerShell 실행:
pwsh
- 업데이트:
brew update
brew upgrade powershell
주요 열거 도구
az cli
Azure Command-Line Interface (CLI)은 Python으로 작성된 크로스 플랫폼 도구로, (대부분의) Azure 및 Entra ID 리소스를 관리·운영하기 위해 사용됩니다. 명령줄 또는 스크립트를 통해 Azure에 연결하여 관리 명령을 실행합니다.
설치 지침은 다음 링크를 참고하세요: installation instructions¡.
Azure CLI의 명령은 다음 패턴을 따릅니다: az <service> <action> <parameters>
Debug | MitM az cli
파라미터 **--debug**를 사용하면 도구 **az**가 전송하는 모든 요청을 확인할 수 있습니다:
az account management-group list --output table --debug
도구에 대해 MitM을 수행하고 수동으로 전송되는 모든 요청을 확인하려면 다음을 수행할 수 있습니다:
export ADAL_PYTHON_SSL_NO_VERIFY=1
export AZURE_CLI_DISABLE_CONNECTION_VERIFICATION=1
export HTTPS_PROXY="http://127.0.0.1:8080"
export HTTP_PROXY="http://127.0.0.1:8080"
# If this is not enough
# Download the certificate from Burp and convert it into .pem format
# And export the following env variable
openssl x509 -in ~/Downloads/cacert.der -inform DER -out ~/Downloads/cacert.pem -outform PEM
export REQUESTS_CA_BUNDLE=/Users/user/Downloads/cacert.pem
Az PowerShell
Azure PowerShell은 PowerShell 명령줄에서 Azure 리소스를 직접 관리하기 위한 cmdlet들을 제공하는 모듈입니다.
자세한 내용은 설치 지침을 참고하세요.
Azure PowerShell AZ Module의 명령은 다음과 같은 형식입니다: <Action>-Az<Service> <parameters>
Debug | MitM Az PowerShell
파라미터 **-Debug**를 사용하면 도구가 전송하는 모든 요청을 확인할 수 있습니다:
Get-AzResourceGroup -Debug
툴에 대해 MitM을 수행하고 수동으로 전송되는 모든 요청을 확인하려면 docs에 따라 환경 변수 HTTPS_PROXY와 HTTP_PROXY를 설정할 수 있습니다.
Microsoft Graph PowerShell
Microsoft Graph PowerShell는 단일 엔드포인트를 통해 SharePoint, Exchange, Outlook 같은 서비스를 포함한 모든 Microsoft Graph APIs에 접근할 수 있게 해주는 크로스-플랫폼 SDK입니다. PowerShell 7+를 지원하며 MSAL을 통한 최신 인증, 외부 아이덴티티 및 고급 쿼리를 지원합니다. 최소 권한 원칙(least privilege access)에 중점을 두어 안전한 운영을 보장하며, 최신 Microsoft Graph API 기능에 맞춰 정기적으로 업데이트됩니다.
자세한 내용은 installation instructions를 참고하세요.
Microsoft Graph PowerShell의 명령은 다음과 같은 구조를 가집니다: <Action>-Mg<Service> <parameters>
Microsoft Graph PowerShell 디버깅
파라미터 **-Debug**를 사용하면 툴이 전송하는 모든 요청을 확인할 수 있습니다:
Get-MgUser -Debug
AzureAD Powershell
Azure Active Directory (AD) 모듈은 현재 더 이상 권장되지 않음 상태이며, Azure AD 리소스를 관리하기 위한 Azure PowerShell의 일부입니다. 이 모듈은 Entra ID에서 사용자, 그룹 및 애플리케이션 등록과 같은 작업을 수행하기 위한 cmdlet을 제공합니다.
Tip
이는 Microsoft Graph PowerShell로 대체되었습니다
Follow this link for the installation instructions.
자동화된 Recon 및 규정 준수 도구
turbot azure plugins
Turbot는 steampipe 및 powerpipe와 함께 Azure 및 Entra ID에서 정보를 수집하고 규정 준수 검사를 수행하며 잘못된 구성을 찾을 수 있게 해줍니다. 현재 실행을 권장하는 Azure 모듈은 다음과 같습니다:
- https://github.com/turbot/steampipe-mod-azure-compliance
- https://github.com/turbot/steampipe-mod-azure-insights
- https://github.com/turbot/steampipe-mod-azuread-insights
# Install
brew install turbot/tap/powerpipe
brew install turbot/tap/steampipe
steampipe plugin install azure
steampipe plugin install azuread
# Config creds via env vars or az cli default creds will be used
export AZURE_ENVIRONMENT="AZUREPUBLICCLOUD"
export AZURE_TENANT_ID="<tenant-id>"
export AZURE_SUBSCRIPTION_ID="<subscription-id>"
export AZURE_CLIENT_ID="<client-id>"
export AZURE_CLIENT_SECRET="<secret>"
# Run steampipe-mod-azure-insights
cd /tmp
mkdir dashboards
cd dashboards
powerpipe mod init
powerpipe mod install github.com/turbot/steampipe-mod-azure-insights
steampipe service start
powerpipe server
# Go to http://localhost:9033 in a browser
Prowler
Prowler는 AWS, Azure, Google Cloud 및 Kubernetes의 보안 모범 사례 평가, 감사, 사고 대응, 지속적 모니터링, 하드닝 및 포렌식 준비태세를 수행하기 위한 오픈 소스 보안 도구입니다.
기본적으로 Azure 환경에 대해 수백 개의 검사를 실행하여 보안 구성 오류를 찾아내고 결과를 json(및 기타 텍스트 형식)으로 수집하거나 웹에서 확인할 수 있습니다.
# Create a application with Reader role and set the tenant ID, client ID and secret in prowler so it access the app
# Launch web with docker-compose
export DOCKER_DEFAULT_PLATFORM=linux/amd64
curl -LO https://raw.githubusercontent.com/prowler-cloud/prowler/refs/heads/master/docker-compose.yml
curl -LO https://raw.githubusercontent.com/prowler-cloud/prowler/refs/heads/master/.env
## If using an old docker-compose version, change the "env_file" params to: env_file: ".env"
docker compose up -d
# Access the web and configure the access to run a scan from it
# Prowler cli
python3 -m pip install prowler --break-system-packages
docker run --rm toniblyx/prowler:v4-latest azure --list-checks
docker run --rm toniblyx/prowler:v4-latest azure --list-services
docker run --rm toniblyx/prowler:v4-latest azure --list-compliance
docker run --rm -e "AZURE_CLIENT_ID=<client-id>" -e "AZURE_TENANT_ID=<tenant-id>" -e "AZURE_CLIENT_SECRET=<secret>" toniblyx/prowler:v4-latest azure --sp-env-auth
## It also support other authentication types, check: prowler azure --help
Monkey365
Azure subscriptions와 Microsoft Entra ID의 보안 구성 검토를 자동으로 수행합니다.
HTML 보고서는 github 리포지토리 폴더의 ./monkey-reports 디렉토리에 저장됩니다.
git clone https://github.com/silverhack/monkey365
Get-ChildItem -Recurse monkey365 | Unblock-File
cd monkey365
Import-Module ./monkey365
mkdir /tmp/monkey365-scan
cd /tmp/monkey365-scan
Get-Help Invoke-Monkey365
Get-Help Invoke-Monkey365 -Detailed
# Scan with user creds (browser will be run)
Invoke-Monkey365 -TenantId <tenant-id> -Instance Azure -Collect All -ExportTo HTML
# Scan with App creds
$SecureClientSecret = ConvertTo-SecureString "<secret>" -AsPlainText -Force
Invoke-Monkey365 -TenantId <tenant-id> -ClientId <client-id> -ClientSecret $SecureClientSecret -Instance Azure -Collect All -ExportTo HTML
ScoutSuite
Scout Suite는 수동 검사용 구성 데이터를 수집하고 위험 영역을 강조합니다. 멀티클라우드 보안 감사 도구로서 클라우드 환경의 보안 태세 평가를 가능하게 합니다.
virtualenv -p python3 venv
source venv/bin/activate
pip install scoutsuite
scout --help
# Use --cli flag to use az cli credentials
# Use --user-account to have scout prompt for user credentials
# Use --user-account-browser to launch a browser to login
# Use --service-principal to have scout prompt for app credentials
python scout.py azure --cli
Azure-MG-Sub-Governance-Reporting
이것은 Management Group과 Entra ID 테넌트 내부의 모든 리소스와 권한을 시각화 하고 보안 구성 오류를 찾아주는 powershell 스크립트입니다.
Az PowerShell 모듈을 사용하므로 Az PowerShell에서 지원하는 모든 인증 방식이 이 도구에서도 지원됩니다.
import-module Az
.\AzGovVizParallel.ps1 -ManagementGroupId <management-group-id> [-SubscriptionIdWhitelist <subscription-id>]
자동화된 Post-Exploitation 도구
ROADRecon
ROADRecon의 enumeration은 Entra ID의 구성(예: 사용자, 그룹, 역할, 조건부 액세스 정책 등)에 대한 정보를 제공합니다…
cd ROADTools
pipenv shell
# Login with user creds
roadrecon auth -u test@corp.onmicrosoft.com -p "Welcome2022!"
# Login with app creds
roadrecon auth --as-app --client "<client-id>" --password "<secret>" --tenant "<tenant-id>"
roadrecon gather
roadrecon gui
AzureHound
AzureHound는 Microsoft Entra ID 및 Azure용 BloodHound collector입니다. Windows/Linux/macOS용 단일 정적 Go 바이너리로 다음과 직접 통신합니다:
- Microsoft Graph (Entra ID directory, M365) 및
- Azure Resource Manager (ARM) 컨트롤 플레인(구독, 리소스 그룹, 컴퓨트, 스토리지, Key Vault, 앱 서비스, AKS 등)
주요 특징
- 퍼블릭 인터넷 어디에서나 테넌트 API에 대해 실행(내부 네트워크 접근 불필요)
- BloodHound CE에 수집을 위해 JSON을 출력하여 아이덴티티 및 클라우드 리소스 전반의 공격 경로를 시각화
- 기본 User-Agent 관찰됨: azurehound/v2.x.x
인증 옵션
- 사용자 이름 + 비밀번호: -u
-p - Refresh token: –refresh-token
- JSON Web Token (access token): –jwt
- Service principal secret: -a
-s - Service principal certificate: -a
–cert <cert.pem> –key <key.pem> [–keypass ]
예시
# Full tenant collection to file using different auth flows
## User creds
azurehound list -u "<user>@<tenant>" -p "<pass>" -t "<tenant-id|domain>" -o ./output.json
## Use an access token (JWT) from az cli for Graph
JWT=$(az account get-access-token --resource https://graph.microsoft.com -o tsv --query accessToken)
azurehound list --jwt "$JWT" -t "<tenant-id>" -o ./output.json
## Use a refresh token (e.g., from device code flow)
azurehound list --refresh-token "<refresh_token>" -t "<tenant-id>" -o ./output.json
## Service principal secret
azurehound list -a "<client-id>" -s "<secret>" -t "<tenant-id>" -o ./output.json
## Service principal certificate
azurehound list -a "<client-id>" --cert "/path/cert.pem" --key "/path/key.pem" -t "<tenant-id>" -o ./output.json
# Targeted discovery
azurehound list users -t "<tenant-id>" -o users.json
azurehound list groups -t "<tenant-id>" -o groups.json
azurehound list roles -t "<tenant-id>" -o roles.json
azurehound list role-assignments -t "<tenant-id>" -o role-assignments.json
# Azure resources via ARM
azurehound list subscriptions -t "<tenant-id>" -o subs.json
azurehound list resource-groups -t "<tenant-id>" -o rgs.json
azurehound list virtual-machines -t "<tenant-id>" -o vms.json
azurehound list key-vaults -t "<tenant-id>" -o kv.json
azurehound list storage-accounts -t "<tenant-id>" -o sa.json
azurehound list storage-containers -t "<tenant-id>" -o containers.json
azurehound list web-apps -t "<tenant-id>" -o webapps.json
azurehound list function-apps -t "<tenant-id>" -o funcapps.json
What gets queried
- Graph endpoints (examples):
- /v1.0/organization, /v1.0/users, /v1.0/groups, /v1.0/roleManagement/directory/roleDefinitions, directoryRoles, owners/members
- ARM endpoints (examples):
- management.azure.com/subscriptions/…/providers/Microsoft.Storage/storageAccounts
- …/Microsoft.KeyVault/vaults, …/Microsoft.Compute/virtualMachines, …/Microsoft.Web/sites, …/Microsoft.ContainerService/managedClusters
Preflight behavior and endpoints
- 각 azurehound list
- Identity platform: login.microsoftonline.com
- Graph: GET https://graph.microsoft.com/v1.0/organization
- ARM: GET https://management.azure.com/subscriptions?api-version=…
- Government/China/Germany용 클라우드 환경의 기본 URL은 다릅니다. 자세한 내용은 repo의 constants/environments.go를 참조하세요.
ARM-heavy objects (less visible in Activity/Resource logs)
- 다음 대상 목록은 주로 ARM control plane 읽기 작업을 사용합니다: automation-accounts, container-registries, function-apps, key-vaults, logic-apps, managed-clusters, management-groups, resource-groups, storage-accounts, storage-containers, virtual-machines, vm-scale-sets, web-apps.
- 이러한 GET/list 작업은 일반적으로 Activity Logs에 기록되지 않습니다; 데이터 플레인 읽기(예: *.blob.core.windows.net, *.vault.azure.net)는 리소스 수준의 Diagnostic Settings에서 처리됩니다.
OPSEC and logging notes
- Microsoft Graph Activity Logs는 기본적으로 활성화되어 있지 않습니다; 가시성을 얻으려면 활성화하고 SIEM으로 내보내세요. Graph preflight GET /v1.0/organization은 UA azurehound/v2.x.x로 기록됩니다.
- Entra ID non-interactive sign-in 로그는 AzureHound가 사용한 identity platform auth (login.microsoftonline.com)를 기록합니다.
- ARM control-plane read/list 작업은 Activity Logs에 기록되지 않습니다; 많은 azurehound list 작업이 Activity Logs에 표시되지 않을 것입니다. 서비스 엔드포인트에 대한 읽기는 데이터 플레인 로깅(Diagnostic Settings)을 통해 캡처됩니다.
- Defender XDR GraphApiAuditEvents (preview)는 Graph 호출 및 토큰 식별자를 노출할 수 있지만 UserAgent가 없을 수 있고 보존 기간이 제한적일 수 있습니다.
Tip: 권한 경로를 열거할 때는 users, groups, roles 및 role assignments를 덤프한 다음 BloodHound에 가져와 미리 만들어진 cypher 쿼리를 사용하여 Global Administrator/Privileged Role Administrator 및 중첩 그룹과 RBAC 할당을 통한 전이적 권한 상승을 도출하세요.
Launch the BloodHound web with curl -L https://ghst.ly/getbhce | docker compose -f - up and import the output.json file. Then, in the EXPLORE tab, in the CYPHER section you can see a folder icon that contains pre-built queries.
MicroBurst
MicroBurst includes functions and scripts that support Azure Services discovery, weak configuration auditing, and post exploitation actions such as credential dumping. It is intended to be used during penetration tests where Azure is in use.
Import-Module .\MicroBurst.psm1
Import-Module .\Get-AzureDomainInfo.ps1
Get-AzureDomainInfo -folder MicroBurst -Verbose
PowerZure
PowerZure는 Azure, EntraID 및 관련 리소스에 대한 정찰과 익스플로잇을 모두 수행할 수 있는 프레임워크가 필요해서 만들어졌습니다.
이 도구는 Az PowerShell 모듈을 사용하므로 이 모듈이 지원하는 모든 인증 방식이 그대로 지원됩니다.
# Login
Import-Module Az
Connect-AzAccount
# Clone and import PowerZure
git clone https://github.com/hausec/PowerZure
cd PowerZure
ipmo ./Powerzure.psd1
Invoke-Powerzure -h # Check all the options
# Info Gathering (read)
Get-AzureCurrentUser # Get current user
Get-AzureTarget # What can you access to
Get-AzureUser -All # Get all users
Get-AzureSQLDB -All # Get all SQL DBs
Get-AzureAppOwner # Owners of apps in Entra
Show-AzureStorageContent -All # List containers, shared and tables
Show-AzureKeyVaultContent -All # List all contents in key vaults
# Operational (write)
Set-AzureUserPassword -Password <password> -Username <username> # Change password
Set-AzureElevatedPrivileges # Get permissions from Global Administrator in EntraID to User Access Administrator in Azure RBAC.
New-AzureBackdoor -Username <username> -Password <password>
Invoke-AzureRunCommand -Command <command> -VMName <vmname>
[...]
GraphRunner
GraphRunner는 Microsoft Graph API와 상호작용하기 위한 post-exploitation 도구 모음입니다. 이는 Microsoft Entra ID (Azure AD) 계정에서 데이터에 대한 reconnaissance, persistence 및 pillaging을 수행하기 위한 다양한 도구를 제공합니다.
#A good place to start is to authenticate with the Get-GraphTokens module. This module will launch a device-code login, allowing you to authenticate the session from a browser session. Access and refresh tokens will be written to the global $tokens variable. To use them with other GraphRunner modules use the Tokens flag (Example. Invoke-DumpApps -Tokens $tokens)
Import-Module .\GraphRunner.ps1
Get-GraphTokens
#This module gathers information about the tenant including the primary contact info, directory sync settings, and user settings such as if users have the ability to create apps, create groups, or consent to apps.
Invoke-GraphRecon -Tokens $tokens -PermissionEnum
#A module to dump conditional access policies from a tenant.
Invoke-GraphRecon -Tokens $tokens -PermissionEnum
#A module to dump conditional access policies from a tenant.
Invoke-DumpCAPS -Tokens $tokens -ResolveGuids
#This module helps identify malicious app registrations. It will dump a list of Azure app registrations from the tenant including permission scopes and users that have consented to the apps. Additionally, it will list external apps that are not owned by the current tenant or by Microsoft's main app tenant. This is a good way to find third-party external apps that users may have consented to.
Invoke-DumpApps -Tokens $tokens
#Gather the full list of users from the directory.
Get-AzureADUsers -Tokens $tokens -OutFile users.txt
#Create a list of security groups along with their members.
Get-SecurityGroups -AccessToken $tokens.access_token
#Gets groups that may be able to be modified by the current user
Get-UpdatableGroups -Tokens $tokens
#Finds dynamic groups and displays membership rules
Get-DynamicGroups -Tokens $tokens
#Gets a list of SharePoint site URLs visible to the current user
Get-SharePointSiteURLs -Tokens $tokens
#This module attempts to locate mailboxes in a tenant that have allowed other users to read them. By providing a userlist the module will attempt to access the inbox of each user and display if it was successful. The access token needs to be scoped to Mail.Read.Shared or Mail.ReadWrite.Shared for this to work.
Invoke-GraphOpenInboxFinder -Tokens $tokens -Userlist users.txt
#This module attempts to gather a tenant ID associated with a domain.
Get-TenantID -Domain
#Runs Invoke-GraphRecon, Get-AzureADUsers, Get-SecurityGroups, Invoke-DumpCAPS, Invoke-DumpApps, and then uses the default_detectors.json file to search with Invoke-SearchMailbox, Invoke-SearchSharePointAndOneDrive, and Invoke-SearchTeams.
Invoke-GraphRunner -Tokens $tokens
Stormspotter
Stormspotter는 Azure subscription의 리소스에 대한 “attack graph”를 생성합니다. 이는 red teams와 pentesters가 tenant 내의 attack surface와 pivot opportunities를 시각화할 수 있게 해주며, defenders가 incident response 작업의 방향을 빠르게 잡고 우선순위를 정하는 것을 대폭 지원합니다.
불행히도 유지보수가 되지 않는 것으로 보입니다.
# Start Backend
cd stormspotter\backend\
pipenv shell
python ssbackend.pyz
# Start Front-end
cd stormspotter\frontend\dist\spa\
quasar.cmd serve -p 9091 --history
# Run Stormcollector
cd stormspotter\stormcollector\
pipenv shell
az login -u test@corp.onmicrosoft.com -p Welcome2022!
python stormspotter\stormcollector\sscollector.pyz cli
# This will generate a .zip file to upload in the frontend (127.0.0.1:9091)
참조
- Cloud Discovery With AzureHound (Unit 42)
- AzureHound repository
- BloodHound repository
- AzureHound Community Edition Flags
- AzureHound constants/environments.go
- AzureHound client/storage_accounts.go
- AzureHound client/roles.go
Tip
AWS 해킹 배우기 및 연습하기:
HackTricks Training AWS Red Team Expert (ARTE)
GCP 해킹 배우기 및 연습하기:HackTricks Training GCP Red Team Expert (GRTE)
Azure 해킹 배우기 및 연습하기:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks 지원하기
- 구독 계획 확인하기!
- **💬 Discord 그룹 또는 텔레그램 그룹에 참여하거나 Twitter 🐦 @hacktricks_live를 팔로우하세요.
- HackTricks 및 HackTricks Cloud 깃허브 리포지토리에 PR을 제출하여 해킹 트릭을 공유하세요.
HackTricks Cloud

