# 關於 Windows 重大 CredSSP 更新導致遠端桌面連線無法連接的解決辦法

最近微軟 2018 三月的資安公告釋出了數個安全性更新，也隨著最近的 Windows Update 一同發佈，同時也解決了一個 **高安全性風險** 的 [CVE-2018-0886](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0886) 弱點。這個弱點會讓你在透過 [CredSSP](https://msdn.microsoft.com/zh-tw/library/windows/desktop/bb931352.aspx) 進行身分驗證的時候遭遇攻擊，可讓駭客執行任意程式碼，影響範圍遍及 Microsoft Windows Server 2008 SP2 and R2 SP1, Windows 7 SP1, Windows 8.1 and RT 8.1, Windows Server 2012 and R2, Windows 10 Gold, 1511, 1607, 1703, and 1709 Windows Server 2016 and Windows Server, version 1709 等版本。首當其衝的就是 **遠端桌面連線** (RDP) 正好就會用到 CredSSP 來進行認證，所以在座的各位都是高危險群啊！本篇文章將說明如何解決這個問題！

### 問題解說

基本上，當你的 Windows 自動更新後，如果透過 **遠端桌面連線** (RDP) 連到遠端主機，很有可能會全都出現如下圖的錯誤訊息。

![image](https://stwillblogassets.blob.core.windows.net/files/images/external/user-images.githubusercontent.com/a56b84f4801c2c391e40-45995721-d89f1b00-c0cb-11e8-9336-e0207363dc1e.png)

也就是你會完全連不到遠端伺服器！

解決方法有兩種：

1.  同時將**用戶端**與**伺服器端**全部都一起套用 Windows 更新，改用安全的方式進行遠端通訊！
2.  透過**調整機碼**暫時降低目前用戶端電腦的安全性，先連到遠端電腦再說，等遠端電腦更新完畢後，再將設定調整回來即可！

### 應變方案 (Workaround)

以下是透過**調整機碼**的快速設定方法：

-   先降低安全性暫時可連線到遠端電腦
    
    ```bash
    reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP\Parameters" /f /v AllowEncryptionOracle /t REG_DWORD /d 2
    ```
    
-   回復預設的安全性設定
    
    ```bash
    reg DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\CredSSP" /f
    ```
    

**參考資料**

-   [Unable to RDP to Virtual Machine: CredSSP Encryption Oracle Remediation – Azure Compute](https://blogs.technet.microsoft.com/mckittrick/unable-to-rdp-to-virtual-machine-credssp-encryption-oracle-remediation/)
-   [CVE - CVE-2018-0886](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-0886)
-   [NVD - CVE-2018-0886](https://nvd.nist.gov/vuln/detail/CVE-2018-0886)
-   [CredSSP updates for CVE-2018-0886: March 13, 2018](https://support.microsoft.com/en-us/help/4093492/credssp-updates-for-cve-2018-0886-march-13-2018)
-   [Credential Security Support Provider protocol (CredSSP)](https://msdn.microsoft.com/zh-tw/library/windows/desktop/bb931352.aspx)
-   [本篇文章相關貼文 - Will 保哥的技術交流中心](https://www.facebook.com/will.fans/photos/a.182809331748219/2092368240792309/?type=3&theater&ifg=1)
