Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
A shadow credentials attack adds an attacker-controlled public key to an Active Directory account, creating a second, certificate-based way to authenticate as that account indefinitely.

What Is a Shadow Credentials Attack?
A shadow credentials attack writes an attacker-controlled key pair into the msDS-KeyCredentialLink attribute of an Active Directory user or computer object. That attribute exists to support Windows Hello for Business, which lets a user authenticate with a device-bound key instead of a password. Adding an entry to it therefore does not change the account’s password or lock anyone out—it simply gives the account a second valid way to authenticate, one that the attacker controls.
Elad Shamir described the technique in 2021 in “Shadow Credentials: Abusing Key Trust Account Mapping for Account Takeover”, and it has largely displaced resource-based constrained delegation as the preferred follow-up to write access on an object.
Key Trust authentication relies on Kerberos PKINIT, the extension that allows a certificate to be presented for initial authentication instead of a password-derived key. When a client authenticates this way, the domain controller checks the presented public key against the msDS-KeyCredentialLink values on the account and, if it matches, issues a ticket-granting ticket.
The attack sequence is short:
GenericWrite, GenericAll, WriteProperty on that attribute, or membership of Key Admins—they append a key credential structure containing their public key.Whisker, pywhisker, Certipy’s shadow auto command, and the --shadow-credentials option in Impacket’s ntlmrelayx all automate this. The relay option matters: a coerced authentication relayed to LDAP is enough to write the attribute, with no prior access to the target at all.
Compared with the delegation route, shadow credentials is quieter and has fewer prerequisites. It does not require creating a computer account, so MachineAccountQuota being set to zero is no obstacle. It does not require the target to have a service principal name. And it does not alter the account’s password, so the legitimate user continues working and nothing prompts an investigation.
It is also durable. The added key remains valid until somebody notices and removes it. An account whose password is reset on a schedule is unaffected, because the certificate path does not involve the password at all—which makes this a persistence mechanism as much as an escalation one.
The environment must support PKINIT, which in practice means a domain controller holding a certificate suitable for the Kerberos Authentication or Domain Controller Authentication template—typically because Active Directory Certificate Services is deployed. Domain functional level 2016 or higher is needed for the key trust mapping. Many organisations meet both conditions without having deliberately enabled anything, because AD CS was installed years ago for another purpose.
msDS-KeyCredentialLink. Legitimate changes come from Windows Hello for Business enrolment on user accounts; a change to a computer object, or to a privileged account outside enrolment, is worth immediate investigation. This is a high-fidelity detection and one of the best returns available in Active Directory monitoring.GenericWrite and GenericAll grants on user and computer objects, which BloodHound reports directly.msDS-KeyCredentialLink and confirm each corresponds to a genuine Windows Hello enrolment. Computer objects with entries are particularly suspicious.If you are not using Windows Hello for Business at all, any value in that attribute anywhere in the domain is an anomaly, which makes the review trivial and the detection even stronger.
Our internal Penetration Test Services test this path alongside the broader Active Directory Certificate Services configuration, because the two share the same underlying dependency and the same remediation owners.
No, and that is a large part of why it is effective. The attacker adds an alternative certificate-based authentication path while the existing password continues to work normally. The legitimate user notices nothing, no lockout occurs, and routine password rotation does not remove the attacker’s access, because the certificate route never involves the password.
Write access to the msDS-KeyCredentialLink attribute on the target object. In practice this means GenericWrite, GenericAll, WriteProperty on that attribute, or membership of Key Admins or Enterprise Key Admins. Such permissions are frequently held by help desk groups, deployment accounts, and inherited organisational unit grants that nobody reviewed, which is why the attack surfaces so often in testing.
Possibly, because the requirement is that the domain supports PKINIT rather than that you have deployed Windows Hello. If a domain controller holds a suitable authentication certificate, usually because Active Directory Certificate Services is installed, key trust mapping will work. The upside is that any populated msDS-KeyCredentialLink value is then unambiguously suspicious and trivial to alert on.
Clear the attacker’s entry from the account’s msDS-KeyCredentialLink attribute, then treat the account as compromised: reset its password, and for a computer account reset the machine account so existing tickets are invalidated. Investigate how the write permission was obtained, because the underlying excessive privilege will otherwise allow the same thing to be done again.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.