> For the complete documentation index, see [llms.txt](https://cookiez.gitbook.io/red-team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cookiez.gitbook.io/red-team/cloud/azure/enumeration/azurehound.md).

# AzureHound

BloodHound's AzureHound (<https://github.com/BloodHoundAD/AzureHound>) supports Azure and Entra ID too to map attack paths. It uses Azure AD and Az PowerShell modules for gathering the data through its collectors.

{% stepper %}
{% step %}
Run the collector to gather data

```powershell
$passwd = ConvertTo-SecureString "SuperVeryEasytoGuessPassword@1234" -AsPlainText -Force
$creds = New-Object System.Management.Automation.PSCredential("test@defcorphq.onmicrosoft.com", $passwd)
```

```powershell
Connect-AzAccount -Credential $creds
Import-Module C:\AzAD\Tools\AzureAD\AzureAD.psd1
Connect-AzureAD -Credential $creds
```

{% endstep %}

{% step %}

### Run

```powershell
C:\AzAD\Tools\AzureHound\AzureHound.ps1 
Invoke-AzureHound -Verbose
```

{% endstep %}

{% step %}

### upload data to BloodHound UI

Upload the ZIP archive to BloodHound UI (drag and drop) and use built-in or custom Cypher queries to query the data. This is the normal BloodHound.
{% endstep %}
{% endstepper %}

Some examples of Cypher queries are below:

• Find all users who have the Global Administrator role&#x20;

`MATCH p =(n)-[r:AZGlobalAdmin*1..]->(m) RETURN p`&#x20;

• Find all paths to an Azure VM&#x20;

`MATCH p = (n)-[r]->(g: AZVM) RETURN p`&#x20;

• Find all paths to an Azure KeyVault&#x20;

`MATCH p = (n)-[r]->(g:AZKeyVault) RETURN p`&#x20;

• Find all paths to an Azure Resource Group&#x20;

`MATCH p = (n)-[r]->(g:AZResourceGroup) RETURN p`&#x20;

• Find Owners of Entra ID Groups&#x20;

`MATCH p = (n)-[r:AZOwns]->(g:AZGroup) RETURN p`
