
Module PowerShell de réponse à l'incident CVE-2025-59287 — WSUS Remote Code Execution (RCE)
Versión: 1.0.1
Autor: RZA / IT Operations
Licencia: MIT
El módulo WSUSResponder proporciona un conjunto de herramientas PowerShell para responder rápidamente a la vulnerabilidad crítica CVE-2025-59287, una falla de ejecución remota de código (RCE) que afecta a Windows Server Update Services (WSUS).
Permite:
| Módulo | Rol | Instalación |
|---|
| ActiveDirectory | Descubrimiento automático de servidores mediante AD | Add-WindowsCapability -Online -Name 'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0' |
| ImportExcel | Generación de informes Excel (.xlsx) | Install-Module ImportExcel -Scope CurrentUser |
Enable-PSRemoting)WSUSResponder en uno de sus directorios de módulos de PowerShell:
$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
| Función | Descripción |
|---|---|
| Get-WSUSCveStatus | Escanea los servidores para detectar la presencia del rol WSUS y los parches OOB. |
| Set-WSUSCveWorkaround | Aplica el workaround (reglas de firewall que bloquean los puertos 8530/8531). |
| Remove-WSUSCveWorkaround | Elimina las reglas de firewall creadas por el workaround. |
| Export-WSUSCveReport | Exporta los resultados del escaneo en varios formatos (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'
Los informes se guardan en la carpeta definida por -ExportPath:
| Archivo | Formato | Contenido |
|---|---|---|
| WSUS_CVE59287_Report.csv | CSV | Resultados completos del escaneo |
| WSUS_CVE59287_Report.json | JSON | Exportación estructurada para API/automatización |
| WSUS_CVE59287_Report.xlsx | XLSX | Informe formateado con filtros automáticos |
| Vulnerable_Hosts.txt | TXT | Lista simple de los hosts vulnerables |
Invoke-Command y WinRM para ejecución remotaForEach-Object -Parallel) para acelerar los pre-tests-OperationTimeoutSecSi su política de ejecución es AllSigned, puede firmar el módulo:
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)Distribuido bajo licencia MIT.
© 2025 RZA / IT Operations – Todos los derechos reservados.