如何验证是否已安装 MS17-010

声明

此知识库文章按原样提供,不会替换通过常规更新通道提供的替代数据。 可以在安全更新指南和其他附带工具中找到发生在以下数据之后的替代信息。

摘要

请参阅本文适用的产品

安全更新 MS17-010 修复了 Windows 服务器消息块 (SMB) v1 中的多个漏洞。 WannaCrypt 勒索软件正在利用作为 MS17-010 更新一部分的漏洞之一。 由于此恶意软件有若干变种,因此未安装 MS17-010 的计算机将面临较高的风险。 本文提供了多种快速检测计算机是否已更新的方法。

方法 1:按已安装的知识库编号检查

使用下表检查已列出的任意更新(标记为“不包含 MS17-010 修补程序”的更新除外)。 如果已安装了其中列出的任何更新,则表示已安装了 MS17-010。

表 1/2: Windows 7 SP1 及更高版本。 以下汇总知识库包含此修补程序(“4 月仅安全 4B”列除外)。 每个 KB 编号下方列出了更新的 Srv.sys 版本号。

Windows 版本 3 月的仅安全更新 (2017 年 3 月 14 日) 3 月月度汇总
(2017 年 3 月 14 日)
3 月月度汇总预览
(2017 年 3 月 21 日)
4 月仅
安全更新
(2017 年 4 月 11 日)
4 月月度汇总
(2017 年 4 月 11 日)
4 月月度汇总预览
(2017 年 4 月 18 日)
5 月仅安全更新
(2017 年 5 月 9 日)
5 月月度汇总
(2017 年 5 月 9 日)
下载链接
Windows 7 SP1 和 Windows Server 2008 R2 SP1 4012212
6.1.7601.23689
4012215
6.1.7601.23689
4012218
6.1.7601.23689
4015546
不包含 MS17-010 修补程序
4015549
6.1.7601.23689
4015552
6.1.7601.23689
4019263
6.1.7601.23762
4019264
6.1.7601.23762
Windows 7 SP1 和 Windows Server 2008 R2 SP1 更新历史记录
Windows 2012 4012214
6.2.9200.22099
4012217
6.2.9200.22099
4012220
6.2.9200.22099
4015548
不包含 MS17-010 修补程序
4015551
6.2.9200.22099
4015554
6.2.9200.22099
4019214
6.2.9200.22137
4019216
6.2.9200.22137
Windows Server 2012 更新历史记录
Windows 8.1 and Windows Server 2012 R2 4012213
6.3.9600.18604
4012216
6.3.9600.18604
4012219
6.3.9600.18604
4015547 不包含 MS17-010 修补程序 4015550
6.3.9600.18604
4015553
6.3.9600.18619
4019213
6.3.9600.18655
4019215
6.3.9600.18655
Windows 8.1 和 Windows Server 2012 R2 更新历史记录
Windows 10 版本 1507 4012606
10.0.10240.17319
4016637
10.0.10240.17319
- - 4015221
10.0.10240.17319
- - 4019474 10.0.10240.17394 Windows 10 更新历史记录
Windows 10 版本 1511 4013198
10.0.10586.839
4016636
10.0.10586.839
- - 4015219
10.0.10586.839
- - 4019473
10.0.10586.916
Windows 10 更新历史记录
Windows 10 版本 Windows Server 2016 4013429
10.0.14393.953
4016635
10.0.14393.953
- - 4015217
10.0.14393.953
- - 4019472
10.0.14393.1198
Windows 10 和 Windows Server 2016 更新历史记录

 

表 2/2: 继续更新 2017 年 5 月和 6 月。

Windows 版本 5 月月度汇总预览
(2017 年 5 月 16 日)
6 月仅安全更新
(2017 年 6 月 13 日)
6 月月度汇总
(2017 年 6 月 13 日)
下载链接
Windows 7 和 Server 2008 R2 4019265
6.1.7601.23762
4022722 4022168
6.1.7601.23762
Windows 7 SP1 和 Windows Server 2008 R2 SP1 更新历史记录
Windows Server 2012 4019218
6.2.9200.22137
4022718 4022724
6.2.9200.22137
Windows Server 2012 更新历史记录
Windows 8.1 and Windows Server 2012 R2 4019217
6.3.9600.18655
4022717 4022720
6.3.9600.18688
Windows 8.1 和 Windows Server 2012 R2 更新历史记录
Windows 10 版本 1507 - - 4032695 Windows 10 更新历史记录
Windows 10 版本 1511 - - 4032693 Windows 10 更新历史记录
Windows 10 版本 1607 和 Windows Server 2016 - - 4022723
10.0.14393.1198
Windows 10 和 Windows Server 2016 更新历史记录

 

表 2: 其他 Windows 版本。 使用 KB 4012598 作为安全更新。

Windows 版本 知识库编号和
已更新 Srv.sys 版本
下载链接
Windows Server 2003 SP2 4012598
5.2.3790.6021
Windows Server 2003 SP2 x64

Windows Server 2003 SP2 x86
Windows XP 4012598
5.1.2600.7208
Windows XP SP2 x64

Windows XP SP3 x86

Windows XP Embedded SP3 x86
Windows Vista SP2 4012598
GDR:6.0.6002.19743
LDR:6.0.6002.24067
Windows Vista Service Pack 2

Windows Vista x64 Edition Service Pack 2
Windows Server 2008 SP2 4012598
GDR:6.0.6002.19743
LDR:6.0.6002.24067
Windows Server 2008(用于 32 位系统)Service Pack 2

Windows Server 2008(用于基于 x64 的系统)Service Pack 2

Windows Server 2008 for Itanium-based Systems Service Pack 2
Windows 8 4012598
6.2.9200.22099
Windows 8 x86Windows 8 x64

 

表 3: 包含修补程序的其他更新。

Windows 8.1 and Windows Server 2012 R2

发布日期 知识库编号 支持页面
2017 年 3 月 21 日 4012219 2017 年 3 月 21 日 —KB4012218(月度汇总预览)
2017 年 4 月 18 日,星期二 4015553 2017 年 4 月 18 日 — KB4015553(月度汇总预览)
2017 年 5 月 16 日 4019217 2017 年 5 月 16 日 — KB4019217(月度汇总预览)
2017 年 6 月 27 日 4022720 2017 年 6 月 27 日 - KB4022720(月度汇总预览)

Windows Server 2012

发布日期 知识库编号 支持页面
2017 年 3 月 21 日 4012220 2017 年 3 月 21 日 — KB4012220(月度汇总预览)
2017 年 4 月 18 日,星期二 4015554 2017 年 4 月 18 日 — KB4015554(月度汇总预览)
2017 年 5 月 16 日 4019218 2017 年 5 月 16 日 — KB4019218(月度汇总预览)
2017 年 6 月 27 日 4022721 2017 年 6 月 27 日 - KB4022721(月度汇总预览)

Windows 7 SP1 和 Windows Server 2008 R2 SP1

发布日期 知识库编号 支持页面
2017 年 3 月 21 日 4012218 2017 年 3 月 21 日 —KB4012218(月度汇总预览)
2017 年 4 月 18 日,星期二 4015552 2017 年 4 月 18 日— KB4015552(月度汇总预览)
2017 年 5 月 16 日 4019265 2017 年 5 月 16 日— KB4019265(月度汇总预览)
2017 年 6 月 27 日 4022168 2017 年 6 月 27 日 - KB4022168(月度汇总预览)

方法 2:按 %systemroot%\system32\drivers\srv.sys 文件版本检查

使用下图检查 %systemroot%\system32\drivers\srv.sys 的文件版本。 如果文件版本等于或大于列出的版本,则表示已安装 MS17-010。

Windows 版本 最低的已更新 Srv.sys 版本
Windows XP 5.1.2600.7208
Windows Server 2003 SP2 5.2.3790.6021
Windows Vista
Windows Server 2008 SP2
GDR:6.0.6002.19743, LDR:6.0.6002.24067
Windows 7
Windows Server 2008 R2
6.1.7601.23689
Windows 8
Windows Server 2012
6.2.9200.22099
Windows 8.1
Windows Server 2012 R2
6.3.9600.18604
Windows 10 TH1 v1507 10.0.10240.17319
Windows 10 TH2 v1511 10.0.10586.839
Windows 10 RS1 v1607
Windows Server 2016
10.0.14393.953

方法 3:按 WMI 和Windows PowerShell进行检查

使用 WMI 和 Windows PowerShell 确定是否已安装 MS17-010 修补程序。

WMI 命令

若要查找指定的知识库编号,请打开提升的命令提示符窗口,然后运行以下命令:


wmic qfe get hotfixid | find "KB1234567"

注意

  • 在此命令中,将 KB1234567> 替换为<实际 KB 数。

  • 使用与号 (&) 搜索多个更新。 例如,运行以下命令:

    wmic qfe get hotfixid | find "KB4012212" & wmic qfe get hotfixid | find "KB4012215" & wmic qfe get hotfixid | find "KB4015549"

PowerShell 命令

若要在本地系统中进行检查,请运行以下管理 PowerShell cmdlet:


 get-hotfix -id KB1234567

注意

  • 在此命令中,将 KB1234567> 替换为<实际 KB 数。

  • 使用逗号 (,) 搜索多个更新。 例如,运行以下命令:

    get-hotfix -id KB4012212,KB4012215,KB4015549

若要检查 Active Directory 域或 OU 中的所有计算机,请在域控制器上运行以下管理 PowerShell cmdlet:


foreach ( $n in (get-adcomputer -searchbase ‘OU=workstations,dc=contoso,dc=com’ -filter * -property * | select name )) {get-hotfix -computername $n.name -id KB1234567}

注意“OU=workstations,dc=contoso,dc=com”部分可以更改为指向 Active Directory 域目录分区的根(例如“dc=contoso,dc=com”)以搜索整个域中的计算机。 在此命令中,将 KB1234567> 替换为<实际 KB 数。

如何解决“不适用”安装错误

如果计算机上尚未安装先决修补程序,则在 Windows 8.1 或 Windows 服务器 2012 R2 上安装 MS17-010 时,您可能会收到以下错误消息:

注意

此更新不适用于你的计算机

若要解决此错误,请按照下列步骤操作:

  1. 请确保你正在尝试安装正确的更新。 为此,请检查方法 1 的表 1 中的知识库编号。 将其与你的系统版本、系统服务包级别和系统位级别(x64、IA64 或 x86)进行比较。
     

  2. 检查缺失的依赖项。 对于 Windows 8.1 和 Windows Server 2012 R2,请根据以下文章安装所需的依赖修补程序:

    • KB 2919355:Windows RT 8.1、Windows 8.1 和 Windows Server 2012 R2 更新:2014 年 4 月
    • KB 2919442:2014 年 3 月针对 Windows 8.1 和 Windows Server 2012 R2 的服务堆栈更新
    • KB 3173424:Windows 8.1 和 Windows Server 2012 R2 的服务堆栈更新:2016 年 7 月 12 日
  3. 如果你无法安装某个汇总更新,请尝试安装其他汇总版本。 有关可用的更新,请参阅表 1。
     

PowerShell 脚本

以下 Windows PowerShell 脚本将本地计算机上的 Srv.sys 版本与方法 2 图表中列出的版本进行了比较。

将此脚本另存为 .ps1 文件,然后从 PowerShell 运行该脚本。 此脚本适用于 Windows XP 和 Windows Server 2003 及更高版本。 要求 Windows PowerShell 2.0 或更高版本。
 


[reflection.assembly]::LoadWithPartialName("System.Version")
$os = Get-WmiObject -class Win32_OperatingSystem
$osName = $os.Caption
$s = "%systemroot%\system32\drivers\srv.sys"
$v = [System.Environment]::ExpandEnvironmentVariables($s)
If (Test-Path "$v")
    {
    Try
        {
        $versionInfo = (Get-Item $v).VersionInfo
        $versionString = "$($versionInfo.FileMajorPart).$($versionInfo.FileMinorPart).$($versionInfo.FileBuildPart).$($versionInfo.FilePrivatePart)"
        $fileVersion = New-Object System.Version($versionString)
        }
    Catch
        {
        Write-Host "Unable to retrieve file version info, please verify vulnerability state manually." -ForegroundColor Yellow
        Return
        }
    }
Else
    {
    Write-Host "Srv.sys does not exist, please verify vulnerability state manually." -ForegroundColor Yellow
    Return
    }
if ($osName.Contains("Vista") -or ($osName.Contains("2008") -and -not $osName.Contains("R2")))
    {
    if ($versionString.Split('.')[3][0] -eq "1")
        {
        $currentOS = "$osName GDR"
        $expectedVersion = New-Object System.Version("6.0.6002.19743")
        } 
    elseif ($versionString.Split('.')[3][0] -eq "2")
        {
        $currentOS = "$osName LDR"
        $expectedVersion = New-Object System.Version("6.0.6002.24067")
        }
    else
        {
        $currentOS = "$osName"
        $expectedVersion = New-Object System.Version("9.9.9999.99999")
        }
    }
elseif ($osName.Contains("Windows 7") -or ($osName.Contains("2008 R2")))
    {
    $currentOS = "$osName LDR"
    $expectedVersion = New-Object System.Version("6.1.7601.23689")
    }
elseif ($osName.Contains("Windows 8.1") -or $osName.Contains("2012 R2"))
    {
    $currentOS = "$osName LDR"
    $expectedVersion = New-Object System.Version("6.3.9600.18604")
    }
elseif ($osName.Contains("Windows 8") -or $osName.Contains("2012"))
    {
    $currentOS = "$osName LDR"
    $expectedVersion = New-Object System.Version("6.2.9200.22099")
    }
elseif ($osName.Contains("Windows 10"))
    {
    if ($os.BuildNumber -eq "10240")
        {
        $currentOS = "$osName TH1"
        $expectedVersion = New-Object System.Version("10.0.10240.17319")
        }
    elseif ($os.BuildNumber -eq "10586")
        {
        $currentOS = "$osName TH2"
        $expectedVersion = New-Object System.Version("10.0.10586.839")
        }
    elseif ($os.BuildNumber -eq "14393")
        {
        $currentOS = "$($osName) RS1"
        $expectedVersion = New-Object System.Version("10.0.14393.953")
        }
    elseif ($os.BuildNumber -eq "15063")
        {
        $currentOS = "$osName RS2"
        "No need to Patch. RS2 is released as patched. "
        return
        }
    }
elseif ($osName.Contains("2016"))
    {
    $currentOS = "$osName"
    $expectedVersion = New-Object System.Version("10.0.14393.953")
    }
elseif ($osName.Contains("Windows XP"))
    {
    $currentOS = "$osName"
    $expectedVersion = New-Object System.Version("5.1.2600.7208")
    }
elseif ($osName.Contains("Server 2003"))
    {
    $currentOS = "$osName"
    $expectedVersion = New-Object System.Version("5.2.3790.6021")
    }
else
    {
    Write-Host "Unable to determine OS applicability, please verify vulnerability state manually." -ForegroundColor Yellow
    $currentOS = "$osName"
    $expectedVersion = New-Object System.Version("9.9.9999.99999")
    }
Write-Host "`n`nCurrent OS: $currentOS (Build Number $($os.BuildNumber))" -ForegroundColor Cyan
Write-Host "`nExpected Version of srv.sys: $($expectedVersion.ToString())" -ForegroundColor Cyan
Write-Host "`nActual Version of srv.sys: $($fileVersion.ToString())" -ForegroundColor Cyan
If ($($fileVersion.CompareTo($expectedVersion)) -lt 0)
    {
    Write-Host "`n`n"
    Write-Host "System is NOT Patched" -ForegroundColor Red
    }
Else
    {
    Write-Host "`n`n"
    Write-Host "System is Patched" -ForegroundColor Green
    }
#

参考资料

WannaCrypt 攻击客户指导

恶意软件保护中心

Microsoft 恶意软件保护中心博客

安全更新 MS17-010

用于与 MS17-010 相关的合规性报告的 Configuration Manager SQL Server 查询

本文适用于:

 

  • Windows Server 2016
  • Windows 10 版本 1607
  • Windows 10 版本 1511
  • Windows 10 版本 1507
  • Windows Server 2012 R2
  • Windows 8.1
  • Windows Server 2012
  • Windows 8
  • Windows Server 2008 R2
  • Windows 7
  • Windows Server 2008 Service Pack 2
  • Windows Vista
  • Windows Server 2003 Service Pack 2
  • Windows XP