
Why Kali Linux and Azurehound Fit Together
Kali Linux is the default operating system for many penetration testers and red teams. It bundles hundreds of security tools, receives frequent updates and provides a consistent environment that can be rebuilt quickly between engagements. Azurehound fits naturally into that toolkit: Kali packages it in its official repositories, which means installation, updates and removal follow the same apt workflow as everything else on the system.
This guide covers installing Azurehound on Kali, running authorised collections, pairing it with BloodHound on the same machine and keeping the setup tidy and secure.
Step 1: Update Kali
Kali is a rolling distribution, so always refresh package lists before installing:
sudo apt update
sudo apt full-upgrade -y
A full upgrade ensures system libraries are current. Azurehound itself has minimal dependencies, but keeping the base system up to date avoids surprises with other tools in your workflow.
Step 2: Install Azurehound
sudo apt install azurehound
The package installs the azurehound binary on your PATH. Confirm it works:
azurehound -h
azurehound --version
The help output lists the available commands (list, configure, start, completion, help) and global flags.
When you need a newer version
Kali packages sometimes lag behind the newest GitHub release. If you need a feature that has only just landed, download the latest Linux release binary or build from source, and run it from a separate folder:
mkdir -p ~/tools/azurehound && cd ~/tools/azurehound
unzip ~/Downloads/azurehound-linux-amd64.zip
chmod +x azurehound
./azurehound --version
Keep track of which copy you are using; calling ./azurehound runs the local binary, while plain azurehound runs the packaged one.
Step 3: Prepare a Working Directory
Create a dedicated, permission-restricted folder for each engagement:
mkdir -p ~/engagements/contoso/azure
chmod 700 ~/engagements/contoso
cd ~/engagements/contoso/azure
Azurehound output contains detailed identity and permission data. Restricting the folder to your own user is a simple but effective safeguard, particularly on shared testing infrastructure.
Step 4: Authenticate and Collect
With authorisation confirmed, run a collection. Refresh tokens are the most practical method for MFA-protected test accounts:
azurehound list \
--tenant "contoso.onmicrosoft.com" \
-r "$REFRESH_TOKEN" \
-o contoso-$(date +%F).json
Storing the token in an environment variable, rather than typing it on the command line, keeps it out of shell history. Clear the variable with unset REFRESH_TOKEN when finished.
For client environments that provide a dedicated service principal:
azurehound list \
--tenant "contoso.onmicrosoft.com" \
-a "$APP_ID" -s "$CLIENT_SECRET" \
-o contoso-sp.json
Use azurehound list az-ad or azurehound list az-rm when you only need directory or resource data.
Step 5: Install BloodHound on Kali
Kali also packages BloodHound. Recent Kali releases provide BloodHound Community Edition, which runs with a database backend and a web interface. Installation and first-run steps vary slightly between Kali releases, so follow the instructions on Kali's own tool page for the version you have. Many testers prefer the official Docker Compose deployment of BloodHound CE, which keeps the database and web application isolated and easy to reset:
sudo apt install -y docker.io docker-compose
sudo systemctl enable --now docker
Then follow the BloodHound CE quick-start to launch the stack. Once it is running, browse to the local web interface, sign in and upload your Azurehound JSON file through the file upload area.
Step 6: Combine With On-Premises Data
If the target organisation uses hybrid identity, Azure is only half the story. Kali also packages collectors for on-premises Active Directory, such as SharpHound for Windows hosts and the Python-based collector for BloodHound CE. Loading both AD and Azurehound data into the same BloodHound instance can reveal paths that cross from on-premises accounts into Entra ID, for example through synchronised identities.
Typical Kali Workflow at a Glance
| Stage | Command or action |
|---|---|
| Update system | sudo apt update && sudo apt full-upgrade |
| Install collector | sudo apt install azurehound |
| Collect | azurehound list --tenant ... -o file.json |
| Start BloodHound CE | Docker Compose or Kali package |
| Ingest | Upload JSON in the web interface |
| Analyse | Pathfinding and Cypher queries |
| Clean up | Archive or securely delete output |
Keeping the Kali Setup Secure
A testing VM often holds credentials and sensitive output from several clients. Good hygiene matters:
- Encrypt the disk. Use full-disk encryption on any VM that stores engagement data.
- Separate engagements. One folder, or even one VM snapshot, per client prevents accidental cross-contamination.
- Purge tokens. Refresh tokens and client secrets should not outlive the engagement. Clear environment variables and shell history.
- Securely delete output. When the retention period ends, remove JSON files with
shredor rely on encrypted volumes you can destroy. - Limit network exposure. BloodHound's web interface should listen on localhost unless you deliberately share it.
Updating and Removing Azurehound
Updates arrive with your normal maintenance:
sudo apt update && sudo apt install --only-upgrade azurehound
To remove the package:
sudo apt remove azurehound
Troubleshooting on Kali
"Unable to locate package azurehound": your package lists are outdated or your sources file does not point to the official Kali repositories. Run sudo apt update and check /etc/apt/sources.list.
MFA errors during collection: password authentication cannot satisfy MFA. Switch to a refresh token or service principal.
BloodHound rejects the file: make sure your BloodHound and Azurehound versions are compatible. Upgrading both usually resolves the mismatch.
Slow collections: Microsoft Graph throttling is normal for large tenants. Let Azurehound's retries work, and avoid running parallel collections against the same tenant.
Building a Reusable Kali Engagement Template
Experienced testers rarely start from scratch. A reusable template on Kali saves time and reduces mistakes across engagements. A simple shell function can create a consistent folder structure, set restrictive permissions and record key details automatically.
new_azure_engagement() {
local client="$1"
local base="$HOME/engagements/$client/azure"
mkdir -p "$base"/{output,logs,notes}
chmod -R 700 "$HOME/engagements/$client"
azurehound --version > "$base/notes/azurehound-version.txt"
date -Iseconds > "$base/notes/started.txt"
echo "Engagement folder ready: $base"
}
Adding this function to your shell profile means every engagement begins with the same structure, the Azurehound version is captured from the outset and permissions are correct before any sensitive data arrives.
Combine the template with a short checklist kept in the notes folder: authorisation reference, tenant ID, identity used, collection commands run, files produced and date of deletion. When a client asks months later how a finding was produced, the answer is already documented.
Snapshots and clean rebuilds
Kali runs comfortably in virtual machines, which makes snapshots a powerful tool. Take a clean snapshot after installing Azurehound, BloodHound and your preferred utilities. At the end of each engagement, archive the protected output according to policy and revert to the clean snapshot. This guarantees that tokens, history and residual files from one client never carry over to the next, and it keeps your testing environment fast and predictable.
Working Offline After Collection
One advantage of the Kali workflow is that analysis can happen entirely offline. Once Azurehound has finished collecting, the JSON file holds everything BloodHound needs, so you can disconnect the VM from client networks before importing and analysing the data. This reduces exposure if the analysis takes days, and it reassures clients that their data is not being processed on internet-connected infrastructure longer than necessary.
Key Takeaways
- Install Azurehound on Kali with
sudo apt install azurehoundafter updating package lists. - Download a GitHub release separately if you need a feature not yet in the Kali package.
- Create restricted, per-engagement folders and keep tokens in environment variables, not commands.
- Run BloodHound Community Edition on the same VM, often via Docker Compose, for an all-in-one workflow.
- Load SharpHound data alongside Azurehound output to expose hybrid attack paths.
- Encrypt the VM, use snapshots and securely delete data when each engagement ends.
- Record the Azurehound version at the start of every engagement for reproducible reporting.
FAQs
sudo apt install azurehound.Conclusion
Azurehound on Kali Linux is one of the smoothest ways to bring Azure attack-path analysis into a penetration-testing workflow. A single apt install provides the collector, BloodHound can run on the same machine, and Kali's update model keeps everything current. Combine that convenience with disciplined handling of tokens and output files, and your Kali VM becomes a capable, responsible platform for authorised Azure assessments.


