National Cyber Warfare Foundation (NCWF)login

Locksmith2 for auditing Active Directory Certificate Services misconfigurations


0 user ratings
2026-10-23 07:25:43
milo
Red Team (CNA)
"Locksmith2

Locksmith2 is a PowerShell module that finds and reports security misconfigurations in Active Directory Certificate Services (AD CS) for administrators and authorized security teams.








Tooljakehildreth/Locksmith2 — a PowerShell toolkit for discovering and remediating AD CS misconfigurations across an Active Directory forest
CategoryPowerShell security auditing module for Active Directory Public Key Infrastructure
Primary UseEnumerating certificate templates, CA configuration, and enrollment settings to find attack-prone AD CS misconfigurations during authorized audits
Safe UseIntended for AD administrators, defensive security professionals, and red teamers operating strictly within authorized engagements, internal hardening programs, or lab environments they own
Telemetry NoteLocksmith2 is read-oriented: it queries AD and AD CS objects via PowerShell, so defenders can observe lightweight LDAP enumeration and certificate-enrollment inspection originating from the host running it, plus standard PowerShell module load events in script-block logging

Locksmith2 is the second iteration of a well-regarded PowerShell toolkit aimed squarely at one of the most abused corners of enterprise Windows infrastructure: Active Directory Certificate Services. The repository's own framing — a kit for AD administrators, defensive security professionals, and red teamers — signals that this is a dual-audience tool, but its center of gravity is clearly defensive. Where offensive tooling like Certify popularized the abuse of AD CS for privilege escalation and persistence, Locksmith2 approaches the same attack surface from the remediation side: find what is dangerously misconfigured before someone else does.


The context available for this writeup is unusually thin — the repository metadata is present, but the README body did not come through, and the third-party directory entry contributed nothing substantive. What we can verify directly: the project lives at jakehildreth/Locksmith2, it is written in PowerShell, it is published as a powershell-module, and its topic tags are explicit about scope: active-directory, active-directory-certificate-services, ad-cs, adcs, and pki. At roughly 112 stars it sits in that credible mid-tier of community adoption — enough traction to indicate real-world use, not enough to suggest hype-driven noise.


The choice of PowerShell as the implementation language is itself informative about the intended workflow. Certificate services auditing is fundamentally an exercise in reading configuration state out of AD — templates stored as objects in the configuration naming context, enrollment rights expressed as ACLs, CA settings retrievable through native PKI cmdlets. A PowerShell module means the tool runs wherever an administrator already has a shell, requires no agent or external binary, and can be dropped into existing hardening pipelines. It also means the tool inherits whatever credentials and directory permissions the operator already holds, which keeps its footprint honest: it asks the directory questions an admin could ask manually, just faster and more consistently.


The threat model Locksmith2 exists to address is well documented in the broader research community. AD CS misconfigurations — overly permissive certificate templates, enrollment rights granted to broad groups, ESC-style template settings that allow requesting certificates for arbitrary principals or authentication — have become a standard escalation and persistence path in real intrusions. The taxonomy of these misconfigurations was largely systematized by public research in 2021, and tools on both sides of the line have proliferated since. What distinguishes an auditing tool like Locksmith2 from its offensive counterparts is intent and output: rather than requesting certificates to demonstrate compromise, it maps the configuration landscape and produces findings an administrator can act on.


Because the README is not available in this context, we will not enumerate specific subcommands, output formats, or detected misconfiguration classes — inventing them would violate basic documentary discipline. What the metadata does support is the tool's positioning within the AD CS ecosystem. The Locksmith lineage is known for a specific philosophy: close the gap between research and remediation. Where a blog post tells you that a template is dangerous, an auditing tool tells you which of your templates are dangerous, and a good one tells you how to fix them. The 2 in the name suggests a rewrite rather than a patch, which typically reflects lessons learned about performance at forest scale and about output that fits operational workflows.


For administrators, the practical value of tooling like this is coverage and repeatability. AD CS environments accumulate templates over years — defaults, duplicates of defaults, vendor-required templates, and templates nobody remembers creating. Manual review does not scale to that, and manual review performed once does not survive the next change request. A PowerShell module can be scheduled, version-controlled, and wired into change management so that a newly misconfigured template surfaces within a review cycle rather than during an incident. That cadence matters, because AD CS misconfigurations are often introduced by well-meaning administrators chasing an enrollment error, not by attackers.


For authorized red teamers, the same tool serves as a scoping instrument. Understanding the certificate attack surface before an engagement — and, critically, staying inside the rules of engagement — is the difference between a useful finding and an unauthorized act. Running configuration discovery against a lab or an in-scope domain to identify which escalation paths plausibly exist lets the operator report impact without necessarily exercising it. This documentary framing is deliberate: this article does not provide exploitation chains, and the tool itself is best understood as a configuration auditor rather than an attack tool.


From a defensive telemetry standpoint, running Locksmith2 inside your own environment is quiet by design but not invisible. It performs directory enumeration — LDAP queries against the configuration context, reads of certificate template objects — which sophisticated monitoring can correlate as reconnaissance-like volume from an administrative host. PowerShell script-block and module logging will record the module import and its cmdlet invocations. None of this is malicious, and that is precisely the point: defenders who see this pattern from a sanctioned hardening host should recognize it as an internal audit, while the same enumeration pattern from an unmanaged endpoint warrants a very different response.


What to watch for in evaluating this tool for production use: first, confirm the module's permissions model — a read-only auditor should require nothing beyond directory read access, and any write-path remediation guidance should be reviewed manually before applying changes to a live PKI. Second, certificate services changes have outsized blast radius; a template misread or an overzealous remediation can break device enrollment, TLS issuance, or smart-card logins. Treat the tool's output as a findings list for change-controlled review, not an auto-remediation script. Third, note the repository's license is flagged as non-standard (NOASSERTION), so commercial-use terms deserve a check before wide internal deployment.


Placed in the broader landscape, Locksmith2 occupies the same niche for PKI that tools like BloodHound-style auditors occupy for AD graph relationships: it converts a sprawling, poorly understood configuration surface into a prioritized list of problems. That category of tooling has proven decisive in mature programs, because the hardest part of AD CS security is not understanding the attack techniques — the public research is thorough — but simply knowing what your own forest actually contains. For that inventory-and-triage problem, a maintained, PowerShell-native auditor like Locksmith2 is a reasonable addition to an authorized hardening toolkit.



Official project repository for jakehildreth/Locksmith2.

Download Tool

Educational analysis for authorized security professionals. Use only in controlled, authorized environments.






Source: OffensiveSec
Source Link: https://www.offsecblog.com/2026/10/locksmith2-for-auditing-active.html


Comments
new comment
Nobody has commented yet. Will you be the first?
 
Forum
Red Team (CNA)



Copyright 2012 through 2026 - National Cyber Warfare Foundation - All rights reserved worldwide.