Operator On The Wire
Join
← Back to Knowledge Base
BLUE TEAM / THREAT HUNT / ACTIVE DIRECTORY / ADCS

ESC12

This note documents detection patterns related to ADCS ESC12 within Active Directory environments.


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security5136Directory object modifiedCriticalESC12 involves modification of OID objects inside the PKI configuration. Review ObjectDN and AttributeLDAPDisplayName for changes in OID mappings.
Security4886Certificate issuedHighCertificate issued after malicious OID configuration change.
Security4887Certificate request approvedMediumUnexpected approvals following PKI configuration change.
Security4768Kerberos TGT requestHighCertificate obtained through ESC12 may be used for PKINIT authentication.
Security4624Successful logonHighCertificate-based authentication after issuance.
Security4672Special privileges assignedHighPrivileged session established following certificate authentication.
Sysmon1Process creationMediumExecution of Certipy, Certify, or PowerView manipulating PKI objects.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
OID object modificationChanges to objects under CN=OID,CN=Public Key ServicesCriticalESC12 relies on manipulation of OID group link attributes.
Unexpected group linkage to certificate OIDOID mapped to privileged security groupCriticalAllows authentication certificates to grant group privileges.
Low privilege user modifying PKI configurationUnexpected actor modifying OID containerHighIndicates attacker manipulating PKI configuration.
Certificate issued shortly after OID changeEnrollment events immediately following configuration modificationHighSuggests exploitation chain.
Administrative actions after authenticationACL changes or group membership changesCriticalIndicates escalation using certificate authentication.

Common Tools

ToolUsage
CertipyEnumerates and exploits ESC12 PKI misconfigurations.
PowerViewModifies AD objects including OID container attributes.
CertifyRequests certificates after OID manipulation.
BloodHoundIdentifies privilege escalation paths involving PKI objects.
RubeusUses issued certificates for Kerberos PKINIT authentication.

Relevant Artifacts

  • Domain controller Security logs (5136)
  • ADCS server logs (4886, 4887)
  • Configuration partition objects in Active Directory
  • CN=OID,CN=Public Key Services container
  • PKINIT authentication logs
  • Sysmon logs (1)
  • EDR telemetry identifying certificate abuse tooling
  • Prefetch artifacts for Certipy or PowerView

MITRE ATT&CK References

  • T1649 Steal or Forge Authentication Certificates
  • T1550 Use Alternate Authentication Material
  • T1098 Account Manipulation
  • T1078 Valid Accounts

Decision Tree

  1. Is the suspicious event present?
    • Look for Event 5136 modifying OID objects.
  2. What host generated the event?
    • Identify system modifying PKI configuration.
  3. Is the account expected to perform this action?
    • Only PKI administrators should modify OID objects.
  4. Pivot:
    • Source host → inspect execution of Certipy or PowerView.
    • Account → review permission changes and group mappings.
    • Network → inspect PKINIT authentication events following certificate issuance.
  5. Confirm exploitation
    • Determine whether certificate authentication granted unexpected group privileges.

Example Detection Templates

KQL

SecurityEvent
| where EventID == 5136
| where ObjectDN contains "CN=OID"
| project TimeGenerated, SubjectUserName, ObjectDN, AttributeLDAPDisplayName
SecurityEvent
| where EventID == 4886
| summarize count() by CertificateTemplate, Requester, bin(TimeGenerated, 10m)

EQL

any where event.code == "5136"

Sigma

title: Suspicious PKI OID Object Modification
id: adcs-esc12-detection
status: experimental
description: Detects modification of PKI OID objects potentially enabling ESC12 exploitation
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 5136
  condition: selection
fields:
  - SubjectUserName
  - ObjectDN
falsepositives:
  - Legitimate PKI administrative operations
level: high
tags:
  - attack.persistence
  - attack.t1098

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
PKI configuration protectionRestrict modification rights to PKI containersCriticalPrevents attackers altering OID mappings.
OID auditingRegularly review OID object configurationHighDetects unauthorized changes.
Administrative separationUse dedicated PKI administrator accountsHighReduces misuse of privileges.
MonitoringAlert on Event 5136 involving OID objectsHighEarly detection of configuration tampering.
PKI security reviewConduct periodic PKI security assessmentsHighIdentifies misconfigurations enabling ESC12.