Az - Enumeration Tools
Tip
Jifunze na fanya mazoezi ya AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Jifunze na fanya mazoezi ya GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Jifunze na fanya mazoezi ya Azure Hacking:
HackTricks Training Azure Red Team Expert (AzRTE)
Support HackTricks
- Angalia mpango wa usajili!
- Jiunge na 💬 kikundi cha Discord au kikundi cha telegram au tufuatilie kwenye Twitter 🐦 @hacktricks_live.
- Shiriki mbinu za hacking kwa kuwasilisha PRs kwa HackTricks na HackTricks Cloud repos za github.
Sakinisha PowerShell kwenye Linux
Tip
Katika linux utahitaji kusakinisha 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
Sakinisha PowerShell kwenye MacOS
Maelekezo kutoka kwenye documentation:
- Sakinisha
brewikiwa haujauwekwa bado:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Sakinisha toleo thabiti la hivi karibuni la PowerShell:
brew install powershell/tap/powershell
- Endesha PowerShell:
pwsh
- Sasisho:
brew update
brew upgrade powershell
Vyombo Vikuu vya Enumeration
az cli
Azure Command-Line Interface (CLI) ni chombo cha kufanya kazi kwa majukwaa mbalimbali kilichoandikwa kwa Python kwa kusimamia na kuendesha rasilimali nyingi za Azure na Entra ID. Inajiunganisha na Azure na inatekeleza amri za utawala kupitia mstari wa amri au scripts.
Follow this link for the installation instructions¡.
Commands in Azure CLI are structured using a pattern of: az <service> <action> <parameters>
Debug | MitM az cli
Using the parameter --debug it’s possible to see all the requests the tool az is sending:
az account management-group list --output table --debug
Ili kufanya MitM kwenye zana na kukagua maombi yote inayotuma kwa mikono, unaweza kufanya:
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
Kurekebisha “CA cert does not include key usage extension”
Kwa nini kosa linatokea
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) Mahitaji ya awali
- 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) Tengeneza Burp CA inayokidhi viwango (PEM + KEY)
Tengeneza faili ya config ya OpenSSL ambayo kwa wazi inaweka extensions za CA:
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
Tengeneza cheti cha CA + private key:
openssl req -x509 -new -nodes \
-days 3650 \
-keyout burp-ca.key \
-out burp-ca.pem \
-config burp-ca.cnf
Ukaguzi wa busara (LAZIMA uone Key Usage):
openssl x509 -in burp-ca.pem -noout -text | egrep -A3 "Basic Constraints|Key Usage"
Inatarajiwa kujumuisha kitu kama:
CA:TRUEKey Usage: ... Certificate Sign, CRL Sign
2) Badilisha kuwa PKCS#12 (muundo wa kuingiza wa Burp)
Burp inahitaji certificate + private key, rahisi zaidi kama PKCS#12:
openssl pkcs12 -export \
-out burp-ca.p12 \
-inkey burp-ca.key \
-in burp-ca.pem \
-name "Burp Custom Root CA"
Utaulizwa kuweka nenosiri la kusafirisha (weka moja; Burp itakuuliza).
3) Ingiza CA ndani ya Burp na anzisha tena Burp
Ndani ya Burp:
- Proxy → Options
- Find Import / export CA certificate
- Click Import CA certificate
- Choose PKCS#12
- Select
burp-ca.p12 - Enter the password
- Restart Burp completely (important)
Kwa nini kuanzisha tena? Burp inaweza kuendelea kutumia CA ya zamani hadi itakapozinduliwa tena.
4) Amini CA mpya kwenye keychain ya mfumo wa macOS
Hii inaruhusu programu za mfumo na TLS stacks nyingi kuamini CA.
sudo security add-trusted-cert \
-d -r trustRoot \
-k /Library/Keychains/System.keychain \
~/burp-ca/burp-ca.pem
(Ikiwa unapendelea GUI: Keychain Access → System → Certificates → import → set “Always Trust”.)
5) Sanidi env vars za proxy
export HTTPS_PROXY="http://127.0.0.1:8080"
export HTTP_PROXY="http://127.0.0.1:8080"
6) Sanidi Requests/Azure CLI ili kuamini Burp CA yako
Azure CLI inatumia Python Requests kwa ndani; weka hizi zote mbili:
export REQUESTS_CA_BUNDLE="$HOME/burp-ca/burp-ca.pem"
export SSL_CERT_FILE="$HOME/burp-ca/burp-ca.pem"
Vidokezo:
REQUESTS_CA_BUNDLEhutumika na Requests.SSL_CERT_FILEhusaidia kwa watumiaji wengine wa TLS na hali za pembezoni.- Kwa kawaida hautahitaji
ADAL_PYTHON_SSL_NO_VERIFY/AZURE_CLI_DISABLE_CONNECTION_VERIFICATIONya zamani mara tu CA itakapokuwa sahihi.
7) Hakikisha Burp kwa kweli inasaini na CA yako mpya (ukaguzi muhimu)
Hii inathibitisha kwamba interception chain yako iko sahihi:
openssl s_client -connect login.microsoftonline.com:443 \
-proxy 127.0.0.1:8080 </dev/null 2>/dev/null \
| openssl x509 -noout -issuer
Mtoaji anayetarajiwa unatakiwa kuwa na jina la CA yako, kwa mfano:
O=Burp Custom CA, CN=Burp Custom Root CA
Ikiwa bado unaona PortSwigger CA, Burp haitumii CA uliyoiingiza → angalia tena uingizaji na anzisha upya.
8) Hakikisha Python Requests zinafanya kazi kupitia Burp
python3 - <<'EOF'
import requests
requests.get("https://login.microsoftonline.com")
print("OK")
EOF
Inatarajiwa: OK
9) Azure CLI jaribio
az account get-access-token --resource=https://management.azure.com/
Ikiwa tayari umeingia, inapaswa kurudisha JSON yenye accessToken.
Az PowerShell
Azure PowerShell ni module yenye cmdlets za kusimamia rasilimali za Azure moja kwa moja kutoka kwenye mstari wa amri wa PowerShell.
Tembelea kiungo hiki kwa maelekezo ya usanikishaji.
Amri katika Azure PowerShell AZ Module zimeundwa kama: <Action>-Az<Service> <parameters>
Debug | MitM Az PowerShell
Kutumia parameter -Debug inawezekana kuona maombi yote ambayo zana inatuma:
Get-AzResourceGroup -Debug
Ili kufanya MitM kwa zana na kuangalia maombi yote inayotumwa kwa mkono, unaweza kuweka vigezo vya mazingira HTTPS_PROXY na HTTP_PROXY kulingana na docs.
Microsoft Graph PowerShell
Microsoft Graph PowerShell ni SDK inayofanya kazi kwenye majukwaa mbalimbali inayowezesha upatikanaji wa Microsoft Graph APIs zote, ikiwa ni pamoja na huduma kama SharePoint, Exchange, na Outlook, kwa kutumia endpoint moja. Inaunga mkono PowerShell 7+, authentication ya kisasa kupitia MSAL, vitambulisho vya nje, na maulizo ya juu. Kwa kuzingatia kanuni ya least privilege, inahakikisha operesheni salama na hupokea sasisho za mara kwa mara ili kuendana na vipengele vipya vya Microsoft Graph API.
Fuata kiungo hiki kwa installation instructions.
Amri katika Microsoft Graph PowerShell zimepangwa kama: <Action>-Mg<Service> <parameters>
Debug Microsoft Graph PowerShell
Kwa kutumia parameter -Debug unaweza kuona maombi yote ambayo zana inayotuma:
Get-MgUser -Debug
AzureAD Powershell
Module ya Azure Active Directory (AD), sasa imepitwa na wakati, ni sehemu ya Azure PowerShell kwa kusimamia rasilimali za Azure AD. Inatoa cmdlets kwa kazi kama kusimamia watumiaji, vikundi, na usajili wa programu katika Entra ID.
Tip
Hii imebadilishwa na Microsoft Graph PowerShell
Fuata kiungo hiki kwa installation instructions.
Vyombo vya Otomatiki vya Recon na Compliance
turbot azure plugins
Turbot pamoja na steampipe na powerpipe huruhusu kukusanya taarifa kutoka Azure na Entra ID, kufanya ukaguzi wa uzingatiaji, na kugundua mipangilio isiyofaa. Moduli za Azure zinazopendekezwa kwa sasa kuendesha ni:
- 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 ni zana ya usalama ya Chanzo Huria kwa ajili ya kutekeleza tathmini za mbinu bora za usalama kwa AWS, Azure, Google Cloud na Kubernetes, ukaguzi, majibu ya matukio, ufuatiliaji wa kuendelea, kuimarisha usalama na maandalizi ya forensics.
Kimsingi inatuwezesha kuendesha mamia ya vipimo dhidi ya mazingira ya Azure kutafuta mipangilio isiyofaa ya usalama na kukusanya matokeo katika json (na fomati nyingine za maandishi) au kuangalia kwenye mtandao.
# 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
Inaruhusu kufanya mapitio ya usanidi wa usalama wa Azure subscriptions na Microsoft Entra ID kiotomatiki.
Ripoti za HTML zimehifadhiwa ndani ya saraka ./monkey-reports ndani ya github repository folder.
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 hukusanya data za usanidi kwa uchunguzi wa mkono na kuonyesha maeneo yenye hatari. Ni chombo cha ukaguzi wa usalama kwa multi-cloud, kinachoruhusu tathmini ya hali ya usalama ya mazingira ya wingu.
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
Ni script ya PowerShell inayokusaidia kuonyesha rasilimali zote na ruhusa ndani ya Management Group na Entra ID tenant na kugundua makosa ya usanidi wa usalama.
Inafanya kazi kwa kutumia Az PowerShell module, hivyo aina yoyote ya uthibitishaji inayoungwa mkono na chombo hiki itaungwa mkono.
import-module Az
.\AzGovVizParallel.ps1 -ManagementGroupId <management-group-id> [-SubscriptionIdWhitelist <subscription-id>]
Vifaa vya Automated Post-Exploitation
ROADRecon
Uorodheshaji wa ROADRecon unatoa taarifa kuhusu usanidi wa Entra ID, kama watumiaji, vikundi, majukumu, sera za upatikanaji za masharti…
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 ni mkusanyaji wa BloodHound kwa Microsoft Entra ID na Azure. Ni binary moja ya Go static kwa Windows/Linux/macOS inayozungumza moja kwa moja na:
- Microsoft Graph (Entra ID directory, M365) na
- Azure Resource Manager (ARM) control plane (subscriptions, resource groups, compute, storage, key vault, app services, AKS, etc.)
Sifa kuu
- Inafanya kazi kutoka mahali popote kwenye internet ya umma dhidi ya tenant APIs (hakuna ufikiaji wa mtandao wa ndani unahitajika)
- Inatoa JSON kwa ajili ya ingestion ya BloodHound CE ili kuonyesha njia za mashambulio kati ya vitambulisho na rasilimali za cloud
- Default User-Agent iliyotambuliwa: azurehound/v2.x.x
Chaguzi za uthibitishaji
- Jina la mtumiaji + nywila: -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 ]
Mifano
# 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
- Kila 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=…
- Base URLs za Cloud environment zinatofautiana kwa Government/China/Germany. Angalia constants/environments.go katika repo.
ARM-heavy objects (less visible in Activity/Resource logs)
- Orodha ifuatayo inalenga kusoma kwa njia ya 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.
- Operesheni hizi za GET/list kwa kawaida hazinaandikwa kwenye Activity Logs; data-plane reads (mfano: *.blob.core.windows.net, *.vault.azure.net) zinaripotiwa kupitia Diagnostic Settings katika ngazi ya resource.
OPSEC and logging notes
- Microsoft Graph Activity Logs hazizimwi kwa default; wezesha na export kwa SIEM ili kupata mwonekano wa Graph calls. Tarajia Graph preflight GET /v1.0/organization yenye UA azurehound/v2.x.x.
- Entra ID non-interactive sign-in logs zinarekodi authentication ya identity platform (login.microsoftonline.com) iliyotumika na AzureHound.
- ARM control-plane read/list operations hazirekodiwi katika Activity Logs; operesheni nyingi za azurehound list dhidi ya resources hazitaonekana hapo. Logging pekee ya data-plane (kupitia Diagnostic Settings) itarekodi reads kwa service endpoints.
- Defender XDR GraphApiAuditEvents (preview) inaweza kufichua Graph calls na token identifiers lakini inaweza kukosa UserAgent na kuwa na retention ndogo.
Tip: Wakati wa kufanya enumeration ili kutafuta privilege paths, toa dump ya users, groups, roles, na role assignments, kisha ingiza (ingest) kwenye BloodHound na tumia prebuilt cypher queries ili kuonyesha Global Administrator/Privileged Role Administrator na transitive escalation kupitia nested groups na 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 inajumuisha functions na scripts ambazo zinaunga mkono Azure Services discovery, weak configuration auditing, na post exploitation actions kama credential dumping. Imekusudiwa kutumika wakati wa penetration tests ambapo Azure inatumika.
Import-Module .\MicroBurst.psm1
Import-Module .\Get-AzureDomainInfo.ps1
Get-AzureDomainInfo -folder MicroBurst -Verbose
PowerZure
PowerZure ilianzishwa kutokana na hitaji la mfumo unaoweza kufanya reconnaissance na exploitation ya Azure, EntraID, na rasilimali zinazohusiana.
Inatumia module ya Az PowerShell, hivyo authentication yoyote inayoungwa mkono na module hii inaungwa mkono na zana hii.
# 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 ni seti ya zana za post-exploitation za kuingiliana na Microsoft Graph API. Inatoa zana mbalimbali za kutekeleza reconnaissance, persistence, na pillaging of data kutoka kwa akaunti ya 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 huunda “attack graph” ya rasilimali katika usajili wa Azure. Inawawezesha red teams na pentesters kuona attack surface na pivot opportunities ndani ya tenant, na inawapa defenders nguvu ya ziada ili kwa haraka kujielekeza na kuipa kipaumbele kazi za incident response.
Kwa bahati mbaya, inaonekana haijatunzwa.
# 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)
Marejeo
- 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
Jifunze na fanya mazoezi ya AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Jifunze na fanya mazoezi ya GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Jifunze na fanya mazoezi ya Azure Hacking:
HackTricks Training Azure Red Team Expert (AzRTE)
Support HackTricks
- Angalia mpango wa usajili!
- Jiunge na 💬 kikundi cha Discord au kikundi cha telegram au tufuatilie kwenye Twitter 🐦 @hacktricks_live.
- Shiriki mbinu za hacking kwa kuwasilisha PRs kwa HackTricks na HackTricks Cloud repos za github.
HackTricks Cloud

