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

ESC5

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


Direct Indicators

LogEvent IDMeaningForensic ValueNotes
Security5136Directory object modifiedCriticalESC5 involves modification of PKI objects in the Configuration partition (e.g., NTAuthCertificates or CA objects). Review ObjectDN and AttributeLDAPDisplayName.
Security4886Certificate issuedHighCertificates issued after PKI configuration modification may indicate abuse.
Security4887Certificate request approvedMediumUnexpected certificate approvals after PKI object changes.
Security4768Kerberos TGT requestHighCertificate obtained through malicious PKI configuration may be used via PKINIT.
Security4624Successful logonHighCertificate-based authentication events following configuration changes.
Sysmon1Process creationMediumExecution of ADCS exploitation tools such as Certipy, Certify, or PowerView.
Sysmon3Network connectionMediumConnections to domain controllers or CA servers during configuration manipulation.

Indirect Indicators

IndicatorWhat To Look ForForensic ValueNotes
Modification of NTAuthCertificatesChanges to trusted CA certificates in ADCriticalAttackers may add rogue CA certificates enabling authentication with forged certificates.
Changes in PKI configuration objectsModification of objects in CN=Public Key Services,CN=Services,CN=ConfigurationCriticalKey location for ESC5 exploitation.
Unexpected certificate trust relationshipsNew CA certificates appearing in NTAuth storeHighIndicates attacker may be introducing rogue certificate authority.
Certificate authentication after configuration changeUser authenticates via certificate shortly after PKI modificationHighPossible forged certificate usage.
Privileged activity after authenticationAdministrative actions performed shortly after certificate logonCriticalIndicates attacker leveraging forged authentication certificates.

Common Tools

ToolUsage
CertipyEnumerates and abuses PKI misconfigurations including ESC5.
CertifyUsed to interact with certificate services and enumerate vulnerabilities.
PowerViewModifies AD objects including PKI configuration containers.
ForgeCertUsed to generate forged certificates if attacker controls trusted CA.
RubeusRequests Kerberos tickets using forged certificates.

Relevant Artifacts

  • Domain controller Security logs (5136)
  • ADCS logs (4886, 4887)
  • Configuration partition objects in AD
  • NTAuthCertificates container
  • Certificate Authority trust configuration
  • Sysmon logs (1, 3)
  • PKINIT authentication logs
  • EDR telemetry identifying certificate abuse tools
  • Prefetch artifacts showing Certipy / PowerView execution

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 PKI configuration objects.
  2. What host generated the event?
    • Determine which host modified the PKI container in AD.
  3. Is the account expected to perform this action?
    • Only PKI administrators should modify CA trust configuration.
  4. Pivot:
    • Source host → inspect execution of Certipy or PowerView.
    • Account → review privileges and recent permission changes.
    • Network → inspect certificate-based authentication events.
  5. Confirm exploitation
    • Determine whether rogue CA certificates were added and used for authentication.

Example Detection Templates

KQL

SecurityEvent
| where EventID == 5136
| where ObjectDN contains "Public Key Services"
| 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 Configuration Modification
id: adcs-esc5-detection
status: experimental
description: Detects modification of PKI configuration objects which may enable ESC5 abuse
logsource:
  product: windows
  service: security
detection:
  selection:
    EventID: 5136
  condition: selection
fields:
  - SubjectUserName
  - ObjectDN
falsepositives:
  - Legitimate PKI administration
level: high
tags:
  - attack.persistence
  - attack.t1098

Mitigation & Hardening

Control AreaMitigationEffectivenessNotes
PKI object protectionRestrict modification of PKI configuration containersCriticalPrevents attackers altering CA trust relationships.
PKI auditingAudit changes to Public Key Services objects in ADHighDetects ESC5 attempts early.
CA trust monitoringRegularly review trusted CA certificates in NTAuth storeHighEnsures rogue CAs are not introduced.
Administrative separationUse dedicated PKI admin accountsHighReduces misuse of privileges.
Security monitoringAlert on Event 5136 for PKI objectsHighProvides early warning of configuration tampering.