BloodHound
aka SharpHound, BloodHound Community Edition, BHCE, bloodhound-python
BloodHound AD attack path analysis: SharpHound collection methods, bloodhound-python (Linux/unauthenticated-friendly), Cypher query reference, key node types, pre-built attack path queries, and SpecterOps BloodHound CE.
Ports
| Port | Proto | Notes |
|---|---|---|
389 | tcp | LDAP — bloodhound-python collection |
445 | tcp | SMB — SharpHound session collection |
7474 | tcp | Neo4j bolt — BloodHound CE web UI |
Fingerprint
- BloodHound visualises AD attack paths using a Neo4j graph database
- Edges represent relationships: MemberOf, GenericAll, HasSession, CanPSRemote, etc.
Key files
| Path | Holds | Sensitive |
|---|---|---|
*.zip (SharpHound output) | full domain graph: users, computers, GPOs, ACLs, sessions, trusts | sensitive |
~/.config/bloodhound/ (BHCE config) | API keys and connection settings |
Exploitation primitives
- bloodhound-python runs from Linux without joining the domain
- Pre-built query 'Shortest Paths to Domain Admins' finds the attack chain instantly
- Mark compromised nodes as Owned to see reachable paths from your position
- Custom Cypher queries find delegation, LAPS, ADCS, trust misconfigurations
Data Collection
bloodhound-python (Linux — no domain join required)
# Full collection (All methods)
bloodhound-python -u user -p pass -d domain.local -ns DC_IP -c All
# If DNS doesn't work via the resolver:
bloodhound-python -u user -p pass -d domain.local -ns DC_IP -c All --dns-tcp
# Hash auth
bloodhound-python -u user --hashes :NTHASH -d domain.local -ns DC_IP -c All
# Kerberos auth (using .ccache)
KRB5CCNAME=ticket.ccache bloodhound-python -u user -k -no-pass -d domain.local -ns DC_IP -c All
Outputs .json files in the current directory — zip them and upload to BloodHound.
SharpHound (Windows — domain-joined or with creds)
# Full collection
.\SharpHound.exe -c All --zipfilename collection.zip
# From a non-domain-joined machine with explicit creds
.\SharpHound.exe -c All -d domain.local --ldapusername user --ldappassword pass --domaincontroller DC_IP
# Stealth — session collection only (less noisy)
.\SharpHound.exe -c Session
# Specific DC
.\SharpHound.exe -c All --domaincontroller DC_IP
nxc BloodHound module
nxc ldap DC_IP -u user -p pass --bloodhound -c All
Install BloodHound CE (Docker)
git clone https://github.com/SpecterOps/BloodHound
cd BloodHound/examples/docker-compose
docker compose up -d
# Access at http://localhost:8080 default admin / admin (change on first login)
Upload zip: Administration → File Ingest → Upload File.
Key Node Types
| Node | Represents |
|---|---|
| User | Domain user account |
| Computer | Workstation or server |
| Group | Security or distribution group |
| GPO | Group Policy Object |
| OU | Organisational Unit |
| Domain | The AD domain |
| Container | AD container object |
| CertTemplate | ADCS certificate template |
Key Edge Types (Attack Relevance)
| Edge | Abuse |
|---|---|
MemberOf | Group membership (follow to privileged groups) |
GenericAll | Full control: change password, add SPN, set shadow creds |
GenericWrite | Write attributes: add SPN (Kerberoast), shadow creds |
WriteDACL | Grant yourself GenericAll |
WriteOwner | Take ownership → WriteDACL |
AllExtendedRights | Includes Force-Change-Password and others |
ForceChangePassword | Change password without knowing current |
HasSession | A user has an active session on that computer |
AdminTo | Local admin on the target computer |
CanPSRemote | Can PSRemote to the target (WinRM) |
CanRDP | Can RDP to the target |
AddKeyCredentialLink | Shadow credentials abuse |
DCSync | Has DS-Replication rights |
AddMember | Can add users to the group |
AllowedToDelegate | Constrained delegation |
AllowedToAct | RBCD target |
TrustedBy | Domain trust direction |
Pre-Built Queries (GUI)
In BloodHound UI → Analysis tab:
- Find All Domain Admins — baseline who you’re targeting
- Shortest Paths to Domain Admins — THE critical query
- Shortest Paths from Owned Principals — paths from your compromised accounts
- Find Principals with DCSync Rights — who can DCSync besides Domain Admins
- Find Computers with Unsupported Operating Systems — legacy attack surface
- Find Kerberoastable Users with High Value Targets — priority targets
- Find ASREP-Roastable Users — no preauth accounts
- Shortest Paths to Unconstrained Delegation Systems — escalation via delegation
- Find Computers where Domain Users are Local Admin — mass compromise candidates
- Find Computers with Local Admin Privileges — where your user has admin rights
Custom Cypher Queries
All users with GenericAll on other users
MATCH (n:User)-[r:GenericAll]->(m:User)
RETURN n.name, m.name
Find paths from a specific user to DA
MATCH p=shortestPath((u:User {name: "ATTACKER@DOMAIN.LOCAL"})-[*1..]->(g:Group {name: "DOMAIN ADMINS@DOMAIN.LOCAL"}))
RETURN p
Find all computers where user has admin
MATCH (u:User {name: "USER@DOMAIN.LOCAL"})-[r:AdminTo]->(c:Computer)
RETURN c.name
Find all paths involving WriteDACL
MATCH p=(n)-[:WriteDACL]->(m)
WHERE n.name =~ ".*"
RETURN p LIMIT 25
Computers with unconstrained delegation (not DCs)
MATCH (c:Computer {unconstraineddelegation: true})
WHERE NOT c.name ENDS WITH "DC"
RETURN c.name
Users with DONT_REQ_PREAUTH (ASREP roastable)
MATCH (u:User {dontreqpreauth: true}) RETURN u.name
All service accounts (Kerberoastable)
MATCH (u:User) WHERE u.hasspn=true RETURN u.name, u.serviceprincipalnames
Cross-domain trust edges
MATCH (d1:Domain)-[r:TrustedBy]->(d2:Domain) RETURN d1.name, r, d2.name
Workflow: Owned → DA
- Mark your compromised accounts as Owned: right-click node → Mark User as Owned
- Run: Shortest Paths from Owned Principals
- Identify the cheapest edge chain (fewest hops)
- Click each edge to see abuse info (step-by-step exploit commands)
- Execute and re-mark the next node as Owned
- Repeat until Domain Admin
BloodHound CE API (automation)
# Get API token
curl -s -X POST http://localhost:8080/api/v2/login \
-H 'Content-Type: application/json' \
-d '{"login_name":"admin","secret":"YOUR_PASSWORD"}' | jq '.data.session_token'
# List all domains
curl -H "Authorization: Bearer TOKEN" http://localhost:8080/api/v2/available-domains