Az - Narzędzia do enumeracji
Tip
Ucz się & ćwicz AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Ucz się & ćwicz GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Ucz się & ćwicz Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Wspieraj HackTricks
- Sprawdź subscription plans!
- Dołącz do 💬 Discord group lub telegram group lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Podziel się hacking tricks, zgłaszając PRy do HackTricks i HackTricks Cloud github repos.
Instalacja PowerShell w systemie linux
Tip
W systemie linux będziesz musiał zainstalować 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
Zainstaluj PowerShell w MacOS
Instrukcje z documentation:
- Zainstaluj
brew, jeśli jeszcze nie jest zainstalowany:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Zainstaluj najnowsze stabilne wydanie PowerShell:
brew install powershell/tap/powershell
- Uruchom PowerShell:
pwsh
- Aktualizacja:
brew update
brew upgrade powershell
Główne narzędzia do enumeracji
az cli
Azure Command-Line Interface (CLI) jest narzędziem wieloplatformowym napisanym w Pythonie do zarządzania i administrowania (większością) zasobów Azure i Entra ID. Łączy się z Azure i wykonuje polecenia administracyjne przez wiersz poleceń lub skrypty.
Follow this link for the installation instructions¡.
Polecenia w Azure CLI są zorganizowane według wzorca: az <service> <action> <parameters>
Debugowanie | MitM az cli
Używając parametru --debug, można zobaczyć wszystkie żądania, które narzędzie az wysyła:
az account management-group list --output table --debug
Aby przeprowadzić MitM wobec narzędzia i ręcznie sprawdzić wszystkie wysyłane przez nie żądania, możesz zrobić:
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
Naprawa “CA cert does not include key usage extension”
Dlaczego pojawia się błąd
Gdy Azure CLI się uwierzytelnia, wykonuje żądania HTTPS (przez MSAL → Requests → OpenSSL). Jeśli przechwytujesz TLS za pomocą Burp, Burp generuje „w locie” certyfikaty dla serwisów takich jak login.microsoftonline.com i podpisuje je za pomocą CA Burp.
Na nowszych stosach (Python 3.13 + OpenSSL 3) walidacja CA jest surowsza:
- Certyfikat CA musi zawierać Basic Constraints:
CA:TRUEoraz rozszerzenie Key Usage pozwalające na podpisywanie certyfikatów (keyCertSign, i zwyklecRLSign).
Domyślne CA Burp (PortSwigger CA) jest przestarzałe i zazwyczaj nie ma rozszerzenia Key Usage, więc OpenSSL odrzuca je nawet jeśli je „ufasz”.
To powoduje błędy takie jak:
CA cert does not include key usage extensionCERTIFICATE_VERIFY_FAILEDself-signed certificate in certificate chain
Więc musisz:
- Utworzyć nowoczesne CA (z poprawnym Key Usage).
- Sprawić, by Burp używał go do podpisywania przechwytywanych certyfikatów.
- Zaufać temu CA w macOS.
- Wskazać Azure CLI / Requests na ten bundel CA.
Krok po kroku: działająca konfiguracja
0) Wymagania wstępne
- Burp uruchomiony lokalnie (proxy na
127.0.0.1:8080) - Azure CLI zainstalowany (Homebrew)
- Masz dostęp do
sudo(by zaufać CA w systemowym pęku kluczy)
1) Utwórz zgodne ze standardami CA dla Burp (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
Wygeneruj certyfikat CA + klucz prywatny:
openssl req -x509 -new -nodes \
-days 3650 \
-keyout burp-ca.key \
-out burp-ca.pem \
-config burp-ca.cnf
Sprawdzenie poprawności (MUSISZ zobaczyć Key Usage):
openssl x509 -in burp-ca.pem -noout -text | egrep -A3 "Basic Constraints|Key Usage"
Powinno zawierać coś w stylu:
CA:TRUEKey Usage: ... Certificate Sign, CRL Sign
2) Konwersja do PKCS#12 (format importu dla Burp)
Burp potrzebuje certificate + private key, najprościej jako PKCS#12:
openssl pkcs12 -export \
-out burp-ca.p12 \
-inkey burp-ca.key \
-in burp-ca.pem \
-name "Burp Custom Root CA"
Zostaniesz poproszony o hasło eksportu (ustaw je; Burp o nie poprosi).
3) Zaimportuj CA do Burp i uruchom Burp ponownie
W Burp:
- Proxy → Opcje
- Znajdź Import / export certyfikatu CA
- Kliknij Importuj certyfikat CA
- Wybierz PKCS#12
- Wskaż
burp-ca.p12 - Wprowadź hasło
- Uruchom Burp całkowicie ponownie (ważne)
Dlaczego restart? Burp może nadal używać starego CA aż do ponownego uruchomienia.
4) Zaufaj nowemu CA w macOS systemowym pęku kluczy
To pozwoli aplikacjom systemowym i wielu stosom TLS zaufać CA.
sudo security add-trusted-cert \
-d -r trustRoot \
-k /Library/Keychains/System.keychain \
~/burp-ca/burp-ca.pem
(Jeśli wolisz GUI: Keychain Access → System → Certificates → import → set “Always Trust”.)
5) Skonfiguruj zmienne środowiskowe proxy
export HTTPS_PROXY="http://127.0.0.1:8080"
export HTTP_PROXY="http://127.0.0.1:8080"
6) Skonfiguruj Requests/Azure CLI, aby ufały twojemu Burp CA
Azure CLI używa wewnętrznie Python Requests; ustaw oba z nich:
export REQUESTS_CA_BUNDLE="$HOME/burp-ca/burp-ca.pem"
export SSL_CERT_FILE="$HOME/burp-ca/burp-ca.pem"
Notatki:
REQUESTS_CA_BUNDLEjest używany przez Requests.SSL_CERT_FILEpomaga innym klientom TLS i w przypadkach brzegowych.- Zazwyczaj nie potrzebujesz już starych
ADAL_PYTHON_SSL_NO_VERIFY/AZURE_CLI_DISABLE_CONNECTION_VERIFICATION, gdy CA jest poprawny.
7) Zweryfikuj, że Burp rzeczywiście podpisuje certyfikaty twoim nowym CA (krytyczna kontrola)
To potwierdza, że twój łańcuch przechwytywania jest poprawny:
openssl s_client -connect login.microsoftonline.com:443 \
-proxy 127.0.0.1:8080 </dev/null 2>/dev/null \
| openssl x509 -noout -issuer
Oczekiwany wystawca (issuer) zawiera nazwę twojego CA, np.:
O=Burp Custom CA, CN=Burp Custom Root CA
Jeśli nadal widzisz PortSwigger CA, Burp nie używa zaimportowanego CA → sprawdź import i uruchom ponownie.
8) Zweryfikuj, czy Python Requests działa przez Burp
python3 - <<'EOF'
import requests
requests.get("https://login.microsoftonline.com")
print("OK")
EOF
Oczekiwane: OK
9) Test Azure CLI
az account get-access-token --resource=https://management.azure.com/
Jeśli jesteś już zalogowany, powinno zwrócić JSON z accessToken.
Az PowerShell
Azure PowerShell to moduł z cmdletami do zarządzania zasobami Azure bezpośrednio z wiersza poleceń PowerShell.
Follow this link for the installation instructions.
Polecenia w Azure PowerShell AZ Module mają strukturę: <Action>-Az<Service> <parameters>
Debug | MitM Az PowerShell
Używając parametru -Debug można zobaczyć wszystkie żądania wysyłane przez narzędzie:
Get-AzResourceGroup -Debug
In order to do a MitM to the tool and check all the requests it’s sending manually you can set the env variables HTTPS_PROXY and HTTP_PROXY according to the docs.
Microsoft Graph PowerShell
Microsoft Graph PowerShell to wieloplatformowe SDK, które umożliwia dostęp do wszystkich Microsoft Graph APIs, w tym usług takich jak SharePoint, Exchange i Outlook, wykorzystując pojedynczy endpoint. Wspiera PowerShell 7+, nowoczesną autentykację za pomocą MSAL, tożsamości zewnętrzne oraz zaawansowane zapytania. Skupiając się na zasadzie najmniejszych uprawnień, zapewnia bezpieczne operacje i otrzymuje regularne aktualizacje, aby być zgodnym z najnowszymi funkcjami Microsoft Graph API.
Follow this link for the installation instructions.
Commands in Microsoft Graph PowerShell are structured like: <Action>-Mg<Service> <parameters>
Debug Microsoft Graph PowerShell
Używając parametru -Debug można zobaczyć wszystkie żądania, które narzędzie wysyła:
Get-MgUser -Debug
AzureAD Powershell
Moduł Azure Active Directory (AD), obecnie deprecated, jest częścią Azure PowerShell służącą do zarządzania zasobami Azure AD. Udostępnia cmdlety do zadań takich jak zarządzanie użytkownikami, grupami i rejestracjami aplikacji w Entra ID.
Tip
Zostało to zastąpione przez Microsoft Graph PowerShell
Kliknij ten link, aby przejść do installation instructions.
Zautomatyzowany rekonesans i narzędzia do zgodności
turbot azure plugins
Turbot wraz ze steampipe i powerpipe umożliwia zbieranie informacji z Azure i Entra ID oraz przeprowadzanie kontroli zgodności i wykrywanie błędnych konfiguracji. Obecnie najbardziej zalecane moduły Azure do uruchomienia to:
- 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 to narzędzie bezpieczeństwa open source służące do przeprowadzania ocen zgodności z najlepszymi praktykami bezpieczeństwa, audytów, reagowania na incydenty, ciągłego monitoringu, hardeningu oraz przygotowania do forensics w środowiskach AWS, Azure, Google Cloud i Kubernetes.
Umożliwia uruchomienie setek testów przeciwko środowisku Azure w celu wykrycia nieprawidłowych konfiguracji bezpieczeństwa oraz zebrania wyników w formacie json (i innych formatach tekstowych) albo przeglądania ich przez interfejs webowy.
# 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
Pozwala na automatyczne przeprowadzanie przeglądów konfiguracji bezpieczeństwa subskrypcji Azure i Microsoft Entra ID.
Raporty HTML są przechowywane w katalogu ./monkey-reports w folderze repozytorium github.
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 zbiera dane konfiguracyjne do ręcznej inspekcji i wyróżnia obszary ryzyka. To narzędzie do audytu bezpieczeństwa dla środowisk multi-cloud, umożliwiające ocenę stanu bezpieczeństwa tych środowisk.
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
To skrypt powershell, który pomaga Ci zwizualizować wszystkie zasoby i uprawnienia w ramach Management Group i tenantu Entra ID oraz wykryć nieprawidłowe konfiguracje bezpieczeństwa.
Działa przy użyciu Az PowerShell module, więc każde uwierzytelnianie obsługiwane przez to narzędzie jest obsługiwane.
import-module Az
.\AzGovVizParallel.ps1 -ManagementGroupId <management-group-id> [-SubscriptionIdWhitelist <subscription-id>]
Zautomatyzowane narzędzia Post-Exploitation
ROADRecon
Enumeration narzędzia ROADRecon oferuje informacje o konfiguracji Entra ID, takie jak użytkownicy, grupy, role, polityki warunkowego dostępu…
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 jest kolektorem BloodHound dla Microsoft Entra ID i Azure. Jest to pojedynczy statyczny plik binarny w Go dla Windows/Linux/macOS, który łączy się bezpośrednio z:
- Microsoft Graph (katalog Entra ID, M365) oraz
- Azure Resource Manager (ARM) control plane (subskrypcje, grupy zasobów, compute, storage, Key Vault, App Services, AKS, itd.)
Główne cechy
- Działa z dowolnego miejsca w publicznym internecie wobec tenant API (nie wymaga dostępu do sieci wewnętrznej)
- Generuje JSON do importu przez BloodHound CE, umożliwiając wizualizację ścieżek ataku między tożsamościami a zasobami w chmurze
- Domyślny User-Agent zaobserwowany: azurehound/v2.x.x
Opcje uwierzytelniania
- Nazwa użytkownika + hasło: -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 ]
Przykłady
# 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
Co jest zapytywane
- Graph endpoints (przykłady):
- /v1.0/organization, /v1.0/users, /v1.0/groups, /v1.0/roleManagement/directory/roleDefinitions, directoryRoles, owners/members
- ARM endpoints (przykłady):
- management.azure.com/subscriptions/…/providers/Microsoft.Storage/storageAccounts
- …/Microsoft.KeyVault/vaults, …/Microsoft.Compute/virtualMachines, …/Microsoft.Web/sites, …/Microsoft.ContainerService/managedClusters
Preflight behavior and endpoints
- Każda komenda azurehound list
- Platforma tożsamości: login.microsoftonline.com
- Graph: GET https://graph.microsoft.com/v1.0/organization
- ARM: GET https://management.azure.com/subscriptions?api-version=…
- Podstawowe URL-e środowiska cloud różnią się dla Government/China/Germany. Zobacz constants/environments.go w repo.
ARM-heavy objects (less visible in Activity/Resource logs)
- The following list targets predominantly use ARM control plane reads: 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.
- These GET/list operations are typically not written to Activity Logs; data-plane reads (e.g., *.blob.core.windows.net, *.vault.azure.net) are covered by Diagnostic Settings at the resource level.
OPSEC and logging notes
- Microsoft Graph Activity Logs are not enabled by default; enable and export to SIEM to gain visibility of Graph calls. Expect the Graph preflight GET /v1.0/organization with UA azurehound/v2.x.x.
- Entra ID non-interactive sign-in logs record the identity platform auth (login.microsoftonline.com) used by AzureHound.
- ARM control-plane read/list operations are not recorded in Activity Logs; many azurehound list operations against resources won’t appear there. Only data-plane logging (via Diagnostic Settings) will capture reads to service endpoints.
- Defender XDR GraphApiAuditEvents (preview) can expose Graph calls and token identifiers but may lack UserAgent and have limited retention.
Tip: When enumerating for privilege paths, dump users, groups, roles, and role assignments, then ingest in BloodHound and use prebuilt cypher queries to surface Global Administrator/Privileged Role Administrator and transitive escalation via nested groups and RBAC assignments.
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 zawiera funkcje i skrypty wspierające Azure Services discovery, audyt słabej konfiguracji oraz post exploitation działania, takie jak credential dumping. Jest przeznaczony do użycia podczas penetration tests, w których używany jest Azure.
Import-Module .\MicroBurst.psm1
Import-Module .\Get-AzureDomainInfo.ps1
Get-AzureDomainInfo -folder MicroBurst -Verbose
PowerZure
PowerZure powstał z potrzeby frameworka, który potrafi zarówno wykonywać reconnaissance, jak i exploitation Azure, EntraID oraz powiązanych z nimi zasobów.
Używa modułu Az PowerShell, więc każde uwierzytelnienie obsługiwane przez ten moduł jest obsługiwane przez narzędzie.
# 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 jest zestawem narzędzi post-exploitation umożliwiającym interakcję z Microsoft Graph API. Zapewnia różne narzędzia do przeprowadzania reconnaissance, persistence oraz pozyskiwania danych z konta Microsoft Entra ID (Azure AD).
#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 tworzy „attack graph” zasobów w subskrypcji Azure. Umożliwia red teams i pentesters wizualizację attack surface oraz pivot opportunities w obrębie tenant i znacznie przyspiesza pracę obrońców, pozwalając im szybko się zorientować i priorytetyzować zadania związane z incident response.
Niestety wygląda na nieutrzymywane.
# 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)
Referencje
- Odkrywanie chmury za pomocą AzureHound (Unit 42)
- Repozytorium AzureHound
- Repozytorium BloodHound
- Flagi AzureHound Community Edition
- AzureHound constants/environments.go
- AzureHound client/storage_accounts.go
- AzureHound client/roles.go
Tip
Ucz się & ćwicz AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Ucz się & ćwicz GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Ucz się & ćwicz Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Wspieraj HackTricks
- Sprawdź subscription plans!
- Dołącz do 💬 Discord group lub telegram group lub śledź nas na Twitterze 🐦 @hacktricks_live.
- Podziel się hacking tricks, zgłaszając PRy do HackTricks i HackTricks Cloud github repos.
HackTricks Cloud

