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** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें, PRs को HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में सबमिट करके।
PowerShell को Linux में इंस्टॉल करें
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
Main Enumeration Tools
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 करने और यह मैन्युअली भेज रहा सभी 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
“CA cert does not include key usage extension” को ठीक करना
यह त्रुटि क्यों होती है
जब Azure CLI प्रमाणीकृत होता है, तो यह HTTPS अनुरोध बनाता है (via MSAL → Requests → OpenSSL)। अगर आप TLS को Burp के साथ इंटरसेप्ट कर रहे हैं, तो Burp login.microsoftonline.com जैसे साइट्स के लिए “on the fly” प्रमाणपत्र जेनरेट करता है और उन्हें Burp की CA से साइन करता है।
नए स्टैक्स पर (Python 3.13 + OpenSSL 3), CA वेलिडेशन अधिक कड़ा है:
- एक CA प्रमाणपत्र में Basic Constraints:
CA:TRUEऔर प्रमाणपत्र साइन करने की अनुमति देने वाला Key Usage एक्सटेंशन होना चाहिए (keyCertSign, और आमतौर परcRLSign)।
Burp की डिफ़ॉल्ट CA (PortSwigger CA) पुरानी है और आमतौर पर Key Usage एक्सटेंशन से परे रहती है, इसलिए OpenSSL इसे तब भी अस्वीकार कर देता है जब आप उसे “trust” करते हैं।
इसके परिणामस्वरूप ऐसी त्रुटियाँ आती हैं:
CA cert does not include key usage extensionCERTIFICATE_VERIFY_FAILEDself-signed certificate in certificate chain
इसलिए आपको:
- एक आधुनिक CA बनानी होगी (सही Key Usage के साथ)।
- Burp को इसे intercepted certs साइन करने के लिए उपयोग करवाना होगा।
- उस CA को macOS में ट्रस्ट करना होगा।
- Azure CLI / Requests को उस CA बंडल की ओर पॉइंट करना होगा।
चरण-दर-चरण: कार्यरत कॉन्फ़िगरेशन
0) पूर्वापेक्षाएँ
- लोकल पर Burp चल रहा हो (proxy at
127.0.0.1:8080) - Azure CLI इंस्टॉल किया हुआ हो (Homebrew)
- आपके पास
sudoकी पहुँच हो (system keychain में CA को ट्रस्ट करने के लिए)
1) एक मानक-अनुरूप Burp CA बनाएं (PEM + KEY)
एक OpenSSL config फ़ाइल बनाएं जो स्पष्ट रूप से 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
CA certificate + private key जेनरेट करें:
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"
Expected to include something like:
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"
आपसे एक निर्यात पासवर्ड पूछा जाएगा (एक सेट करें; Burp यह पूछेगा)।
3) CA को Burp में इम्पोर्ट करें और Burp को रीस्टार्ट करें
Burp में:
- Proxy → Options
- Find Import / export CA certificate
- Click Import CA certificate
- Choose PKCS#12
- Select
burp-ca.p12 - पासवर्ड दर्ज करें
- Burp को पूरी तरह से रीस्टार्ट करें (महत्वपूर्ण)
क्यों रीस्टार्ट करें? Burp रीस्टार्ट तक पुरानी CA का उपयोग करती रह सकती है।
4) macOS system keychain में नए CA को ट्रस्ट करें
यह सिस्टम ऐप्स और कई TLS stacks को 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 → set “Always Trust”.)
5) प्रॉक्सी के env vars कॉन्फ़िगर करें
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"
Notes:
REQUESTS_CA_BUNDLEका उपयोग Requests द्वारा किया जाता है।SSL_CERT_FILEअन्य TLS consumers और edge cases के लिए सहायक होता है।- आम तौर पर आपको पुराने
ADAL_PYTHON_SSL_NO_VERIFY/AZURE_CLI_DISABLE_CONNECTION_VERIFICATIONकी आवश्यकता नहीं होती जब तक CA सही न हो।
7) सुनिश्चित करें कि Burp वास्तव में आपके नए CA के साथ साइन कर रहा है (महत्वपूर्ण जाँच)
यह पुष्टि करता है कि आपकी interception chain सही है:
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 आपका imported CA उपयोग नहीं कर रहा है → import की जाँच करें और पुनरारंभ करें।
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 एक मॉड्यूल है जिसमें cmdlets होते हैं जो PowerShell कमांड लाइन से सीधे Azure resources को प्रबंधित करने के लिए होते हैं।
इंस्टॉलेशन निर्देशों के लिए इस लिंक को देखें: installation instructions.
Azure PowerShell AZ Module में कमांड्स इस प्रकार संरचित होते हैं: <Action>-Az<Service> <parameters>
Debug | MitM Az PowerShell
-Debug parameter का उपयोग करके आप टूल द्वारा भेजे जा रहे सभी अनुरोध देख सकते हैं:
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 एक क्रॉस‑प्लेटफ़ॉर्म SDK है जो एकल endpoint का उपयोग करके SharePoint, Exchange, और Outlook जैसी सेवाओं सहित सभी Microsoft Graph APIs तक पहुँच प्रदान करता है। यह PowerShell 7+ का समर्थन करता है, MSAL के माध्यम से आधुनिक प्रमाणीकरण, external identities और advanced queries का समर्थन करता है। न्यूनतम विशेषाधिकार (least privilege) पहुंच पर ध्यान केंद्रित करते हुए यह सुरक्षित संचालन सुनिश्चित करता है और नवीनतम 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
पैरामीटर -Debug का उपयोग करके आप टूल द्वारा भेजे जा रहे सभी अनुरोधों को देख सकते हैं:
Get-MgUser -Debug
AzureAD Powershell
Azure Active Directory (AD) मॉड्यूल, अब अप्रचलित, Azure PowerShell का हिस्सा है जो Azure AD resources के प्रबंधन के लिए है। यह users, groups और application registrations को Entra ID में प्रबंधित करने जैसे कार्यों के लिए cmdlets प्रदान करता है।
Tip
यह Microsoft Graph PowerShell से बदल दिया गया है
Follow this link for the स्थापना निर्देश.
स्वचालित Recon और Compliance टूल्स
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 एक Open Source सुरक्षा टूल है जो AWS, Azure, Google Cloud और Kubernetes के लिए security best practices के आकलन, audits, incident response, continuous monitoring, hardening और forensics readiness करने के लिए उपयोग किया जाता है।
यह मूल रूप से हमें Azure environment के खिलाफ सैकड़ों checks चलाकर security misconfigurations खोजने और परिणामों को 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 मैन्युअल निरीक्षण के लिए कॉन्फ़िगरेशन डेटा इकट्ठा करता है और जोखिम वाले क्षेत्रों को उजागर करता है। यह एक multi-cloud security-auditing टूल है, जो cloud environments की security posture का आकलन करने में सक्षम बनाता है।
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 का उपयोग करके काम करती है, इसलिए जो भी authentication Az PowerShell module द्वारा समर्थित है, वह इस tool द्वारा भी समर्थित है।
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 के लिए एक single static Go binary है जो सीधे निम्नलिखित से संपर्क करता है:
- Microsoft Graph (Entra ID directory, M365) और
- Azure Resource Manager (ARM) control plane (subscriptions, resource groups, compute, storage, key vault, app services, AKS, etc.)
मुख्य विशेषताएँ
- सार्वजनिक इंटरनेट से कहीं से भी tenant APIs के खिलाफ चलाया जा सकता है (कोई internal network access आवश्यक नहीं)
- BloodHound CE ingest के लिए JSON आउटपुट करता है ताकि identities और cloud resources के across attack paths को visualize किया जा सके
- डिफ़ॉल्ट User-Agent देखा गया: azurehound/v2.x.x
प्रमाणीकरण विकल्प
- उपयोगकर्ता नाम + पासवर्ड: -u
-p - रीफ़्रेश टोकन: –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
- Each 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=…
- Cloud environment base URLs differ for Government/China/Germany. See constants/environments.go in the 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 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 और उनसे जुड़े संसाधनों के reconnaissance और exploitation दोनों करने में सक्षम एक फ्रेमवर्क की आवश्यकता के चलते बनाया गया था।
यह Az PowerShell मॉड्यूल का उपयोग करता है, इसलिए इस मॉड्यूल द्वारा समर्थित कोई भी authentication इस टूल द्वारा भी समर्थित है।
# 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 और data 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 में मौजूद resources का “attack graph” बनाता है। यह red teams और pentesters को tenant के भीतर attack surface और pivot opportunities को visualize करने में सक्षम बनाता है, और आपके 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** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें, PRs को HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में सबमिट करके।
HackTricks Cloud

