Skip to content

Certificate Sign-In (PKINIT)

A certificate takes the timestamp's place, and the DC hands back the NT hash for NTLM.

  • Kerberos

Why It Matters

A certificate that maps to an account signs in as that account until it expires or is revoked, whatever happens to the password. It also yields the account's NT hash, so a misissued or stolen certificate gives NTLM access too.

What Happens

With PKINIT, the AS request carries data signed with the certificate's private key in place of an encrypted timestamp, and the reply key is protected with public-key cryptography instead of the password. The DC maps the certificate to an account, then issues a TGT as it would for a password, writing event 4768 to its Security log with the certificate's issuer, serial number and thumbprint.

Mapping is the deciding check. A strong mapping ties the certificate to one account by something that cannot be reused, such as the account's SID inside it or an explicit mapping by issuer and serial number. Since KB5014754 became enforced by default in February 2025, with compatibility mode removed that September, DCs refuse a certificate that maps only by a name or carries another account's SID, writing Kdcsvc event 39 or 41 to the System log.

Key Trust needs no certificate issued to the account. The DC finds the account by public key and accepts it if the account's msDS-KeyCredentialLink attribute holds that key, which is how Windows Hello for Business key trust signs in. Write access to that attribute therefore lets someone sign in as the account, as a password reset would, and deserves the same auditing.

Because no password is involved, the DC puts the account's NTLM credentials, its NT hash, in the PAC, encrypted with the AS reply key, so NTLM single sign-on still works. A certificate therefore gives the NT hash too, and a password reset does not cancel it. Revoke the certificate, and remove any mapping or key that should not be there.

A certificate for a privileged account can come from a template that lets the requester name the subject, or from a sign-in relayed to web enrolment, which the Certificate Services abuse page covers. On the certification authority (CA), events 4886 and 4887 in the Security log record each request and each certificate issued, where Certification Services auditing and the CA's audit filter are on.

How a DC Ties a Certificate to an Account

A domain controller trusts a certificate only as far as its mapping to an account. These are the ways a DC can tie the two, and KB5014754 rates each one as strong or weak.

MappingStrength
The account's SID, in the certificate's security extensionStrong
An explicit mapping by issuer and serial number, subject key identifier or public key hashStrong
Key Trust, by the public key held in msDS-KeyCredentialLinkStrong
The UPN or DNS name in the subject alternative nameWeak
An explicit mapping by issuer and subject, subject alone, or email addressWeak

What Is Logged

Each event below names the log it is written to, the machine that writes it and the audit setting that switches it on, then what to read in it for this page.

Event and LogWritten OnSwitch It OnWhat It Tells You
4768 A Kerberos authentication ticket (TGT) was requested (opens in a new tab) Security logDomain controllersAudit Kerberos Authentication ServiceCertificate Issuer Name, Certificate Serial Number and Certificate Thumbprint are filled only for a certificate sign-in.AS Reply: The TGT explains how to read it.
39 to 41 No strong mapping, Certificate predates account, Users SID does not match Certificate SID (opens in a new tab) System logDomain controllersDomain controllers with the May 2022 or later updates (KB5014754)It flags a certificate with no strong mapping (39) or one holding another account's SID (41). Event 40 in the same log, for a certificate older than its account, was written only in the old compatibility mode.
4887 Certificate Services approved a certificate request and issued a certificate (opens in a new tab) Security logThe certification authorityAudit Certification Services on the CA, and the events picked on its Auditing tab (the CA audit filter)It records each certificate issued, with its requester, request attributes and subject. It has no field for a subject alternative name in the request's extensions, which the CA database holds.

Check It on a Machine

These Windows Registry keys hold the settings this page names. Open one to see where it lives and how to read it on a machine.

Attacks That Hook in Here

These attacks work through what this page describes. Each card says what the attack is and, where it uses one of these steps, what it does there.

  • Certificate Services Abuse

    Gets a certificate that signs in as another account, often a Domain Admin.

  • NTLM Relay

    Passes a victim's NTLM sign-in to another server and keeps the session it opens.

  • Shadow Credentials

    A key added to an account lets a certificate sign in as it, past a password reset.

Sources