resource-based-constrained
Privilege Escalation – Constrained Delegation - Kerberos Only
It requires an additional forwardable ticket to invoke S4U2Proxy. We cannot use S4U2Self as the service doesn’t have TRUSTED_TO_AUTH_FOR_DELEGATION value configured.
Methodology
Create a new Machine Account
Configure RBCD on the machine configured with Constrained Delegation.
Obtain a TGS/Service Ticket for the machine configured with Constrained Delegation by leveraging the newly created Machine Account.
Request a new forwardable TGS/Service Ticket by leveraging the ticket created in previous step.
Get machine with constrained delegation using PowerView
Get-DomainComputer -TrustedToAuthGet machines with constrained delegation using ADModule
Get-ADObject -LDAPFilter "(msDS-AllowedToDelegateTo=*)" -Properties msDS-AllowedToDelegateToCreate new machine accouunt (use Powermad.ps1)
By default, any domain user can join up to 10 computers to domain (ms-DS MachineAccountQuota is set 10).
Import-Module C:\AD\Tools\Powermad\Powermad.ps1
New-MachineAccount -MachineAccount new_machine_accountInject original machine account TGT in session
Configure TRUST_TO_AUTH_FOR_DELEGATION
Convert password of new machine account to NTLM hash
Obtain a TGS/Service Ticket for the machine configured with Constrained Delegation using new machine account
Request a new forwardable TGS/Service Ticket by leveraging the ticket created in previous step (S4U2Proxy).
Access the us-mssql using WinRM
Resource Based Constrained
With GenericWrite or GenericAll on a computer, you can enable constrained delegation to laterally move
Methodology
Enumerate if the compromised user has GenericWrite or GenericAll over a machine (BloodHound recommended!).
Compromise or create a machine account.
Set RBCD on the target machine (the one you want to access), allowing it to trust the compormised or created machine.
Impersonate a high value target only on target machine.
Powershell
[!INFO] Remember to follow the Powershell methodology
Powerview
PAY ATTENTION: If we already have compromised a domain machine, we can skip the machine creation part and use its AES key (SID: S-1-5-18).
Check for GenericWrite/GenericAll:
Check if domain controller is at least Windows 2012:
Check if ms-ds-machineaccountquota is enabled:
Check if target machine doesn't have msds-allowedtoactonbehalfofotheridentityattribute set:
Create a new computer object: https://github.com/Kevin-Robertson/Powermad/blob/master/Powermad.ps1
Active Directory Module
Configure RBCD on target:
Now, let's get the privileges of studentx$ by extracting its AES keys:
Get TGS for HTTP service by impersonating Admin
Last updated