Locksmith: find and fix common misconfigurations in Active Directory Certificate Services
Locksmith
A tool built to find and fix common misconfigurations in Active Directory Certificate Services.
Installation
Module
Install module from the PowerShell Gallery (preferred):
- Open a PowerShell prompt and run Install-Module -Name Locksmith -Scope CurrentUser
Install the module manually from GitHub:
- Download the latest module version ( Locksmith-v<YEAR>.<MONTH>.zip )
- Extract the downloaded zip file
- Open a PowerShell prompt to the location of the extracted file and run Import-Module Locksmith.psd1
Script
Download the standalone script (classic) without the module:
- Download the latest script version
- Extract the downloaded zip file
Run Locksmith
Mode 0: Identify Issues, Output to Console (Default)
Running Invoke-Locksmith.ps1 with no parameters or with -Mode 0 will scan the current Active Directory forest and output all discovered AD CS issues to the console in Table format.
# Module Syntax
Invoke-Locksmith
# Script Syntax
.\Invoke-Locksmith.ps1
Example Output for Mode 0
Mode 1: Identify Issues and Fixes, Output to Console
This mode scans the current forest and outputs all discovered AD CS issues and possible fixes to the console in List format.
# Module Syntax
Invoke-Locksmith –Mode 1
# Script Syntax
.\Invoke-Locksmith.ps1 –Mode 1
Example Output for Mode 1
Mode 2: Identify Issues, Output to CSV
Locksmith Mode 2 scans the current forest and outputs all discovered AD CS issues to ADCSIssues.CSV in the present working directory.
# Module Syntax
Invoke-Locksmith –Mode 2
.\Invoke-Locksmith.ps1 –Mode 2
Example Output for Mode 2
Mode 3: Identify Issues and Fixes, Output to CSV
In Mode 3, Locksmith scans the current forest and outputs all discovered AD CS issues and example fixes to ADCSRemediation.CSV in the present working directory.
# Module Syntax
Invoke-Locksmith –Mode 3
# Script Syntax
.\Invoke-Locksmith.ps1 –Mode 3
Example Output for Mode 3
Mode 4: Fix All Issues
Mode 4 is the “easy button.” Running Locksmith in Mode 4 will identify all misconfigurations and offer to fix each issue. If there is any possible operational impact, Locksmith will warn you.
# Module Syntax
Invoke-Locksmith –Mode 4
# Script Syntax
.\Invoke-Locksmith.ps1 –Mode 4
Scans: Select Which Scans to Run
Use the -Scans parameter to choose which vulnerabilities to scan for. Acceptable values include All, Auditing, ESC1, ESC2, ESC3, ESC4, ESC5, ESC6, ESC8, or PromptMe. The PromptMe option presents an interactive list allowing you to select scans.