Exploiting Active Directory with BloodHound
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Overview
BloodHound is a graph-based Active Directory reconnaissance tool that uses graph theory to reveal hidden and unintended relationships within AD environments. Red teams use BloodHound to identify attack paths from compromised accounts to high-value targets such as Domain Admins, identifying privilege escalation chains that would be nearly impossible to find manually. SharpHound is the official data collector that gathers AD objects, relationships, ACLs, sessions, and group memberships.
When to Use
Trigger phrases:
"exploiting active directory with bloodhound"
"BloodHound is a graph-based Active Directory reconnaissance tool that uses graph"
When performing authorized security testing that involves exploiting active directory with bloodhound
When analyzing malware samples or attack artifacts in a controlled environment
When conducting red team exercises or penetration testing engagements
When building detection capabilities based on offensive technique understanding
Prerequisites
- Familiarity with red teaming concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Collect Active Directory relationship data using SharpHound or BloodHound.py
- Visualize attack paths from compromised accounts to Domain Admin
- Identify misconfigured ACLs, group memberships, and delegation settings
- Discover shortest attack paths to high-value targets
- Map Kerberos delegation configurations for abuse
- Document all identified privilege escalation chains
MITRE ATT&CK Mapping
- T1087.002 - Account Discovery: Domain Account
- T1069.002 - Permission Groups Discovery: Domain Groups
- T1482 - Domain Trust Discovery
- T1615 - Group Policy Discovery
- T1018 - Remote System Discovery
- T1033 - System Owner/User Discovery
- T1016 - System Network Configuration Discovery
Workflow
# Example: IOC detection
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Scope and authorize — confirm written authorization and define target boundaries
- Reconnaissance — enumerate targets, services, and potential attack surfaces
- Exploitation — attempt exploitation of identified vulnerabilities within scope
- Post-exploitation — document access level, lateral movement, and data exposure
- Report and remediate — compile findings with reproduction steps and fix recommendations
Phase 1: Data Collection with SharpHound
- Transfer SharpHound collector to compromised host
- Execute collection with appropriate method (All, DCOnly, Session, LoggedOn)
- Collect from all reachable domains if multi-domain environment
- Exfiltrate ZIP data files to analysis workstation
- Import data into BloodHound CE or Legacy
Phase 2: Attack Path Analysis
- Mark owned principals (compromised accounts)
- Query shortest path to Domain Admins
- Identify Kerberoastable accounts with admin privileges
- Find AS-REP Roastable accounts
- Analyze ACL-based attack paths (GenericAll, GenericWrite, WriteDACL, ForceChangePassword)
- Review GPO abuse opportunities
Phase 3: Exploitation Planning
- Prioritize attack paths by complexity and stealth
- Identify required tools for each step in the chain
- Plan OPSEC considerations for each technique
- Execute identified attack chain
- Document evidence at each step
When NOT to Use
- You don't have explicit authorization to exploit
- Task is about detecting exploits, not performing them (use detecting-* skills)
- You need to analyze exploit artifacts (use analyzing-* skills)
- Task is about building exploit tools (use building-* skills)
- Target is production without authorization
- Task requires responsible disclosure (follow disclosure process)
Red Flags
- Performing actions without explicit written authorization from the asset owner
- Testing against production systems without a defined scope and rules of engagement
- Exceeding the authorized scope of the engagement
- Leaving persistent access mechanisms without explicit approval
- Causing denial-of-service on production systems during testing
Verification
- All steps executed successfully against a test environment before production use
- Output documented with screenshots or logs demonstrating expected behavior
- All exploited vulnerabilities documented with reproduction steps
- Scope boundaries confirmed — only authorized targets were tested
- Remediation recommendations included for every finding
Tools and Resources
| Tool |
Purpose |
Platform |
| BloodHound CE |
Graph visualization and analysis |
Web-based |
| SharpHound |
AD data collection (.NET) |
Windows |
| BloodHound.py |
AD data collection (Python) |
Linux/Windows |
| Cypher queries |
Custom graph queries |
Neo4j/BloodHound |
| PlumHound |
Automated BloodHound reporting |
Python |
| Max (BloodHound) |
BloodHound automation |
Python |
Key BloodHound Queries
| Query |
Purpose |
| Shortest Path to Domain Admins |
Find fastest route to DA |
| Find Kerberoastable Users with Path to DA |
SPN accounts leading to DA |
| Find AS-REP Roastable Users |
Accounts without pre-auth |
| Shortest Path from Owned Principals |
Paths from compromised accounts |
| Find Computers with Unsupported OS |
Legacy systems for exploitation |
| Find Users with DCSync Rights |
Accounts that can replicate AD |
| Find GPOs that Modify Local Group Membership |
GPO-based privilege escalation |
Validation Criteria
Process
- Analyze the task requirements
- Apply domain expertise
- Verify output quality
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: exploiting-active-directory-with-bloodhound3description: Use when bloodHound is a graph-based Active Directory reconnaissance4 tool that uses graph theory to reveal hidden and unintended relationships within5 AD environments. Red teams use BloodHound to identify attac. Use when working with6 exploiting active directory with bloodhound.7domain: cybersecurity8subdomain: red-teaming9tags:10- red-team11- adversary-simulation12- mitre-attack13- exploitation14- post-exploitation15- active-directory16- bloodhound17version: '1.0'18author: oyi7719license: Apache-2.020d3fend_techniques:21- Restore Access22- Password Authentication23- Biometric Authentication24- Strong Password Policy25- Restore User Account Access26nist_csf:27- ID.RA-0128- GV.OV-0229- DE.AE-0730category: cybersecurity31metadata:32 source: https://skillmd.com/skills/oyi77/exploiting-active-directory-with-bloodhound33---3435# Exploiting Active Directory with BloodHound363738> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.3940## Overview4142BloodHound is a graph-based Active Directory reconnaissance tool that uses graph theory to reveal hidden and unintended relationships within AD environments. Red teams use BloodHound to identify attack paths from compromised accounts to high-value targets such as Domain Admins, identifying privilege escalation chains that would be nearly impossible to find manually. SharpHound is the official data collector that gathers AD objects, relationships, ACLs, sessions, and group memberships.434445## When to Use46**Trigger phrases:**47- "exploiting active directory with bloodhound"48- "BloodHound is a graph-based Active Directory reconnaissance tool that uses graph"495051- When performing authorized security testing that involves exploiting active directory with bloodhound52- When analyzing malware samples or attack artifacts in a controlled environment53- When conducting red team exercises or penetration testing engagements54- When building detection capabilities based on offensive technique understanding5556## Prerequisites5758- Familiarity with red teaming concepts and tools59- Access to a test or lab environment for safe execution60- Python 3.8+ with required dependencies installed61- Appropriate authorization for any testing activities6263## Objectives6465- Collect Active Directory relationship data using SharpHound or BloodHound.py66- Visualize attack paths from compromised accounts to Domain Admin67- Identify misconfigured ACLs, group memberships, and delegation settings68- Discover shortest attack paths to high-value targets69- Map Kerberos delegation configurations for abuse70- Document all identified privilege escalation chains7172## MITRE ATT&CK Mapping7374- **T1087.002** - Account Discovery: Domain Account75- **T1069.002** - Permission Groups Discovery: Domain Groups76- **T1482** - Domain Trust Discovery77- **T1615** - Group Policy Discovery78- **T1018** - Remote System Discovery79- **T1033** - System Owner/User Discovery80- **T1016** - System Network Configuration Discovery8182## Workflow8384```python85# Example: IOC detection86import re8788IOC_PATTERNS = {89 "ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",90 "domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",91 "hash_md5": r"\b[a-f0-9]{32}\b",92 "hash_sha256": r"\b[a-f0-9]{64}\b",93}9495def extract_iocs(text: str) -> dict:96 return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}97```98991. **Scope and authorize** — confirm written authorization and define target boundaries1002. **Reconnaissance** — enumerate targets, services, and potential attack surfaces1013. **Exploitation** — attempt exploitation of identified vulnerabilities within scope1024. **Post-exploitation** — document access level, lateral movement, and data exposure1035. **Report and remediate** — compile findings with reproduction steps and fix recommendations104### Phase 1: Data Collection with SharpHound1051. Transfer SharpHound collector to compromised host1062. Execute collection with appropriate method (All, DCOnly, Session, LoggedOn)1073. Collect from all reachable domains if multi-domain environment1084. Exfiltrate ZIP data files to analysis workstation1095. Import data into BloodHound CE or Legacy110111### Phase 2: Attack Path Analysis1121. Mark owned principals (compromised accounts)1132. Query shortest path to Domain Admins1143. Identify Kerberoastable accounts with admin privileges1154. Find AS-REP Roastable accounts1165. Analyze ACL-based attack paths (GenericAll, GenericWrite, WriteDACL, ForceChangePassword)1176. Review GPO abuse opportunities118119### Phase 3: Exploitation Planning1201. Prioritize attack paths by complexity and stealth1212. Identify required tools for each step in the chain1223. Plan OPSEC considerations for each technique1234. Execute identified attack chain1245. Document evidence at each step125126## When NOT to Use127128- You don't have explicit authorization to exploit129- Task is about detecting exploits, not performing them (use detecting-* skills)130- You need to analyze exploit artifacts (use analyzing-* skills)131- Task is about building exploit tools (use building-* skills)132- Target is production without authorization133- Task requires responsible disclosure (follow disclosure process)134135136## Red Flags137138- Performing actions without explicit written authorization from the asset owner139- Testing against production systems without a defined scope and rules of engagement140- Exceeding the authorized scope of the engagement141- Leaving persistent access mechanisms without explicit approval142- Causing denial-of-service on production systems during testing143144## Verification145146- All steps executed successfully against a test environment before production use147- Output documented with screenshots or logs demonstrating expected behavior148- All exploited vulnerabilities documented with reproduction steps149- Scope boundaries confirmed — only authorized targets were tested150- Remediation recommendations included for every finding151152## Tools and Resources153154| Tool | Purpose | Platform |155|------|---------|----------|156| BloodHound CE | Graph visualization and analysis | Web-based |157| SharpHound | AD data collection (.NET) | Windows |158| BloodHound.py | AD data collection (Python) | Linux/Windows |159| Cypher queries | Custom graph queries | Neo4j/BloodHound |160| PlumHound | Automated BloodHound reporting | Python |161| Max (BloodHound) | BloodHound automation | Python |162163## Key BloodHound Queries164165| Query | Purpose |166|-------|---------|167| Shortest Path to Domain Admins | Find fastest route to DA |168| Find Kerberoastable Users with Path to DA | SPN accounts leading to DA |169| Find AS-REP Roastable Users | Accounts without pre-auth |170| Shortest Path from Owned Principals | Paths from compromised accounts |171| Find Computers with Unsupported OS | Legacy systems for exploitation |172| Find Users with DCSync Rights | Accounts that can replicate AD |173| Find GPOs that Modify Local Group Membership | GPO-based privilege escalation |174175## Validation Criteria176177- [ ] SharpHound data collected from all domains178- [ ] Attack paths identified from owned accounts to DA179- [ ] ACL-based attack paths documented180- [ ] Kerberoastable and AS-REP roastable accounts identified181- [ ] Exploitation plan created with prioritized paths182- [ ] Evidence screenshots captured for report183184## Process1851861. Analyze the task requirements1872. Apply domain expertise1883. Verify output quality189190## Anti-Rationalization Table191192| Rationalization | Reality |193|---|---|194| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |195| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |196| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |