Shadow Credentials in Active Directory: When the Exploit Doesn’t Work — Until It Does
The author describes using Shadow Credentials in an Active Directory lab: injecting a public key into the msDS-KeyCredentialLink attribute of a computer account to obtain a TGT and NTLM hash. Standard PKINIT tools failed, but Metasploit's modules succeeded in adding the credential and extracting the ticket and hash.
As someone who spends a good portion of their days exploring the darker corners of enterprise networks, I’ve come to appreciate just how deep the rabbit hole goes with Active Directory (AD). One attack vector that had me both frustrated and fascinated is the use of Shadow Credentials — a stealthy technique for…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely a misconfiguration that allowed the attacker to modify the msDS-KeyCredentialLink attribute of the DC$ computer account, enabling PKINIT authentication with an injected key.
Impact
An attacker with rights to modify the attribute could obtain a TGT and NTLM hash for the DC$ machine account, enabling persistence and further attacks such as DCSync.
What the attacker needed
Rights to modify msDS-KeyCredentialLink; access to the domain; Windows Server 2016 or later
How it was found
- Use Metasploit's shadow_credentials module to add a shadow credential to the DC$ machine account.
- Use Metasploit's get_ticket module with the generated .pfx file to request a TGT and extract the NTLM hash.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Active Directory is a directory service used by many companies to manage users and computers. Shadow Credentials is a technique where an attacker who can modify a certain attribute on an account adds their own public key, letting them log in as that account without knowing its password. In this lab, the author used Metasploit to do this and then obtained a ticket and password hash for a domain controller computer account.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.