如何在 Windows 11 中禁用(啟用)Credential Guard

Jacki

憑證衛士最新版本 Windows 中的安全功能可保護帳戶免遭盜竊和未經授權的使用,包括哈希傳遞和票證傳遞攻擊。 Credential Guard 使用基於虛擬化的安全性 (VBS) 在安全的虛擬環境(容器)中隔離敏感憑據,例如 NTLM 密碼哈希、Kerberos 票證、其他憑據和機密。安全啟動和可信平台模塊 (TPM) 等硬件功能用於保護憑據。這些憑據只能由特權系統軟件訪問,這可以防止惡意軟件或攻擊者竊取它們,即使他們獲得了本地管理員權限。

Windows Defender Credential Guard 會在滿足以下要求的兼容設備上自動啟用:

  • Windows 11 22H2(或更高版本)的企業版或教育版(一些 Credential Guard 和基於虛擬化的安全組件也可在專業版中使用)或 Windows Server 2025。
  • TPM 1.2 或 2.0 模塊
  • UEFI鎖
  • 安全啟動已啟用
  • 該設備支持基於虛擬化的安全性,並具有 64 位 CPU,支持高級虛擬化和 SLAT(二級地址轉換)。
  • Windows功能中啟用了Hyper-V虛擬化平台(HypervisorPlatform):Enable-WindowsOptionalFeature -Online -FeatureName HypervisorPlatform

啟用 Credential Guard 在以下情況下可能會導致問題:

  • 如果使用 NTLM 身份驗證,Credential Guard 會阻止保存 RDP 連接的密碼。
  • 用戶無法運行 VMware Workstation (Player) 或 VirtualBox 虛擬機並出現錯誤:
    VMware Workstation and Device/Credential Guard are not compatible. 
    VMware Workstation can be run after disabling Device/Credential Guard.

  • 不建議在域控制器上使用 Credential Guard。這不會提高安全性,並且可能會導致與第三方應用程序的兼容性問題。
  • 使用不安全身份驗證方法(例如 NTLMv1 或不受約束的 Kerberos 委派)的應用程序將無法運行。
  • 啟用 Credential Guard 後,單點登錄 (SSO) 身份驗證在遠程桌面服務 (RDS) 主機上不起作用
  • 用戶無法在使用 MSCHAPv2 身份驗證協議(包括 PEAP-MSCHAPv2 和 EAP-MSCHAPv2)的 Wi-Fi 接入點或 VPN 服務器上進行身份驗證

運行以下 PowerShell 命令來檢查 Windows 中是否啟用了 Credential Guard:

(Get-CimInstance -ClassName Win32_DeviceGuard -Namespace rootMicrosoftWindowsDeviceGuard).SecurityServicesRunning

更多閱讀:如何修復 Credential Guard 無法在 Windows 11 中運行

  • 1– 啟用憑證保護
  • 0– 禁用

為了在計算機上禁用 Credential Guard,需要配置許多設置:

  1. 打開本地 GPO 編輯器(gpedit.msc)並轉到計算機配置 -> 管理模板 -> 系統 -> Device Guard。設定打開基於虛擬化的安全性參數為殘疾人
  2. 創建兩個註冊表參數。將值設置為0對於兩者:
    reg add HKLMSYSTEMCurrentControlSetControlLsa /f /v LsaCfgFlags /t REG_DWORD /d 0
    reg add HKLMSOFTWAREPoliciesMicrosoftWindowsDeviceGuard /f /v LsaCfgFlags /t REG_DWORD /d 0
    當不使用 UEFI 鎖來防止 UEFI 固件設置發生更改時,這會禁用 Credential Guard。
  3. 如果啟用了 UEFI 鎖,請運行以下命令。要應用設置,您將需要訪問計算機的控制台。以管理員身份打開命令提示符,掛載 EFI 系統分區,然後在 Windows 引導加載程序配置 (BCD) 中創建新的臨時條目,以在禁用 Credential Guard 和基於虛擬化的安全性的模式下運行 EFI 引導加載程序:
    mountvol X: /s
    copy %WINDIR%System32SecConfig.efi X:EFIMicrosoftBootSecConfig.efi /Y
    bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d "DebugTool" /application osloader
    bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path "EFIMicrosoftBootSecConfig.efi"
    bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
    bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO
    bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} device partition=X:
    mountvol X: /d
  4. 重新啟動計算機。計算機啟動期間系統將提示您禁用 Credential Guard:
    Credential Guard Opt-out Tool
    Do you want to disable Credential Guard?
    Disabling this functionality can allow malware to read the password and other credentials of all users signing on to Windows. For the correct action in your organization, contact your administrator before disabling protection.
    

  5. F3在幾秒鐘內確認禁用 Credential Guard(否則,對引導加載程序的更改將被取消)。

檢查 Credential Guard 現已禁用:

您還可以使用官方 PowerShell 腳本(Device Guard 和 Credential Guard 硬件準備工具),在支持的設備上啟用或禁用 Credential Guard 和 Device Guardhttps://www.microsoft.com/en-my/download/details.aspx?id=53337

下載dgreadiness_v3.6.zip並將其解壓到本地目錄:

cd C:PSdgreadiness_v3.6

如果您的 PowerShell 腳本執行設置阻止第三方 PS1 文件運行,請在當前會話中啟用腳本執行:

Set-ExecutionPolicy -Scope Process RemoteSigned

檢查啟用了哪些 Defender 安全功能。

DG_Readiness_Tool_v3.6.ps1 -Ready

要禁用 Credential Guard,請運行:

DG_Readiness_Tool_v3.6.ps1 -Disable -CG

重新啟動計算機並按F3 確認 Credential Guard 的禁用。