Skip to content

Commit fbc88db

Browse files
authored
Merge pull request #227 from HackTricks-wiki/update_Cloud_Discovery_With_AzureHound_20251025_011739
Cloud Discovery With AzureHound
2 parents a41bcbc + 6e9d109 commit fbc88db

File tree

6 files changed

+106
-11
lines changed

6 files changed

+106
-11
lines changed

src/SUMMARY.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,11 @@
283283
- [AWS - Lambda Steal Requests](pentesting-cloud/aws-security/aws-post-exploitation/aws-lambda-post-exploitation/aws-warm-lambda-persistence.md)
284284
- [AWS - Lambda VPC Egress Bypass](pentesting-cloud/aws-security/aws-post-exploitation/aws-lambda-post-exploitation/aws-lambda-vpc-egress-bypass.md)
285285
- [AWS - Lightsail Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-lightsail-post-exploitation/README.md)
286+
- [AWS - MWAA Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-mwaa-post-exploitation/README.md)
286287
- [AWS - Organizations Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-organizations-post-exploitation/README.md)
287288
- [AWS - RDS Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-rds-post-exploitation/README.md)
288289
- [AWS - SageMaker Post-Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-sagemaker-post-exploitation/README.md)
290+
- [Feature Store Poisoning](pentesting-cloud/aws-security/aws-post-exploitation/aws-sagemaker-post-exploitation/feature-store-poisoning.md)
289291
- [AWS - S3 Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-s3-post-exploitation/README.md)
290292
- [AWS - Secrets Manager Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-secrets-manager-post-exploitation/README.md)
291293
- [AWS - SES Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-ses-post-exploitation/README.md)
@@ -296,6 +298,7 @@
296298
- [AWS - SQS Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-sqs-post-exploitation/README.md)
297299
- [AWS – SQS DLQ Redrive Exfiltration via StartMessageMoveTask](pentesting-cloud/aws-security/aws-post-exploitation/aws-sqs-post-exploitation/aws-sqs-dlq-redrive-exfiltration.md)
298300
- [AWS – SQS Cross-/Same-Account Injection via SNS Subscription + Queue Policy](pentesting-cloud/aws-security/aws-post-exploitation/aws-sqs-post-exploitation/aws-sqs-sns-injection.md)
301+
- [Aws SQS Dlq Redrive Exfiltration](pentesting-cloud/aws-security/aws-post-exploitation/aws-sqs-post-exploitation/aws-sqs-dlq-redrive-exfiltration.md)
299302
- [AWS - SSO & identitystore Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-sso-and-identitystore-post-exploitation/README.md)
300303
- [AWS - Step Functions Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-stepfunctions-post-exploitation/README.md)
301304
- [AWS - STS Post Exploitation](pentesting-cloud/aws-security/aws-post-exploitation/aws-sts-post-exploitation/README.md)
@@ -577,5 +580,4 @@
577580
- [HackTricks Pentesting Network$$external:https://book.hacktricks.wiki/en/generic-methodologies-and-resources/pentesting-network/index.html$$]()
578581
- [HackTricks Pentesting Services$$external:https://book.hacktricks.wiki/en/network-services-pentesting/pentesting-ssh.html$$]()
579582

580-
- [Feature Store Poisoning](pentesting-cloud/aws-security/aws-post-exploitation/aws-sagemaker-post-exploitation/feature-store-poisoning.md)
581-
- [Aws Sqs Dlq Redrive Exfiltration](pentesting-cloud/aws-security/aws-post-exploitation/aws-sqs-dlq-redrive-exfiltration.md)
583+

src/pentesting-cloud/aws-security/aws-post-exploitation/aws-bedrock-post-exploitation/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# AWS - Bedrock Post Exploitation
22

3-
{{#include ../../../banners/hacktricks-training.md}}
3+
{{#include ../../../../banners/hacktricks-training.md}}
44

55

66
## AWS - Bedrock Agents Memory Poisoning (Indirect Prompt Injection)
@@ -90,4 +90,4 @@ Notes:
9090
- [Track agent’s step-by-step reasoning process using trace – Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/trace-events.html)
9191
- [Amazon Bedrock Guardrails](https://aws.amazon.com/bedrock/guardrails/)
9292

93-
{{#include ../../../banners/hacktricks-training.md}}
93+
{{#include ../../../../banners/hacktricks-training.md}}

src/pentesting-cloud/aws-security/aws-post-exploitation/aws-mwaa-post-exploitation/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# AWS MWAA Execution Role Account Wildcard Vulnerability
22

3+
{{#include ../../../../banners/hacktricks-training.md}}
4+
35
## The Vulnerability
46

57
MWAA's execution role (the IAM role that Airflow workers use to access AWS resources) requires this mandatory policy to function:
@@ -44,3 +46,4 @@ All attacks bypass network controls since they use AWS APIs, not direct internet
4446
This is an architectural flaw in MWAA with no IAM-based mitigation. Every MWAA deployment following AWS documentation has this vulnerability.
4547

4648
**Network Control Bypass:** These attacks work even in private VPCs with no internet access. The SQS API calls use AWS's internal network and VPC endpoints, completely bypassing traditional network security controls, firewalls, and egress monitoring. Organizations cannot detect or block this data exfiltration path through network-level controls.
49+
{{#include ../../../../banners/hacktricks-training.md}}

src/pentesting-cloud/aws-security/aws-post-exploitation/aws-sagemaker-post-exploitation/feature-store-poisoning.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ echo "Feature Group ready: $FG"
158158
## References
159159
- [AWS SageMaker Feature Store Documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/feature-store.html)
160160
- [Feature Store Security Best Practices](https://docs.aws.amazon.com/sagemaker/latest/dg/feature-store-security.html)
161+
{{#include ../../../../banners/hacktricks-training.md}}

src/pentesting-cloud/azure-security/az-enumeration-tools.md

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,85 @@ roadrecon gui
302302

303303
### [**AzureHound**](https://github.com/BloodHoundAD/AzureHound)
304304

305+
AzureHound is the BloodHound collector for Microsoft Entra ID and Azure. It is a single static Go binary for Windows/Linux/macOS that talks directly to:
306+
- Microsoft Graph (Entra ID directory, M365) and
307+
- Azure Resource Manager (ARM) control plane (subscriptions, resource groups, compute, storage, key vault, app services, AKS, etc.)
308+
309+
Key traits
310+
- Runs from anywhere on the public internet against tenant APIs (no internal network access required)
311+
- Outputs JSON for BloodHound CE ingestion to visualize attack paths across identities and cloud resources
312+
- Default User-Agent observed: azurehound/v2.x.x
313+
314+
Authentication options
315+
- Username + password: -u <upn> -p <password>
316+
- Refresh token: --refresh-token <rt>
317+
- JSON Web Token (access token): --jwt <jwt>
318+
- Service principal secret: -a <appId> -s <secret>
319+
- Service principal certificate: -a <appId> --cert <cert.pem> --key <key.pem> [--keypass <pass>]
320+
321+
Examples
305322
```bash
306-
# Launch AzureHound
307-
## Login with app secret
308-
azurehound -a "<client-id>" -s "<secret>" --tenant "<tenant-id>" list -o ./output.json
309-
## Login with user creds
310-
azurehound -u "<user-email>" -p "<password>" --tenant "<tenant-id>" list -o ./output.json
323+
# Full tenant collection to file using different auth flows
324+
## User creds
325+
azurehound list -u "<user>@<tenant>" -p "<pass>" -t "<tenant-id|domain>" -o ./output.json
326+
327+
## Use an access token (JWT) from az cli for Graph
328+
JWT=$(az account get-access-token --resource https://graph.microsoft.com -o tsv --query accessToken)
329+
azurehound list --jwt "$JWT" -t "<tenant-id>" -o ./output.json
330+
331+
## Use a refresh token (e.g., from device code flow)
332+
azurehound list --refresh-token "<refresh_token>" -t "<tenant-id>" -o ./output.json
333+
334+
## Service principal secret
335+
azurehound list -a "<client-id>" -s "<secret>" -t "<tenant-id>" -o ./output.json
336+
337+
## Service principal certificate
338+
azurehound list -a "<client-id>" --cert "/path/cert.pem" --key "/path/key.pem" -t "<tenant-id>" -o ./output.json
339+
340+
# Targeted discovery
341+
azurehound list users -t "<tenant-id>" -o users.json
342+
azurehound list groups -t "<tenant-id>" -o groups.json
343+
azurehound list roles -t "<tenant-id>" -o roles.json
344+
azurehound list role-assignments -t "<tenant-id>" -o role-assignments.json
345+
346+
# Azure resources via ARM
347+
azurehound list subscriptions -t "<tenant-id>" -o subs.json
348+
azurehound list resource-groups -t "<tenant-id>" -o rgs.json
349+
azurehound list virtual-machines -t "<tenant-id>" -o vms.json
350+
azurehound list key-vaults -t "<tenant-id>" -o kv.json
351+
azurehound list storage-accounts -t "<tenant-id>" -o sa.json
352+
azurehound list storage-containers -t "<tenant-id>" -o containers.json
353+
azurehound list web-apps -t "<tenant-id>" -o webapps.json
354+
azurehound list function-apps -t "<tenant-id>" -o funcapps.json
311355
```
312356

313-
Launch the **BloodHound** web with **`curl -L https://ghst.ly/getbhce | docker compose -f - up`** and import the `output.json` file.
357+
What gets queried
358+
- Graph endpoints (examples):
359+
- /v1.0/organization, /v1.0/users, /v1.0/groups, /v1.0/roleManagement/directory/roleDefinitions, directoryRoles, owners/members
360+
- ARM endpoints (examples):
361+
- management.azure.com/subscriptions/.../providers/Microsoft.Storage/storageAccounts
362+
- .../Microsoft.KeyVault/vaults, .../Microsoft.Compute/virtualMachines, .../Microsoft.Web/sites, .../Microsoft.ContainerService/managedClusters
314363

315-
Then, in the **EXPLORE** tab, in the **CYPHER** section you can see a **folder** icon that contains pre-built queries.
364+
Preflight behavior and endpoints
365+
- Each azurehound list <object> typically performs these test calls before enumeration:
366+
1) Identity platform: login.microsoftonline.com
367+
2) Graph: GET https://graph.microsoft.com/v1.0/organization
368+
3) ARM: GET https://management.azure.com/subscriptions?api-version=...
369+
- Cloud environment base URLs differ for Government/China/Germany. See constants/environments.go in the repo.
370+
371+
ARM-heavy objects (less visible in Activity/Resource logs)
372+
- 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.
373+
- 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.
374+
375+
OPSEC and logging notes
376+
- 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.
377+
- Entra ID non-interactive sign-in logs record the identity platform auth (login.microsoftonline.com) used by AzureHound.
378+
- 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.
379+
- Defender XDR GraphApiAuditEvents (preview) can expose Graph calls and token identifiers but may lack UserAgent and have limited retention.
380+
381+
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.
382+
383+
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.
316384

317385
### [**MicroBurst**](https://github.com/NetSPI/MicroBurst)
318386

@@ -429,5 +497,14 @@ python stormspotter\stormcollector\sscollector.pyz cli
429497
# This will generate a .zip file to upload in the frontend (127.0.0.1:9091)
430498
```
431499

500+
## References
501+
- [Cloud Discovery With AzureHound (Unit 42)](https://unit42.paloaltonetworks.com/threat-actor-misuse-of-azurehound/)
502+
- [AzureHound repository](https://github.com/SpecterOps/AzureHound)
503+
- [BloodHound repository](https://github.com/SpecterOps/BloodHound)
504+
- [AzureHound Community Edition Flags](https://bloodhound.specterops.io/collect-data/ce-collection/azurehound-flags)
505+
- [AzureHound constants/environments.go](https://github.com/SpecterOps/AzureHound/blob/main/constants/environments.go)
506+
- [AzureHound client/storage_accounts.go](https://github.com/SpecterOps/AzureHound/blob/main/client/storage_accounts.go)
507+
- [AzureHound client/roles.go](https://github.com/SpecterOps/AzureHound/blob/main/client/roles.go)
508+
432509
{{#include ../../banners/hacktricks-training.md}}
433510

src/pentesting-cloud/azure-security/az-services/az-monitoring.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ In summary, a Log Analytics workspace is essential for advanced monitoring, trou
4848

4949
You can configure a resource to send data to an analytics workspace from the **diagnostic settings** of the resource.
5050

51+
## Graph vs ARM logging visibility (useful for OPSEC/hunting)
52+
53+
- Microsoft Graph Activity Logs are not enabled by default. Enable and export them (Event Hubs/Log Analytics/SIEM) to see Graph read calls. Tools like AzureHound perform a preflight GET to /v1.0/organization that will appear here; default UA observed: azurehound/v2.x.x.
54+
- Entra ID non-interactive sign-in logs record the identity platform authentication (login.microsoftonline.<tld>) used by scripts/tools.
55+
- ARM control-plane read/list (HTTP GET) operations are generally not written to Activity Logs. Visibility of read operations comes from resource Diagnostic Settings for data-plane endpoints only (e.g., *.blob.core.windows.net, *.vault.azure.net) and not from ARM control-plane calls to management.azure.<tld>.
56+
- Microsoft Defender XDR Advanced Hunting GraphApiAuditEvents (preview) can expose Graph calls and token identifiers but may omit UserAgent and has limited default retention.
57+
58+
When hunting for AzureHound, correlate Entra sign-in logs with Graph Activity Logs on session ID, IP, user/object IDs, and look for bursts of Graph requests plus ARM management calls that lack Activity Log coverage.
59+
5160
## Enumeration
5261

5362
### Entra ID
@@ -105,5 +114,8 @@ az monitor metrics alert list --output table
105114
az monitor activity-log alert list --output table
106115
```
107116

117+
## References
118+
- [Cloud Discovery With AzureHound (Unit 42)](https://unit42.paloaltonetworks.com/threat-actor-misuse-of-azurehound/)
119+
108120
{{#include ../../../banners/hacktricks-training.md}}
109121

0 commit comments

Comments
 (0)