
Module PowerShell de réponse à l'incident CVE-2025-59287 — WSUS Remote Code Execution (RCE)
バージョン: 1.0.1
作成者: RZA / IT Operations
ライセンス: MIT
WSUSResponder モジュールは、Windows Server Update Services (WSUS) に影響を与える重大なリモートコード実行(RCE)脆弱性 CVE-2025-59287 に迅速に対応するための PowerShell ツール群を提供します。
以下のことが可能です:
| モジュール | 役割 | インストール |
|---|---|---|
| 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 | 脆弱なホストの単純なリスト |