githubEdit

Kerberos Delegation

Kerberos delegation: allows services to impersonate the user in order to communicate with another service and perform actions on behalf the user.


circle-exclamation

Unconstrained Delegation

Unconstrained Delegation allowing any service to use a user TGT in order to communicate with the any other service.

The TGT will be stored in the LSASS process.

Enumerate

# powerView
Get-NetComputer -Unconstrained
Get-DomainComputer -UnConstrained
Get-DomainComputer -Unconstrained -Properties DnsHostName
Get-DomainComputer -unconstrained | select samaccountname

# AD Module
Get-ADComputer -Filter {TrustedForDelegation -eq $True}
Get-ADUser -Filter {TrustedForDelegation -eq $True}
Get-ADComputer -Filter {TrustedForDelegation -eq $true -and primarygroupid -eq 515} -Properties trustedfordelegation,serviceprincipalname,description
Get-ADComputer -LDAPFilter "(userAccountControl:1.2.840.113556.1.4.803:=524288)"
Get-ADComputer "IIS" -Properties TrustedForDelegation, TrustedToAuthForDelegation,msDS-AllowedToDelegateTo,PrincipalsAllowedToDelegateToAccount

Exploitation

Kali

and also you can use Coercerarrow-up-right to forced Authentication with the server or DC has Unconstrained Delegation using any domain user

Windows

It is possible to extract the TGTs from the service's LSASS process using Mimikatz and perform pass the ticket.

Printer bug

The printer bug uses an RPC call of MS-RPRN (print spooler service) which allows any domain user can force any machine that running the Spooler service to connect to second a machine of the domain user's choice.

image.png

1. Run on compromised Server Rubeus monitor

  1. Run on compromised Domain User the RPC Call using SpoolSamplearrow-up-right \ Coercerarrow-up-right

  1. pass-the-ticket

  1. DCSync


Constrained Delegation

Constrained Delegation allowing specified services on specified computers to use a user TGT in order to communicate with the any other service.

in order to create a more restrictive delegation mechanism, Microsoft develop two Kerberos extensions known as Service for user (S4U):

  • Service for User to Self (S4U2self) - allows a service to obtain forwardable TGS to itself on behalf of user. (server can impersonate user in the same range)

  • Service for User to Proxy (S4U2proxy) - allows a service to obtain a TGS to another service on behalf of user. but services are from white list controlled by msDS-AllowedToDelegateTo attribute.

Enumerate

Exploitation


Resource Based Delegation

Instead of the white list of SPNs controlled by msDS-AllowedToDelegateTo attribute, resource based controlled by the msDS-AllowedToActOnBehalfOfOtherIdentity

To abuse RBCD(Resource Based Constrained Delegation ****) we need Write permissions over the target machine msDS-AllowedToActOnBehalfOfOtherIdentity attribute.

انا كماشين 1 و عايز اعمل اكسيس علي ماشين 2 فلازم انا ابقي تبع الوايت ليست اللي حطاها الماشين اللي بتستقبل الاتصال اللي هي ماشين 2 علي عكس الكونستريند دليكشين المرسل هو اللي بيحط وايت ليس للي هيستقبل

Enumerate

triangle-exclamation

Exploitation

Create fake machine

Change security descriptor

Abuse using Rubeus

Last updated