BloodHound

AD relationship visualizer. Maps every user, group, computer, ACL, and session into a graph database, then finds the shortest path to Domain Admin.

AD CPTS GUI + Collector Two components
LevelIntermediate. Needs a basic grasp of AD objects (users, groups, computers) before the graph makes sense.
Know firstWhat Active Directory users, groups and computers are, and that Domain Admin is the usual end goal.
You will learn tocollect AD data with SharpHound, import it into BloodHound, and read the graph to find a path to Domain Admin.

What is it?

BloodHound is a tool that answers the question: "How do I get from where I am to Domain Admin?"

Active Directory is a web of relationships, user A is member of group B, group B has GenericWrite on user C, user C has a session on server D, and server D is a Domain Controller. Manually tracing these relationships across hundreds or thousands of objects is impossible. BloodHound automates it.

It has two parts:

  1. SharpHound (the collector): runs on the target Windows machine or remotely. Queries AD via LDAP, collects users, groups, computers, sessions, ACLs, trusts, and GPOs. Outputs a zip file with JSON data.
  2. BloodHound (the GUI): runs on your attacker machine. Imports the SharpHound data into a Neo4j graph database and visualizes it. You click "Find shortest path to Domain Admin" and it draws the attack chain.

Think of it as Google Maps for Active Directory: SharpHound surveys the roads, BloodHound plots the route.

Run this first

Start the database, collect data from the domain, then open BloodHound to import it.

bash: your first collection
$ sudo neo4j start
# wait about 15 seconds, then
$ bloodhound &

$ bloodhound-python -u jsmith -p Password123 -d corp.local -c All -ns 10.10.10.10
  • sudo neo4j start starts the database BloodHound reads from. BloodHound won't connect without it.
  • -c All collects everything, including ACLs. Using Default instead misses the ACL data where many attack paths live.

Drag the output JSON files into the BloodHound window. Mark your current user as Owned, then run the built-in "Shortest path to Domain Admins" query to see the first path.

What does it do?

After importing data, BloodHound can answer questions like:

  • What is the shortest path from my compromised user to Domain Admin?
  • Which users have DCSync rights?
  • Which computers have unconstrained delegation?
  • Where do Domain Admins have active sessions? (session hijacking targets)
  • Which users can reset another user's password?
  • Which users/groups have GenericAll/GenericWrite/WriteDACL on sensitive objects?
  • What are the Kerberoastable accounts with a path to high-value targets?
  • Which GPOs can be abused to push malicious scripts?

These are all built-in queries: you click them in the UI. You can also write custom Cypher queries for anything specific.

When do you use it?

Immediately after getting domain credentials. Run BloodHound on every AD engagement. Without it you are guessing which accounts and groups lead to Domain Admin.

The typical workflow:

  1. Get initial access (phishing, web exploit, password spray, whatever)
  2. Get domain credentials (any domain user works)
  3. Run SharpHound: collect the AD data
  4. Import into BloodHound: analyze attack paths
  5. Follow the path BloodHound shows you
CPTS context

In CPTS, run SharpHound as soon as you have a domain user. It's one of the first three things you do alongside certipy find and basic LDAP enumeration. The exam environment is designed with specific attack paths, BloodHound shows them.

How do you spot it?

You don't "spot" when to use BloodHound, you always use it in AD. The real question is what to look for in the output.

High-value findings to look for
  • Shortest path to DA with <5 hops: realistic to exploit
  • Kerberoastable users with admin paths: crack the SPN hash, get admin
  • GenericAll / GenericWrite on users: change their password or set an SPN for Kerberoasting
  • WriteDACL on Domain/OU: grant yourself any permission
  • DA sessions on workstations: steal their token/ticket
  • Unconstrained delegation: coerce a DC to authenticate to you, capture TGT
  • Owned principals with outbound edges: mark users as "owned" as you compromise them, BloodHound recalculates paths

How do you use it?

Part 1: Setting up BloodHound (one-time on Kali)

bash
# Start Neo4j (the graph database BloodHound uses)
$ sudo neo4j start
# First time: browse to http://localhost:7474, login neo4j/neo4j, set new password

# Start BloodHound
$ bloodhound
# Login with your Neo4j credentials (bolt://localhost:7687)

Part 2: Collecting data with SharpHound

SharpHound runs on the target (or remotely with creds). It queries LDAP and produces a zip file.

powershell: on the target
# Option A: SharpHound.exe (preferred, binary, less likely blocked than PS)
PS> .\SharpHound.exe -c All
[*] Enumerating Domain: corp.local
[*] Status: 150 objects finished (+150) -- Using 42 MB RAM
[*] SharpHound Enumeration Completed! Compressing data to 20241115_BloodHound.zip  <-- this zip is what you drag into the BloodHound GUI

# Option B: SharpHound.ps1 (PowerShell version)
PS> Import-Module .\SharpHound.ps1
PS> Invoke-BloodHound -CollectionMethod All

# Option C: From Kali with credentials (no need to be on the target)
$ bloodhound-python -u user -p 'pass' -d corp.local -ns 10.10.10.10 -c All

The -c All flag collects everything: users, groups, computers, sessions, ACLs, trusts, GPOs, object properties. Always use All unless you have a specific reason not to (like stealth).

Part 3: Importing and analyzing

  1. Transfer the zip file to your Kali box
  2. In BloodHound GUI: click the upload icon (top right) → select the zip
  3. Wait for import to complete
  4. Start querying

Essential queries to run (in order)

BloodHound built-in queries
# These are in the "Analysis" tab, click each one

1. Find all Domain Admins
2. Find Shortest Paths to Domain Admins
3. Shortest Paths to Domain Admins from Kerberoastable Users
4. Shortest Paths to Unconstrained Delegation Systems
5. Shortest Paths from Domain Users to High Value Targets
6. Find Principals with DCSync Rights
7. Users with Foreign Domain Group Membership
8. Find Computers where Domain Users are Local Admin

Marking owned users

As you compromise accounts, mark them as "owned" in BloodHound. Right-click the user node → "Mark as Owned". Then query "Shortest Paths from Owned Principals", BloodHound recalculates routes from your current position.

Reading the graph

Each line (edge) in the graph represents a relationship you can exploit:

EdgeWhat it meansHow to exploit
MemberOfUser is in this groupInherits the group's permissions
GenericAllFull control over the objectReset password, set SPN, add to group
GenericWriteCan modify object attributesSet SPN (→ Kerberoast), modify logon script
WriteDACLCan modify the object's ACLGrant yourself GenericAll, then exploit
ForceChangePasswordCan reset the target's passwordChange it and login as them
HasSessionTarget user has a login session on this computerGet on the computer → steal their token/ticket
AdminToUser is local admin on this computerPsExec/WMI/WinRM to get a shell
CanRDPUser can RDP to this computerRDP in with xfreerdp
AllowedToDelegateConstrained delegation: can impersonate users to a serviceRequest ticket as admin to the target service

What do you do with the output?

BloodHound shows you the path, but you still need to exploit each step. For each edge in the graph, use the corresponding tool:

  • GenericAll/GenericWrite on a user? → bloodyAD to set SPN or change password
  • Kerberoastable user in the path? → Rubeus to get the hash, Hashcat to crack
  • DA session on a workstation? → Get on that box, use Mimikatz to steal the ticket
  • WriteDACL? → bloodyAD or PowerView to grant yourself full control
  • Unconstrained delegation? → Coerce authentication with SpoolSample/PetitPotam, capture TGT
  • DCSync rights? → secretsdump to dump all domain hashes

Common mistakes

Things that go wrong
  • Forgetting to start Neo4j first: BloodHound won't connect without it. Run sudo neo4j start and wait 15 seconds before launching BloodHound
  • Using -c Default instead of -c All: Default misses ACL data, which is where the juiciest attack paths live
  • Not marking owned users: without marking who you've compromised, BloodHound can't calculate paths from your current position
  • Only looking at "shortest path to DA": there might be longer paths that are easier to exploit. Check the Kerberoastable and delegation queries too
  • Running SharpHound from a detection-aware environment: SharpHound makes a lot of LDAP queries. If you're trying to be quiet, use bloodhound-python from Kali instead
  • Stale session data: Sessions are point-in-time. A DA session might end before you get there. Re-run SharpHound with -c Session to refresh

Check yourself

Answer each question out loud or on paper first, then open it. Retrieving the answer teaches you more than rereading the page.

You open BloodHound and it fails to connect. What did you forget?
To start Neo4j first (sudo neo4j start), and to wait a few seconds before launching BloodHound.
Why collect with -c All instead of the default collection?
The default misses ACL data, and ACL-based paths (GenericAll, WriteDACL, and similar) are often the easiest route to Domain Admin.
You mark no users as Owned. What breaks?
BloodHound cannot calculate a path from your current position, since it needs to know where you are starting from.
Shortest path to DA shows nothing useful. What else is worth checking?
The Kerberoastable and delegation queries. A longer but easier path can exist even when the shortest one is a dead end.
You need to be quiet. Why avoid running SharpHound from a Windows foothold in that case?
SharpHound makes a large number of LDAP queries that stand out. bloodhound-python from Kali is a lighter-touch alternative.
A session edge that BloodHound shows no longer exists when you reach that machine. Why?
Sessions are a snapshot of a specific moment, and a user can log off before you get there. Re-run collection with session data to refresh it.