版本:1.0.1
作者:RZA / IT Operations
许可证:MIT
WSUSResponder 模块提供了一套 PowerShell 工具,用于快速响应关键漏洞 CVE-2025-59287,这是一个影响 Windows Server Update Services (WSUS) 的远程代码执行(RCE)漏洞。
该模块支持:
| 模块 | 作用 | 安装命令 |
|---|---|---|
| ActiveDirectory | 通过 AD 自动发现服务器 | Add-WindowsCapability -Online -Name 'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0' |
| ImportExcel | 生成 Excel 报告(.xlsx) | Install-Module ImportExcel -Scope CurrentUser |
Enable-PSRemoting)WSUSResponder 的文件夹:
$Path = "$env:USERPROFILE\Documents\WindowsPowerShell\Modules\WSUSResponder"
New-Item -ItemType Directory -Path $Path -Force
WSUSResponder.psm1WSUSResponder.psd1Import-Module WSUSResponder
Get-Command -Module WSUSResponder
Get-Module WSUSResponder -ListAvailable
| 函数 | 描述 |
|---|---|
| Get-WSUSCveStatus | 扫描服务器以检测 WSUS 角色及 OOB 补丁的安装情况。 |
| Set-WSUSCveWorkaround | 应用临时解决方案(阻止端口 8530/8531 的防火墙规则)。 |
| Remove-WSUSCveWorkaround | 删除临时解决方案创建的防火墙规则。 |
| Export-WSUSCveReport | 将扫描结果导出为多种格式(CSV、JSON、XLSX、TXT)。 |
$ReportPath = "C:\Temp\WSUS_Audit_$(Get-Date -Format yyyyMMdd)"
Get-WSUSCveStatus -FromAD -UsePS7Parallel | Export-WSUSCveReport -ExportPath $ReportPath
$scanResults = Get-WSUSCveStatus -FromAD -UsePS7Parallel
$vulnerable = $scanResults | Where-Object { $_.IsWSUS -and -not $_.IsPatched -and $_.Reachable }
$vulnerable | Set-WSUSCveWorkaround -PassThru
$scanResults | Export-WSUSCveReport -ExportPath "C:\Temp\WSUS_Mitig_$(Get-Date -Format yyyyMMdd)"
Remove-WSUSCveWorkaround -ComputerName 'srv-wsus-01','srv-wsus-02'
报告保存在 -ExportPath 指定的文件夹中:
Invoke-Command 和 WinRM 进行远程执行ForEach-Object -Parallel)以加速预测试-OperationTimeoutSec 配置超时如果您的执行策略为 AllSigned,您可以对模块进行签名:
New-SelfSignedCertificate -Type CodeSigning -Subject "CN=IT Operations" -CertStoreLocation Cert:\CurrentUser\My
$cert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1
Set-AuthenticodeSignature -FilePath "C:\Modules\WSUSResponder\WSUSResponder.psm1" -Certificate $cert
Set-AuthenticodeSignature -FilePath "C:\Modules\WSUSResponder\WSUSResponder.psd1" -Certificate $cert
-UsePS7Parallel)根据 MIT 许可证分发。
© 2025 RZA / IT Operations – 保留所有权利。
| 文件 | 格式 | 内容 |
|---|
| WSUS_CVE59287_Report.csv | CSV | 完整的扫描结果 |
| WSUS_CVE59287_Report.json | JSON | 用于 API/自动化的结构化导出 |
| WSUS_CVE59287_Report.xlsx | XLSX | 带自动筛选器的格式化报告 |
| Vulnerable_Hosts.txt | TXT | 易受攻击主机的简单列表 |