Created
November 20, 2025 20:27
-
-
Save secdev02/055eea4d4356d1bb48540cf22f7f5c95 to your computer and use it in GitHub Desktop.
Hunt for Certificates with Private key - Could be sus
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Simple list of all certificates with private keys | |
| Write-Host "=== All Certificates with Private Keys ===" -ForegroundColor Green | |
| $certs = @() | |
| $certs += Get-ChildItem -Path Cert:\LocalMachine -Recurse | Where-Object { $_.HasPrivateKey } | |
| $certs += Get-ChildItem -Path Cert:\CurrentUser -Recurse | Where-Object { $_.HasPrivateKey } | |
| $certs | Select-Object Subject, Thumbprint | Format-Table -AutoSize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment