BloodHound Guide: Mapping Active Directory Relationships
Learn how to use BloodHound and SharpHound for Active Directory reconnaissance, attack path analysis, privilege escalation detection, and security assessment.
Introduction to BloodHound
BloodHound is an open-source tool that uses graph theory to reveal hidden relationships within Active Directory environments. Developed by SpecterOps, BloodHound maps AD objects as nodes in a graph database and identifies attack paths by analyzing edges between them. It visualizes AD relationships in ways impossible with traditional enumeration tools.
Prerequisites
How BloodHound Works
BloodHound (UI + Analysis): The graphical interface running on Kali Linux, connected to a Neo4j graph database.
SharpHound (Data Collector): Runs on a domain-joined system, gathering data via LDAP queries, local admin checks, session enumeration, and ACL analysis.
Setting Up BloodHound
# Install Neo4j and BloodHound on Kali
sudo apt install neo4j bloodhound -y
sudo systemctl start neo4j
# Navigate to http://localhost:7474 and set neo4j:neo4j password
Running SharpHound
# PowerShell collection
Import-Module .\SharpHound.ps1
Invoke-BloodHound -CollectionMethod All -Domain corp.local
# Compiled executable
.\SharpHound.exe --CollectionMethods All --Domain corp.local
Key BloodHound Queries
Find Shortest Paths to Domain Admins: Maps the most efficient route from current compromise to Domain Admin.
Find Kerberoastable Accounts: Lists accounts with SPNs vulnerable to Kerberoasting.
Find Computers where Domain Users have Local Admin: Identifies shadow admin misconfigurations.
Find AS-REP Roastable Users: Users without Kerberos pre-authentication.
Advanced Analysis
BloodHound edges represent privilege escalation opportunities:
ACL edges reveal subtle privilege escalations like GenericAll and WriteDacl that allow adding users to privileged groups.
Common Mistakes
Best Practices
Related Tools
Related Articles
Summary
BloodHound reveals AD attack paths by mapping relationships as graph data. Used offensively, it identifies the most efficient route to privilege escalation. Used defensively, it helps organizations find and fix security gaps before attackers exploit them.