BloodHound.py AD Information Gathering Methodology
- 攻击大类:C30 AD域渗透与域控攻击
BloodHound.py is the Python collector for BloodHound. Core advantages: no execution on the target (collects remotely over LDAP/DNS) + broad coverage (users/groups/computers/sessions/ACLs/trust relationships) + JSON output (import into the BloodHound GUI to analyze attack paths).
Project URL: https://github.com/dirkjanm/BloodHound.py
Phase 1: Basic Collection
# Full collection (most common)
bloodhound-python -d corp.local -u user -p 'P@ssw0rd' -c All
# Specify the domain controller IP
bloodhound-python -d corp.local -u user -p 'P@ssw0rd' -c All -dc 10.0.0.1
# Specify the DNS server
bloodhound-python -d corp.local -u user -p 'P@ssw0rd' -c All -ns 10.0.0.1
# Output a compressed archive
bloodhound-python -d corp.local -u user -p 'P@ssw0rd' -c All --zip
Phase 2: Authentication Methods
# Password authentication
bloodhound-python -d corp.local -u user -p 'P@ssw0rd' -c All
# NTLM hash authentication (pass-the-hash)
bloodhound-python -d corp.local -u user --hashes aad3b435b51404eeaad3b435b51404ee:hash -c All
# Kerberos authentication
bloodhound-python -d corp.local -u user -p 'P@ssw0rd' -c All -k
# Use a ccache ticket
export KRB5CCNAME=/tmp/krb5cc_user
bloodhound-python -d corp.local -u user -c All -k --auth-method kerberos
Phase 3: Choosing a Collection Method
# Default collection (Group + LocalAdmin + Session + Trusts)
bloodhound-python -d corp.local -u user -p pass -c Default
# Group membership only
bloodhound-python -d corp.local -u user -p pass -c Group
# Local admins only
bloodhound-python -d corp.local -u user -p pass -c LocalAdmin
# Session information only
bloodhound-python -d corp.local -u user -p pass -c Session
# ACL collection (to analyze permission relationships)
bloodhound-python -d corp.local -u user -p pass -c ACL
# Trust relationships
bloodhound-python -d corp.local -u user -p pass -c Trusts
Phase 4: Import and Analysis
After collection finishes, import the JSON/ZIP file into the BloodHound GUI:
# Start Neo4j (the BloodHound backend)
sudo neo4j start
# Open the BloodHound GUI and drag the JSON/ZIP file in to import it
# Common queries:
# - Find all Domain Admins
# - Shortest Path to Domain Admins
# - Find Kerberoastable Users
# - Find AS-REP Roastable Users
Common Penetration Testing Scenarios
| Scenario | Command |
|---|---|
| Full collection | bloodhound-python -d corp.local -u user -p pass -c All --zip |
| PtH collection | bloodhound-python -d corp.local -u user --hashes LM:NT -c All |
| ACL analysis only | bloodhound-python -d corp.local -u user -p pass -c ACL |
| Specify the DC | bloodhound-python -d corp.local -u user -p pass -c All -dc 10.0.0.1 -ns 10.0.0.1 |