Tools

T1087

BloodHound

How BloodHound maps Active Directory attack paths, collection methods, edge analysis, and blue team use cases for finding and fixing AD security weaknesses before attackers exploit them.

View on Graph

What BloodHound Is and Why Both Sides Use It

BloodHound is an open-source AD attack path mapping tool developed by SpecterOps. It uses graph theory to visualize relationships between AD objects — users, groups, computers, sessions, ACLs, and GPOs — and identifies attack paths to high-value targets like Domain Admins.

  • BloodHound answers the question: “What can this user do, directly or indirectly, to get to Domain Admin?” The answer is rarely direct — it chains together group memberships, computer access, session control, ACL abuse, and privilege escalation.
  • The tool consists of three components: a collector (runs on a domain-joined system and gathers data), a graph database (Neo4j backend storing the relationships), and a user interface (Electron-based GUI for visualizing and querying attack paths).
  • For blue teams, BloodHound is a continuous security assessment tool. Run it monthly, compare outputs, and track the reduction in attack paths over time.

MITRE ATT&CK maps AD enumeration to T1087 (Account Discovery) and T1069 (Permission Groups Discovery). BloodHound automates both.


Collection Methods

SharpHound (Windows Collector)

SharpHound is the primary BloodHound collector. It runs on any domain-joined Windows system and gathers AD data using LDAP queries, WinRM, and RPC.

Collection methods:

MethodData CollectedSpeedRequires
BasicUsers, groups, computers, OUs, GPOs, domainsFast (minutes)Standard domain user
GroupGroup membership, nested groupsFastStandard domain user
Local GroupLocal Administrators, RDP, and PSRemote group membership on targetsSlow (minutes per host)Admin rights on target machines, WinRM enabled
SessionActive user sessions on remote computersMediumStandard domain user, WinRM enabled
ACLActive Directory ACLs (who has what permissions on which objects)MediumStandard domain user
RDPRDP connections and capabilitiesSlowAdmin rights, WinRM
DCOMDCOM connections and capabilitiesSlowAdmin rights, WinRM
PSRemotePowerShell remoting connectionsSlowAdmin rights, WinRM
ContainerContainer objects (for Azure AD hybrid)MediumAzure AD permissions
GPOLocalGroupGPO security filtering local group membershipSlowAdmin rights, SMB/File System

Running SharpHound

# Basic collection (most common — users, groups, computers, sessions, ACLs)
SharpHound.exe --CollectionMethod Default

# Full collection (all methods — takes longer but gives complete picture)
SharpHound.exe --CollectionMethod All

# Specific collection — just ACLs and sessions
SharpHound.exe --CollectionMethod ACL,Sessions

# Encrypted collection (zip file with password)
SharpHound.exe --CollectionMethod Default --ZipPassword

# Collect from a specific domain (multidomain environments)
SharpHound.exe --Domain target.corp.local

AzureHound (Azure AD Collector)

AzureHound collects Azure AD and Azure RBAC data, mapping attack paths in cloud environments.

# Authenticate to Azure
Connect-AzureAD

# Run AzureHound collection
Import-Module AzureHound.psd1
Invoke-AzureHound -OutputDirectory C:\BloodHound\

What Data to Collect (Blue Team Focus)

For blue team assessments, start with:

CollectionWhyFrequency
DefaultCovers users, groups, computers, sessions, ACLsMonthly
Local GroupFinds local admin sprawl — should be minimalQuarterly
SessionFinds where admins are logged in — high-value session targetsMonthly

Key BloodHound Graph Edges

BloodHound models relationships as edges between AD objects. Each edge represents an attack path.

Primary Attack Path Edges

EdgeSource → TargetWhat It MeansAbuse Technique
MemberOfUser → GroupUser is a member of this groupGroup nesting — indirect admin via nested groups
AdminToComputer → ComputerUser/group has local admin on target computerLocal admin access — install malware, steal creds
HasSessionComputer → UserUser has an active session on this computerSession theft — steal the user’s Kerberos ticket (also done via Mimikatz)
CanRDPComputer → ComputerUser can RDP to target computerRemote desktop access for lateral movement
ExecuteDCOMComputer → ComputerUser can execute DCOM on targetLateral movement via DCOM
SQLAdminComputer → ComputerUser is SQL admin on targetSQL Server lateral movement
ForceChangePasswordObject → UserUser can change target’s password without knowing current passwordPassword reset — take over account
AddMemberObject → GroupUser can add members to a groupAdd self to privileged group
WriteOwnerObject → ObjectUser can change object ownerTake ownership of high-value object
WriteDACLObject → ObjectUser can modify object ACLGrant self any privilege on the object
AllExtendedRightsObject → ObjectUser has all extended rights on objectFull ACL abuse — reset passwords, modify attributes
GenericAllObject → ObjectUser has full control over objectComplete object takeover
GenericWriteObject → ObjectUser can modify any non-protected attributeWrite to user’s scriptPath, servicePrincipalName (kerberoasting), group membership
OwnsObject → ObjectUser is the ownerChange ACLs as object owner
GetChangesObject → DomainUser has DS-Replication-GetChanges rightDCSync capability — replicate AD database (detectable with Elastic Security)
GetChangesAllObject → DomainUser has DS-Replication-GetChanges-All rightFull DCSync — dump all password hashes
AddAllowedToActObject → ComputerUser can configure Kerberos resource-based constrained delegationResource-based delegation abuse
AllowedToDelegateComputer → ComputerComputer is trusted for Kerberos delegationUnconstrained/constrained delegation abuse

Blue Team Priority Edge Check

For blue teams, these edges should be flagged as findings:

EdgeWhy It MattersRemediation
GetChanges + GetChangesAllAny user with this can DCSync and dump all hashesRemove replication rights from non-DC accounts
ForceChangePasswordAny user/group controlling a Domain Admin account = instant DA compromiseAudit who has reset rights on privileged accounts
MemberOf (to Domain Admins)Users in Domain Admins — should be 2-3 break-glass accountsReduce DA count. Use tiering model.
AddMember (to Domain Admins)Groups/users who can add members to Domain AdminsControl delegation on privileged groups — verify with Nmap enumeration
HasSession (Admin sessions on workstations)DA logged into a non-DA workstation = credential theft riskEnforce tiering — DA logs in only on DCs and DA workstations
AdminTo (to Domain Controllers)Anyone with admin rights on a DC = effective DARemove non-DA admin rights from domain controllers
Unconstrained DelegationComputers with unconstrained delegation allow Kerberos ticket theftSwitch to constrained or resource-based delegation

Blue Team Workflow — Finding and Fixing Attack Paths

Step 1: Collect and Import

# Run SharpHound on a domain-joined system
SharpHound.exe --CollectionMethod Default --OutputPrefix "corp-monthly"

# Import the resulting zip file into BloodHound UI or API
# File → Upload → Select corp-monthly_*.zip

Step 2: Run Built-In Queries (Analyst Focus)

BloodHound has pre-built queries. For blue team analysis:

QueryWhat It FindsWhy
Find all Kerberoastable UsersUsers with servicePrincipalName setThese accounts can be kerberoasted — password strength matters
Find Computers where Domain Users are Local AdminWorkstations/servers where all domain users have adminOver-permissive local groups
Find all Users with DCSync RightsUsers who can replicate AD databaseContains DCSync attack path
Find all Edges from a Specific UserComplete attack path from a compromised user to Domain AdminUnderstand blast radius of a single account compromise
Shortest Paths to Domain AdminsQuickest escalation paths from any starting pointPrioritize remediation — fix the shortest paths first
Find all Unconstrained Delegation SystemsComputers with unconstrained Kerberos delegationThese compromise anyone who authenticates to them

Step 3: Analyze the Attack Graph

Cypher query — find all users who can reach Domain Admin in 3 hops or fewer:

MATCH (u:User)-[r1*1..3]->(g:Group {name:"DOMAIN ADMINS@CORP.LOCAL"})
RETURN u.name, count(r1) as pathCount
ORDER BY pathCount DESC

Cypher query — find all kerberoastable accounts that are Domain Admins:

MATCH (u:User {hasspn:true})-[:MemberOf*1..]->(g:Group {name:"DOMAIN ADMINS@CORP.LOCAL"})
RETURN u.name, u.displayname, u.samaccountname

Step 4: Remediate Priority Findings

FindingRemediationVerification
User in Domain Admins when not requiredRemove from DA group. Grant just the rights needed via delegated permissions.Re-run BloodHound and verify DA membership reduced.
Unconstrained delegation on a computerSwitch to constrained delegation or resource-based constrained delegation.Re-run collection, check delegation edges.
Excessive ACL abuse pathAudit the AD ACL. Remove unnecessary WriteOwner/WriteDACL/GenericAll.Re-run ACL collection and verify edges removed.
DA sessions on non-DA workstationsEnforce AD tiering — DA should only log into DCs and DA workstations.Check HasSession edges post-enforcement.
Kerberoastable DA service accountsChange service account passwords. Use Group Managed Service Accounts (gMSA) where possible.Verify service accounts removed from SPN tracking.

BloodHound CE (Community Edition)

BloodHound CE is the current version (replacing the legacy BloodHound 4.x). Key differences:

FeatureLegacy BloodHoundBloodHound CE
ArchitectureElectron app + Neo4jWeb-based UI + Neo4j + API
InstallationManual install per analystDocker containers (docker compose up)
CollectionSharpHound standaloneSharpHound collector + AzureHound
QueriesCypher queries in GUICypher queries + pre-built analysis panels
Auto-analysisManualAuto-markdown findings for common attack paths
Multi-tenancyOne database per deploymentMulti-env support via API

Quick Start with BloodHound CE

# Clone and start BloodHound CE
git clone https://github.com/SpecterOps/BloodHound.git
cd BloodHound/examples/docker-compose
docker compose up -d

# Access the UI at http://localhost:8080
# Upload SharpHound zip files via the Web UI

Blue Team Automation — Continuous BloodHound Assessment

For production blue team use, BloodHound should run on a schedule:

# Example automation using task scheduler (weekly)
Schedule: Every Monday at 2:00 AM
Action: 
  1. PowerShell: Download latest SharpHound
  2. PowerShell: Run SharpHound --CollectionMethod Default --OutputPrefix "corp-weekly"
  3. PowerShell: Upload zip to BloodHound CE API
  4. Automated analysis: Compare with previous week's data
  5. Report: Generate finding diff report (new edges discovered, old edges remediated)

SPL query — track BloodHound findings over time (if findings logged to SIEM, or via Metasploit automation):

index=splunk sourcetype="bloodhound_findings"
| stats count by finding_type, severity, host
| eval remediation_status = if(count > 0 AND count = latest_count, "UNCHANGED", if(count < latest_count, "IMPROVED", "WORSENED"))
| table finding_type, host, severity, count, remediation_status

Sources