Skip to content

feat(esc13): Add ESC13 (Group-Linked OID Policy) Detection#67

Merged
jakehildreth merged 1 commit into
mainfrom
feat/esc13-detection
May 14, 2026
Merged

feat(esc13): Add ESC13 (Group-Linked OID Policy) Detection#67
jakehildreth merged 1 commit into
mainfrom
feat/esc13-detection

Conversation

@jakehildreth
Copy link
Copy Markdown
Owner

Summary

Implements detection of the ESC13 attack technique — a certificate template vulnerability where an application policy OID is linked to a universal group via msDS-OIDToGroupLink on an msPKI-Enterprise-Oid AD object. An enrollee who authenticates using a certificate issued from such a template silently gains the rights of the linked group without appearing in its member list.

Reference: https://posts.specterops.io/adcs-esc13-abuse-technique-fda4272fbd53

Changes

Data Model

  • Classes/LS2AdcsObject.ps1 — 5 new properties: CertificatePolicy, CertTemplateOID, OIDToGroupLink, HasLinkedGroupOIDPolicy, LinkedGroupOIDPolicies

New Function

  • Private/Set/Set-LinkedGroupOIDPolicy.ps1 — builds an OID→group DN lookup map from all msPKI-Enterprise-Oid objects in AdcsObjectStore, then enriches certificate template objects with the two computed properties

Detection Wiring

  • Private/Data/ESCDefinitions.ps1 — ESC13 entry with Conditions, IssueTemplate, FixTemplate, RevertTemplate
  • Private/Initialize/Initialize-AdcsObjectStore.ps1Set-LinkedGroupOIDPolicy added to template enrichment pipeline after Set-AuthenticationEKUExist
  • Public/Find-LS2VulnerableTemplate.ps1ESC13 added to ValidateSet and no-technique list; $(LinkedGroup) variable expansion added to standard enrollee issue branch
  • Private/Initialize/Initialize-LS2Scan.ps1ESC13 added to $templateTechniques
  • Public/Invoke-Locksmith2.ps1ESC13 added to $techniques

Tests

  • Tests/Private/Set/Set-LinkedGroupOIDPolicy.Tests.ps1 — 8 unit tests covering no-OID-store, unlinked OIDs, single/multiple linked groups, non-template passthrough, empty policy array
  • Tests/Public/Find-LS2VulnerableTemplate.Tests.ps1 — 7 ESC13 tests: issue returned when conditions met, correct Technique value, linked group DN in issue text, negative cases for each condition
  • Tests/Shared/TestHelpers.psm1 — default values for 5 new properties in New-MockLS2AdcsObject

Docs

  • README.MD — ESC13 added to supported techniques table and Find-LS2VulnerableTemplate cmdlet reference

Test Results

627 tests, 0 failures. Build clean (Locksmith2.v2026.5.131651.zip).

- Add 5 new LS2AdcsObject properties for OID/group-link tracking
  (CertificatePolicy, CertTemplateOID, OIDToGroupLink,
  HasLinkedGroupOIDPolicy, LinkedGroupOIDPolicies)
- Implement Set-LinkedGroupOIDPolicy to cross-reference
  msPKI-Enterprise-Oid objects in AdcsObjectStore via OID lookup map
- Add ESC13 definition to ESCDefinitions.ps1 with Conditions,
  IssueTemplate, FixTemplate, and RevertTemplate
- Wire ESC13 into Find-LS2VulnerableTemplate (ValidateSet,
  $(LinkedGroup) expansion), Initialize-AdcsObjectStore pipeline,
  Initialize-LS2Scan, and Invoke-Locksmith2
- Add 22 new tests (Set-LinkedGroupOIDPolicy + ESC13 scan path);
  627 total, 0 failures; build clean
@jakehildreth jakehildreth merged commit 4102b9c into main May 14, 2026
1 check passed
@jakehildreth jakehildreth deleted the feat/esc13-detection branch May 14, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant