From 90af8f41f160f2d3d3279cff17c73db85fc89c97 Mon Sep 17 00:00:00 2001 From: Ricardo Monla Date: Thu, 26 Feb 2026 11:39:47 -0300 Subject: [PATCH] =?UTF-8?q?fix(sql):=20Implementar=20candado=20(reboot=5Fl?= =?UTF-8?q?ock)=20para=20romper=20bucle=20infinito=20de=20reinicio=20por?= =?UTF-8?q?=20reversi=C3=B3n=20de=20registro=20del=20SO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- payload.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/payload.ps1 b/payload.ps1 index aaef6cba..e09fbfd5 100644 --- a/payload.ps1 +++ b/payload.ps1 @@ -14,17 +14,17 @@ Log-Msg "==========================================================" # SQL Server en Server Core chequea estrictamente estas claves del registro para el 'LanguageMismatch' $installLang = (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Nls\Language" -Name "InstallLanguage").InstallLanguage -if ($installLang -ne "0C0A") { +if ($installLang -ne "0C0A" -and !(Test-Path "C:\reboot_lock.txt")) { 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 + Set-Content -Path "C:\reboot_lock.txt" -Value "BLOQUEO DE REINICIO INFINITO" 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 "REINICIO OBLIGATORIO PREVENTIVO DETECTADO. El OS necesita reiniciar." 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 @@ -33,6 +33,10 @@ if ($installLang -ne "0C0A") { } } +if (Test-Path "C:\reboot_lock.txt") { + Log-Msg "Reinicio previo ejecutado. El OS revertio el registro InstallLanguage a $installLang. Rompiendo bucle infinito." +} + $locale = Get-WinSystemLocale