Az - 열거 도구
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>
디버그 | MitM az cli
파라미터 **--debug**를 사용하면 도구 **az**가 전송하는 모든 요청을 볼 수 있습니다:
az account management-group list --output table --debug
도구에 MitM을 수행하고 도구가 보내는 모든 check all the requests를 수동으로 확인하려면 다음을 수행할 수 있습니다:
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
Fixing “CA cert does not include key usage extension”
Why the error happens
When Azure CLI authenticates, it makes HTTPS requests (via MSAL → Requests → OpenSSL). If you’re intercepting TLS with Burp, Burp generates “on the fly” certificates for sites like login.microsoftonline.com and signs them with Burp’s CA.
On newer stacks (Python 3.13 + OpenSSL 3), CA validation is stricter:
- A CA certificate must include Basic Constraints:
CA:TRUEand a Key Usage extension permitting certificate signing (keyCertSign, and typicallycRLSign).
Burp’s default CA (PortSwigger CA) is old and typically lacks the Key Usage extension, so OpenSSL rejects it even if you “trust it”.
That produces errors like:
CA cert does not include key usage extensionCERTIFICATE_VERIFY_FAILEDself-signed certificate in certificate chain
So you must:
- Create a modern CA (with proper Key Usage).
- Make Burp use it to sign intercepted certs.
- Trust that CA in macOS.
- Point Azure CLI / Requests to that CA bundle.
Step-by-step: working configuration
0) Prereqs
- Burp running locally (proxy at
127.0.0.1:8080) - Azure CLI installed (Homebrew)
- You can
sudo(to trust the CA in the system keychain)
1) Create a standards-compliant Burp CA (PEM + KEY)
Create an OpenSSL config file that explicitly sets CA extensions:
mkdir -p ~/burp-ca && cd ~/burp-ca
cat > burp-ca.cnf <<'EOF'
[ req ]
default_bits = 2048
prompt = no
default_md = sha256
distinguished_name = dn
x509_extensions = v3_ca
[ dn ]
C = US
O = Burp Custom CA
CN = Burp Custom Root CA
[ v3_ca ]
basicConstraints = critical,CA:TRUE
keyUsage = critical,keyCertSign,cRLSign
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer
EOF
CA 인증서 + 개인 키 생성:
openssl req -x509 -new -nodes \
-days 3650 \
-keyout burp-ca.key \
-out burp-ca.pem \
-config burp-ca.cnf
정상성 검사(반드시 Key Usage를 확인하세요):
openssl x509 -in burp-ca.pem -noout -text | egrep -A3 "Basic Constraints|Key Usage"
다음과 같은 항목이 포함되어야 합니다:
CA:TRUEKey Usage: ... Certificate Sign, CRL Sign
2) PKCS#12로 변환 (Burp import format)
Burp는 certificate + private key가 필요하며, 가장 쉬운 형식은 PKCS#12입니다:
openssl pkcs12 -export \
-out burp-ca.p12 \
-inkey burp-ca.key \
-in burp-ca.pem \
-name "Burp Custom Root CA"
3) CA를 Burp에 임포트하고 Burp 재시작
Burp에서:
- Proxy → Options
- Import / export CA certificate 항목을 찾기
- Import CA certificate 클릭
- Choose PKCS#12
- Select
burp-ca.p12 - 비밀번호 입력
- Burp를 완전히 재시작 (중요)
왜 재시작하나요? Burp는 재시작할 때까지 이전 CA를 계속 사용할 수 있습니다.
4) macOS 시스템 키체인에서 새 CA 신뢰
이 작업으로 시스템 앱과 많은 TLS 스택이 해당 CA를 신뢰하게 됩니다.
sudo security add-trusted-cert \
-d -r trustRoot \
-k /Library/Keychains/System.keychain \
~/burp-ca/burp-ca.pem
(만약 GUI를 선호한다면: Keychain Access → System → Certificates → import → “Always Trust”로 설정하세요.)
5) 프록시 환경 변수 구성
export HTTPS_PROXY="http://127.0.0.1:8080"
export HTTP_PROXY="http://127.0.0.1:8080"
6) Requests/Azure CLI가 Burp CA를 신뢰하도록 구성
Azure CLI는 내부적으로 Python Requests를 사용합니다; 둘 다 설정하세요:
export REQUESTS_CA_BUNDLE="$HOME/burp-ca/burp-ca.pem"
export SSL_CERT_FILE="$HOME/burp-ca/burp-ca.pem"
참고:
REQUESTS_CA_BUNDLE은 Requests에서 사용됩니다.SSL_CERT_FILE는 다른 TLS 클라이언트와 특수한 경우에 도움이 됩니다.- CA가 올바르면 일반적으로 이전의
ADAL_PYTHON_SSL_NO_VERIFY/AZURE_CLI_DISABLE_CONNECTION_VERIFICATION는 필요하지 않습니다.
7) Burp가 실제로 새로운 CA로 서명하고 있는지 확인하기 (중요 확인)
이것으로 인터셉션 체인이 올바른지 확인합니다:
openssl s_client -connect login.microsoftonline.com:443 \
-proxy 127.0.0.1:8080 </dev/null 2>/dev/null \
| openssl x509 -noout -issuer
예상 발급자(issuer)에는 귀하의 CA 이름이 포함되어야 합니다. 예:
O=Burp Custom CA, CN=Burp Custom Root CA
여전히 PortSwigger CA가 보이면, Burp가 가져온 CA를 사용하고 있지 않습니다 → 가져오기를 다시 확인하고 재시작하세요.
8) Python Requests가 Burp를 통해 작동하는지 확인
python3 - <<'EOF'
import requests
requests.get("https://login.microsoftonline.com")
print("OK")
EOF
예상: OK
9) Azure CLI 테스트
az account get-access-token --resource=https://management.azure.com/
이미 로그인되어 있으면 accessToken을 포함한 JSON을 반환해야 합니다.
Az PowerShell
Azure PowerShell은 PowerShell 명령줄에서 Azure 리소스를 직접 관리하기 위한 cmdlets가 포함된 모듈입니다.
설치 지침은 다음 링크를 참고하세요: installation instructions.
Azure PowerShell AZ Module의 명령은 다음과 같이 구성됩니다: <Action>-Az<Service> <parameters>
Debug | MitM Az PowerShell
파라미터 **-Debug**를 사용하면 도구가 전송하는 모든 요청을 볼 수 있습니다:
Get-AzResourceGroup -Debug
도구에 대해 MitM를 수행하고 전송하는 모든 요청을 수동으로 확인하려면 환경 변수 HTTPS_PROXY 및 HTTP_PROXY를 docs에 따라 설정할 수 있습니다.
Microsoft Graph PowerShell
Microsoft Graph PowerShell은 단일 엔드포인트를 사용해 SharePoint, Exchange, Outlook 같은 서비스를 포함한 모든 Microsoft Graph API에 접근할 수 있게 하는 크로스-플랫폼 SDK입니다. PowerShell 7+를 지원하며, MSAL을 통한 현대적 인증, 외부 identities, 고급 쿼리를 지원합니다. 최소 권한 접근을 중시하여 안전한 운영을 보장하고 최신 Microsoft Graph API 기능에 맞춰 정기적으로 업데이트됩니다.
Follow this link for the installation instructions.
Microsoft Graph PowerShell의 명령은 다음과 같은 형식입니다: <Action>-Mg<Service> <parameters>
Debug Microsoft Graph PowerShell
파라미터 **-Debug**를 사용하면 도구가 전송하는 모든 요청을 확인할 수 있습니다:
Get-MgUser -Debug
AzureAD Powershell
Azure Active Directory (AD) 모듈은 현재 사용 중단됨 상태이며, Azure AD 리소스 관리를 위한 Azure PowerShell의 일부입니다. 이 모듈은 Entra ID에서 사용자, 그룹 및 애플리케이션 등록 관리를 비롯한 작업을 수행하기 위한 cmdlets를 제공합니다.
Tip
이는 Microsoft Graph PowerShell로 대체되었습니다
설치 지침은 다음 링크를 참조하세요: installation instructions.
자동화된 Recon 및 Compliance 도구
turbot azure plugins
Turbot은 steampipe 및 powerpipe와 함께 Azure 및 Entra ID에서 정보를 수집하고 컴플라이언스 검사 및 잘못된 구성(misconfigurations)을 찾아냅니다. 현재 권장되는 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 구독 및 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
이것은 powershell 스크립트로, Management Group 및 Entra ID 테넌트 내부의 모든 리소스와 권한을 시각화하고 보안 구성 오류를 찾아줍니다.
Az PowerShell module을 사용하여 작동하므로 이 도구에서 지원하는 모든 인증 방식이 그대로 사용 가능합니다.
import-module Az
.\AzGovVizParallel.ps1 -ManagementGroupId <management-group-id> [-SubscriptionIdWhitelist <subscription-id>]
자동화된 Post-Exploitation 도구
ROADRecon
ROADRecon의 enumeration은 Entra ID의 구성(예: users, groups, roles, conditional access policies)에 대한 정보를 제공합니다…
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 수집기입니다. Windows/Linux/macOS용 단일 정적 Go 바이너리로, 다음과 직접 통신합니다:
- Microsoft Graph (Entra ID directory, M365) and
- Azure Resource Manager (ARM) control plane (subscriptions, resource groups, compute, storage, key vault, app services, AKS, etc.)
Key traits
- 퍼블릭 인터넷 어디에서나 테넌트 API를 대상으로 실행 (내부 네트워크 접근 불필요)
- 아이덴티티와 클라우드 리소스 전반의 공격 경로를 시각화하기 위해 BloodHound CE가 수집할 수 있는 JSON을 출력
- 관찰된 기본 User-Agent: azurehound/v2.x.x
Authentication options
- 사용자 이름 + 비밀번호: -u
-p - 리프레시 토큰: –refresh-token
- JSON Web Token (access token): –jwt
- 서비스 프린시펄 시크릿: -a
-s - 서비스 프린시펄 인증서: -a
–cert <cert.pem> –key <key.pem> [–keypass ]
Examples
# 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
쿼리 대상
- Graph endpoints (예시):
- /v1.0/organization, /v1.0/users, /v1.0/groups, /v1.0/roleManagement/directory/roleDefinitions, directoryRoles, owners/members
- ARM endpoints (예시):
- management.azure.com/subscriptions/…/providers/Microsoft.Storage/storageAccounts
- …/Microsoft.KeyVault/vaults, …/Microsoft.Compute/virtualMachines, …/Microsoft.Web/sites, …/Microsoft.ContainerService/managedClusters
사전 검사(preflight) 동작 및 엔드포인트
- 각 azurehound list
- Identity 플랫폼: login.microsoftonline.com
- Graph: GET https://graph.microsoft.com/v1.0/organization
- ARM: GET https://management.azure.com/subscriptions?api-version=…
- Cloud 환경의 기본 URL은 Government/China/Germany에 따라 다릅니다. 레포의 constants/environments.go를 참조하세요.
ARM-중심 객체 (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 및 로깅 관련 주의사항
- Microsoft Graph Activity Logs는 기본적으로 활성화되어 있지 않습니다; Graph 호출의 가시성을 얻으려면 활성화 후 SIEM으로 내보내세요. 프리플라이트 Graph 호출은 GET /v1.0/organization이며 UA는 azurehound/v2.x.x로 예상됩니다.
- Entra ID의 non-interactive sign-in 로그는 AzureHound가 사용한 identity 플랫폼 인증(login.microsoftonline.com)을 기록합니다.
- ARM control-plane의 read/list 작업은 Activity Logs에 기록되지 않습니다; 리소스에 대한 많은 azurehound list 작업이 Activity Logs에 나타나지 않을 것입니다. 서비스 엔드포인트에 대한 읽기는 오직 데이터-플레인 로깅(예: Diagnostic Settings)을 통해 캡처됩니다.
- Defender XDR의 GraphApiAuditEvents(미리보기)는 Graph 호출 및 토큰 식별자를 노출할 수 있으나 UserAgent가 없거나 보존 기간이 제한적일 수 있습니다.
팁: 권한 경로를 열거할 때는 사용자, 그룹, 역할 및 역할 할당을 덤프한 다음 BloodHound에 로드하고, 사전 구성된 cypher 쿼리를 사용해 Global Administrator/Privileged Role Administrator 및 중첩 그룹과 RBAC 할당을 통한 전이적 권한 상승(transitive escalation)을 찾아보세요.
BloodHound 웹을 curl -L https://ghst.ly/getbhce | docker compose -f - up 명령으로 실행한 후 output.json 파일을 가져오세요. 그런 다음 EXPLORE 탭의 CYPHER 섹션에서 사전 구성된 쿼리를 포함한 폴더 아이콘을 볼 수 있습니다.
MicroBurst
MicroBurst는 Azure Services discovery, weak configuration auditing, 그리고 credential dumping과 같은 post exploitation 작업을 지원하는 함수와 스크립트를 포함합니다. 이는 Azure가 사용되는 penetration tests 중에 사용되도록 설계되었습니다.
Import-Module .\MicroBurst.psm1
Import-Module .\Get-AzureDomainInfo.ps1
Get-AzureDomainInfo -folder MicroBurst -Verbose
PowerZure
PowerZure는 Azure, EntraID 및 관련 리소스에 대한 reconnaissance 및 exploitation을 모두 수행할 수 있는 프레임워크의 필요성에서 만들어졌습니다.
이 도구는 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 of data를 수행하기 위한 다양한 도구를 제공합니다.
#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 구독의 리소스에 대한 “attack graph”를 생성합니다. 이는 red teams와 pentesters가 tenant 내에서 attack surface와 pivot 기회를 시각화할 수 있게 해주며, 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)
참고자료
- AzureHound을 이용한 클라우드 발견 (Unit 42)
- AzureHound 저장소
- BloodHound 저장소
- AzureHound Community Edition 플래그
- 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

