Skip to content

Lesson 11 of 13 · 15m

BloodHound: Reading the Graph Attackers Walk

SharpHound collection, the edge model, and running the shortest-path queries that surface every chain in this course.

BloodHound exists because the ACL graph is too big to eyeball. Released by SpecterOps at DEF CON 24 in 2016 (Rohan Vazarkar, Will Schroeder, Andy Robbins), it ingests AD data into a Neo4j graph where nodes are users/computers/groups/OUs/GPOs and edges are rights — MemberOf, GenericAll, WriteDACL, AdminTo, HasSession, CanRDP, AllowedToDelegate, AllowedToAct. Then it answers the question defenders couldn't ask before: "from this phished user, is there a path to Domain Admins?" The answer is usually yes.

What the collector actually gathers

SharpHound.exe -c All (or bloodhound-python) walks LDAP and RPC:

  • Object ACLs — the WriteDACL/GenericAll/ExtendedRight edges from the ACL lesson. This is the bulk of the graph.
  • Sessions — NetSessionEnum on every reachable host: who is logged in where. HasSession edges turn "DA logged into workstation-417" into a documented path.
  • Local admins — AdminTo via SAMR/LSA enumeration per host.
  • Delegation — AllowedToDelegate, AllowedToAct, TrustedForDelegation attributes.
  • GPO links — which GPOs apply to which OUs, feeding GpLink/AppliedTo paths for GPO-edit abuse.

The wrong mental model: "BloodHound finds misconfigurations." It finds paths. Every edge is a legitimate config; the composition is the attack. A HasSession edge is fresh only as long as the session lasts — sessions expire, and path analysis is a snapshot, not a promise.

The queries that matter

The built-in queries are the course in GUI form: "Shortest paths to Domain Admins," "Find Kerberoastable users," "Find computers with unconstrained delegation," "Shortest paths from owned principals." Two Cypher patterns do most custom work:

MATCH p=shortestPath((u:User {name:"JDoe@CORP.LOCAL"})-[*1..]->(g:Group {name:"DOMAIN ADMINS@CORP.LOCAL"})) RETURN p
MATCH (c:Computer) WHERE c.unconstraineddelegation=true RETURN c.name

BloodHound CE (the 2023 rewrite) added edge metadata — composition graphs showing exactly which ACL grants build each path — and a rewritten SharpHound collector — still C#; the Go collector is AzureHound, which extends the same model into Entra ID. That matters because hybrid estates carry hybrid paths — an on-prem GenericAll chain can end at a synced account with cloud roles.

Reading results like an attacker

A path ending in MemberOf → Domain Admins is obvious. The paths that matter combine: JDoe -[WriteDACL]-> HelpdeskGroup -[GenericAll]-> svc-backup -[MemberOf]-> Backup Operators. Every hop is a separate finding with a separate owner and a separate fix. Fix the cheapest edge first — usually the WriteDACL nobody remembered granting — and the path collapses.

HasSession edges deserve special attention: they change hourly. A path through a session edge means "exploitable right now because DA is logged into a reachable host." Chasing those before the session ends is what defenders do with BloodHound in incident mode.

The defender's workflow

  1. Collect weekly (SharpHound scheduled task, encrypted output — the JSON is a map of your whole estate; treat it as sensitive).
  2. Diff path counts week over week: new DCSync-right principals, new unconstrained hosts, new paths to DA are the changes that matter.
  3. Run the attacker's queries on yourself first: kerberoastable non-gMSA accounts, roastable DONT_REQ_PREAUTH users, DCSync ER holders outside DA/DC, shortest paths from your most-phishable departments.
  4. Fix edges, not nodes: remove the ACE, unscope the GPO, clear the delegation bit. The graph is documentation of your misconfigurations; the fix list is the backlog.

BloodHound is also how attackers validate their work — find the same paths before they do, because they run it too. One operational note: SharpHound is loud. Full LDAP enumeration plus NetSessionEnum against every host generates exactly the telemetry patterns covered in the detection lesson — 1644 expensive-search bursts and session-enumeration RPCs. Attackers running it inside your estate leave fingerprints in the same logs you should be watching; defenders running it should expect the same noise and schedule it accordingly. bloodhound-python gives the same ingest over plain LDAP from outside, slightly quieter, still enumerable.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.