From 3fe5fed7a0c1fb098d5c9244b746b9934022d00d Mon Sep 17 00:00:00 2001 From: Ricardo Monla Date: Thu, 26 Feb 2026 11:23:29 -0300 Subject: [PATCH] fix(sql): Forzar reinicio mandatorio tras parche de registro InstallLanguage --- payload.ps1 | 51 ++++++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/payload.ps1 b/payload.ps1 index 4fb0e3ac..aaef6cba 100644 --- a/payload.ps1 +++ b/payload.ps1 @@ -13,42 +13,31 @@ Log-Msg "INYECTANDO PARCHES DE REGISTRO PROFUNDOS PARA IDIOMA (SPAIN-3082 / 0C0A Log-Msg "==========================================================" # SQL Server en Server Core chequea estrictamente estas claves del registro para el 'LanguageMismatch' -try { - Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "InstallLanguage" -Value "0C0A" - Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "Default" -Value "0C0A" - Log-Msg "Claves de registro de Idioma parcheadas a 0C0A (Espanol)." -} catch { - Log-Msg "Fallo al inyectar claves de registro: $_" +$installLang = (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "InstallLanguage").InstallLanguage +if ($installLang -ne "0C0A") { + try { + Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "InstallLanguage" -Value "0C0A" + Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "Default" -Value "0C0A" + Set-WinSystemLocale -SystemLocale es-ES + Set-WinUserLanguageList -LanguageList es-ES -Force + + Log-Msg "Claves de registro de Idioma inyectadas a 0C0A (Espanol)." + Log-Msg "REINICIO OBLIGATORIO DETECTADO. El OS necesita reiniciar para volcar el registro a RAM." + Log-Msg "Reiniciando servidor DB01 en 3 segundos..." + Log-Msg "Operador: Cuando la maquina virtual haya vuelto, ejecuta el C2 Launcher de nuevo." + Start-Sleep -Seconds 3 + Restart-Computer -Force + exit + } catch { + Log-Msg "Fallo al inyectar claves de registro obligatorias: $_" + } } + $locale = Get-WinSystemLocale -if ($locale.Name -ne "es-ES") { - if (Test-Path "C:\reboot_pending.txt") { exit } - Set-Content -Path "C:\reboot_pending.txt" -Value "Yes" - - Log-Msg "==========================================================" - Log-Msg "SISTEMA INCOMPATIBLE CONFIRMADO: OS = $($locale.Name), SQL ISO = ESN (es-ES)." - Log-Msg "APLICANDO PARCHE DE COMPATIBILIDAD (en-US -> es-ES)..." - Log-Msg "==========================================================" - - Set-WinSystemLocale -SystemLocale es-ES - Set-WinUserLanguageList -LanguageList es-ES -Force - Set-WinUILanguageOverride -Language es-ES -ErrorAction SilentlyContinue - - Log-Msg "Parche inyectado. REINICIANDO EL SERVIDOR DB01 en 3 segundos..." - Log-Msg "Operador: El servidor se reiniciara, el VNC se caera temporalmente. Al volver, reconecta y ejecuta el C2 Launcher de nuevo." - - Start-Sleep -Seconds 3 - Restart-Computer -Force - exit -} - -if (Test-Path "C:\reboot_pending.txt") { - Remove-Item "C:\reboot_pending.txt" -Force -ErrorAction SilentlyContinue -} Log-Msg "==========================================================" -Log-Msg "SISTEMA COMPATIBLE ($($locale.Name)). PROCEDIENDO CON INSTALACION SQL." +Log-Msg "SISTEMA COMPATIBLE ($($locale.Name) / 0C0A). PROCEDIENDO CON INSTALACION SQL." Log-Msg "==========================================================" Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0