检查电脑中是否存在危险证书

检查电脑中是否存在危险证书

原文:https://kompost.cn/posts/check-and-remove-untrusted-cert/

  1. 下载软件:https://learn.microsoft.com/zh-cn/sysinternals/downloads/sigcheck
  2. 分别运行两个命令:
  • sigcheck.exe -tv
  • sigcheck.exe -tuv

删除证书

方法一:手动删除
打开 certlm.msc 和 certmgr.msc 里,在“受信任的根证书颁发机构”和“第三方根证书颁发机构”里找到对应的根证书,右键菜单删除。
方法二:使用以下 Powershell 脚本。(功能接口参考3)
脚本文件命名为 remove-rootca.ps1
在 Powershell 命令行窗口中执行 . .\remove-rootca.ps1 -Thumbprint 59973EC928CD924B5E4DC2ABAC727301ACCFDCAC 删除指定的根证书
系统存储中的证书需要在管理员权限下执行,否则提示拒绝访问

param(
[string]$Thumbprint=$(throw "Parameter missing: -Thumbprint Thumbprint")
)

$CAStores="cert:\currentuser\root", "cert:\currentuser\authroot", "cert:\localmachine\root", "cert:\localmachine\authroot"

$exist = 0
foreach ($store in $CAStores) {
    $location = $store+"\"+$Thumbprint
    if(Test-Path -Path $location) {
        $exist = 1
        Remove-Item  -Path $location -Force
    }    
}
if ($exist -eq 0) {
    Write-Host "Thumbprint does not exist."
}
posted @ 2022-12-23 23:31  佰大于  阅读(154)  评论(0编辑  收藏  举报