GuíasGuides · Nivel 3Level 3

GPO de seguridad: NTLM, LLMNR, firma SMB, LAPS, registro de PowerShell y un despliegue con piloto y marcha atrásSecurity GPOs: NTLM, LLMNR, SMB signing, LAPS, PowerShell logging, and a rollout with pilot and rollback

Las directivas de base que cierran los ataques más repetidos en un dominio: LM y NTLMv1, LLMNR y NetBIOS, firma SMB, Windows LAPS, enumeración anónima, registro de PowerShell, Credential Guard y protección de LSA. Con las Security Baselines de Microsoft y Policy Analyzer, una OU piloto, gpresult y cómo volver atrás.The baseline policies that close the most repeated attacks in a domain: LM and NTLMv1, LLMNR and NetBIOS, SMB signing, Windows LAPS, anonymous enumeration, PowerShell logging, Credential Guard and LSA protection. With Microsoft's Security Baselines and Policy Analyzer, a pilot OU, gpresult, and how to roll back.

Qué vas a conseguir

Un conjunto de GPO de seguridad que quita de en medio lo que un atacante con un portátil en la red prueba primero: capturar hashes por LLMNR, retransmitir autenticaciones por SMB sin firmar, reutilizar la contraseña de administrador local o sacar credenciales de LSASS. Desplegado con auditoría previa, una OU piloto, comprobación en el equipo y un camino de vuelta.

Antes de empezar

  • Permisos para crear y vincular GPO (delegados en las OU, no Domain Admin para el día a día) y la consola GPMC.
  • El Microsoft Security Compliance Toolkit: las Security Baselines de tu versión de Windows y Windows Server y Policy Analyzer.
  • Una OU piloto con equipos reales de varios departamentos (incluido el de IT) y un par de servidores no críticos.
  • El inventario de lo antiguo (multifunciones que escanean a carpeta, NAS, aplicaciones de terceros): es lo que rompen estas directivas.

1. Empezar por la baseline, no por una hoja en blanco

Las Security Baselines de Microsoft traen GPO ya hechas (equipo, usuario, controlador de dominio, Defender) y un script para importarlas. No se vinculan tal cual: se comparan con lo que ya tienes.

Policy Analyzer · comparar la baseline con las GPO actuales
AddImport GPO(s)Windows 11 24H2 Security Baseline (GPOs)
AddImport GPO(s)Copia de seguridad de las GPO del dominio
PolíticaLAN Manager authentication level · Baseline: Send NTLMv2 response only. Refuse LM & NTLM · Dominio: (no configurada)
PolíticaMicrosoft network server: Digitally sign communications (always) · Baseline: Enabled · Dominio: Disabled
View / Compare
Export to Excel

Cada diferencia se decide: se adopta, se adopta más tarde o se documenta por qué no. Para importar una GPO de la baseline en tu dominio sin vincularla, Import-GPO -BackupGpoName "MSFT Windows 11 24H2 - Computer" -Path .\GPOs -TargetName "SEC-Equipos-Baseline" -CreateIfNeeded.

Varias GPO pequeñas con nombre claro (SEC-NTLM, SEC-LLMNR-NetBIOS, SEC-SMB-Firma, SEC-LAPS) en lugar de una enorme.

2. Las directivas, una a una

Todas en Configuración del equipo › Directivas.

LM y NTLMv1. En Configuración de Windows › Configuración de seguridad › Directivas locales › Opciones de seguridad:

  • Seguridad de red: nivel de autenticación de LAN Manager = Enviar solo respuesta NTLMv2 y rechazar LM y NTLM (valor 5).
  • Seguridad de red: no almacenar el valor hash de LAN Manager en el próximo cambio de contraseña = Habilitada.

Antes de aplicarlo, busca quién usa todavía NTLMv1: en los controladores de dominio, el evento 4624 muestra Paquete de autenticación: NTLM y Nombre del paquete (solo NTLM): NTLM V1. Windows 11 24H2 y Windows Server 2025 ya no traen NTLMv1, pero los equipos antiguos y los dispositivos de terceros sí.

LLMNR y NetBIOS. Cuando DNS no resuelve un nombre, Windows pregunta a toda la red por LLMNR y NetBIOS: cualquiera puede responder "soy yo" y recibir un hash.

  • LLMNR: Plantillas administrativas › Red › Cliente DNS › Desactivar resolución de nombres de multidifusión = Habilitada.
  • NetBIOS sobre TCP/IP no tiene una directiva clásica. Lo habitual es la opción de DHCP de Microsoft 001 (Microsoft Disable Netbios Option = 0x2) en los ámbitos, o el valor NetbiosOptions = 2 en cada interfaz bajo HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces por preferencia de registro o script.

Firma SMB. En Opciones de seguridad:

  • Servidor de red Microsoft: firmar digitalmente las comunicaciones (siempre) = Habilitada.
  • Cliente de red Microsoft: firmar digitalmente las comunicaciones (siempre) = Habilitada.

Windows 11 24H2 (Pro, Enterprise y Education) ya exige firma de entrada y salida por defecto, y Windows Server 2025 la exige de salida. La GPO iguala al resto. Lo que suele fallar: NAS y escáneres antiguos y el acceso de invitado.

Enumeración anónima. En Opciones de seguridad:

  • Acceso de red: no permitir enumeraciones anónimas de cuentas SAM y recursos compartidos = Habilitada.
  • Acceso de red: restringir acceso anónimo a canalizaciones con nombre y recursos compartidos = Habilitada.
  • Acceso de red: permitir la aplicación de los permisos Todos a los usuarios anónimos = Deshabilitada.

Windows LAPS. Una contraseña de administrador local distinta en cada equipo, rotada y guardada en AD. Una vez por bosque, Update-LapsADSchema; por cada OU de equipos, Set-LapsADComputerSelfPermission -Identity "OU=Equipos,DC=contoso,DC=local". Después, en Plantillas administrativas › Sistema › LAPS:

  • Configurar el directorio de copia de seguridad de contraseñas = Active Directory.
  • Configuración de contraseña: complejidad máxima, 20 caracteres, 30 días.
  • Habilitar el cifrado de contraseñas (requiere nivel funcional de dominio 2016) y Configurar descifradores de contraseñas autorizados con el grupo de soporte que puede leerlas.

Para leerla desde soporte: Get-LapsADPassword -Identity PC-0412 -AsPlainText.

Registro de PowerShell. En Plantillas administrativas › Componentes de Windows › Windows PowerShell:

  • Activar el registro de bloques de script de PowerShell = Habilitada. Cada script queda en el evento 4104 del registro Microsoft-Windows-PowerShell/Operational, incluido el código ofuscado una vez descifrado.
  • Activar el registro de módulos (evento 4103) y, si hay dónde guardarla, la transcripción. Sube el tamaño del registro: con el de por defecto se sobrescribe en horas.

Credential Guard y protección de LSA. En Plantillas administrativas › Sistema:

  • Device Guard › Activar la seguridad basada en virtualización = Habilitada, con Configuración de Credential Guard = Habilitado sin bloqueo para el piloto (con bloqueo UEFI ya no se quita por GPO).
  • Autoridad de seguridad local › Configura LSASS para que se ejecute como un proceso protegido = Habilitado sin bloqueo UEFI.

En Windows 11 22H2 y posteriores, los dos vienen activos por defecto en equipos que cumplen requisitos; la GPO lo hace explícito para todos. Credential Guard bloquea el inicio de sesión único con NTLMv1, MS-CHAPv2 y la delegación sin restricciones de Kerberos: la WiFi o la VPN con PEAP-MSCHAPv2 es el primer sitio donde mirar.

3. El piloto: aplicar y comprobar en el equipo

Las GPO se vinculan primero a la OU piloto. En un equipo de esa OU, tras gpupdate /force y un reinicio (Credential Guard y LSA lo necesitan):

PowerShell (administrador) · PC-0412 en la OU piloto
gpresult /scope computer /rgpresult /h C:\Temp\gpo-PC-0412.htmlGet-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa | Select-Object LmCompatibilityLevel, RunAsPPLGet-SmbServerConfiguration | Select-Object RequireSecuritySignature(Get-CimInstance -Namespace root\Microsoft\Windows\DeviceGuard -ClassName Win32_DeviceGuard).SecurityServicesRunningGet-WinEvent -FilterHashtable @{LogName='System'; ProviderName='Microsoft-Windows-Wininit'; Id=12} -MaxEvents 1 | Select-Object -ExpandProperty MessageApplied Group Policy Objects    SEC-NTLM    SEC-LLMNR-NetBIOS    SEC-SMB-Firma    SEC-LAPSLmCompatibilityLevel RunAsPPL-------------------- --------                   5        2RequireSecuritySignature : True{1, 2}LSASS.exe was started as a protected process with level: 4
  • gpresult /r dice qué GPO se aplicaron y cuáles se filtraron (y por qué: filtrado de seguridad, WMI o vínculo deshabilitado). El informe HTML de /h muestra cada valor y qué GPO lo ganó.
  • En SecurityServicesRunning, el 1 es Credential Guard y el 2 la integridad de código protegida por hipervisor. El evento 12 de Wininit confirma LSASS protegido.
  • Durante dos semanas, el piloto recoge lo que se rompe. Cada incidencia se resuelve arreglando el sistema antiguo o con una excepción documentada, no quitando la directiva para todos.

4. Marcha atrás

  • Antes de cada vínculo: Backup-GPO -All -Path \\srv-gestion\GPO-Backups. Con Restore-GPO se recupera una versión anterior.
  • La marcha atrás rápida es deshabilitar el vínculo (Set-GPLink -Name "SEC-SMB-Firma" -Target "OU=Piloto,DC=contoso,DC=local" -LinkEnabled No), no borrar la GPO.

Las directivas de Opciones de seguridad se quedan "tatuadas": al quitar la GPO, el equipo conserva el último valor. Para deshacer de verdad, se aplica una GPO con el valor contrario explícito (por ejemplo, firma SMB Deshabilitada), se comprueba con gpresult y después se retira. Credential Guard o LSA con bloqueo UEFI tampoco se quitan por GPO: por eso el piloto va sin bloqueo.

5. El despliegue y lo que vigilas

Del piloto a las OU por oleadas (IT, una planta, el resto, servidores al final y los controladores de dominio con su GPO de la baseline), avisando al service desk de qué síntomas esperar. Cada mes: Policy Analyzer contra la baseline nueva, equipos que no aplican las GPO, excepciones vencidas y eventos 4624 con NTLM V1.

Siguientes pasos

  • La guía de Microsoft Defender Antivirus y reglas ASR es la otra mitad de la base de seguridad del puesto, y la baseline de Microsoft trae su propia GPO de Defender.
  • La guía de Windows Server de Nivel 2 explica cómo leer los eventos que usas aquí para comprobar.
  • Cada GPO con su valor, la fecha de despliegue y el informe de gpresult son evidencia de control para una auditoría. Es la idea del repositorio 25-security-controls-evidence de mi GitHub.

¿Falta algo o en tu entorno es distinto? Escríbeme y lo corrijo.

What you'll get

A set of security GPOs that gets rid of what an attacker with a laptop on the network tries first: capturing hashes through LLMNR, relaying authentication over unsigned SMB, reusing the local admin password, or pulling credentials out of LSASS. Rolled out with prior auditing, a pilot OU, checks on the device and a way back.

Before you start

  • Permissions to create and link GPOs (delegated on the OUs, not Domain Admin for day-to-day work) and the GPMC console.
  • The Microsoft Security Compliance Toolkit: the Security Baselines for your Windows and Windows Server versions, and Policy Analyzer.
  • A pilot OU with real devices from several departments (IT included) and a couple of non-critical servers.
  • An inventory of the old stuff (multifunction printers that scan to a folder, NAS boxes, third-party apps): it is what these policies break.

1. Start from the baseline, not a blank page

Microsoft's Security Baselines come with ready-made GPOs (computer, user, domain controller, Defender) and a script to import them. You do not link them as they are: you compare them with what you already have.

Policy Analyzer · comparing the baseline with the current GPOs
AddImport GPO(s)Windows 11 24H2 Security Baseline (GPOs)
AddImport GPO(s)Backup of the domain's GPOs
PolicyLAN Manager authentication level · Baseline: Send NTLMv2 response only. Refuse LM & NTLM · Domain: (not configured)
PolicyMicrosoft network server: Digitally sign communications (always) · Baseline: Enabled · Domain: Disabled
View / Compare
Export to Excel

Each difference is decided: adopt it, adopt it later, or document why not. To import a baseline GPO into your domain without linking it, Import-GPO -BackupGpoName "MSFT Windows 11 24H2 - Computer" -Path .\GPOs -TargetName "SEC-Computers-Baseline" -CreateIfNeeded.

Several small GPOs with clear names (SEC-NTLM, SEC-LLMNR-NetBIOS, SEC-SMB-Signing, SEC-LAPS) instead of one huge one.

2. The policies, one by one

All under Computer Configuration › Policies.

LM and NTLMv1. In Windows Settings › Security Settings › Local Policies › Security Options:

  • Network security: LAN Manager authentication level = Send NTLMv2 response only. Refuse LM & NTLM (value 5).
  • Network security: Do not store LAN Manager hash value on next password change = Enabled.

Before applying it, find out who still uses NTLMv1: on the domain controllers, event 4624 shows Authentication Package: NTLM and Package Name (NTLM only): NTLM V1. Windows 11 24H2 and Windows Server 2025 no longer ship NTLMv1, but older devices and third-party equipment do.

LLMNR and NetBIOS. When DNS cannot resolve a name, Windows asks the whole network through LLMNR and NetBIOS, and anyone can answer "that's me" and receive a hash.

  • LLMNR: Administrative Templates › Network › DNS Client › Turn off multicast name resolution = Enabled.
  • NetBIOS over TCP/IP has no classic policy. The usual route is Microsoft DHCP option 001 (Microsoft Disable Netbios Option = 0x2) on the scopes, or the NetbiosOptions value = 2 on each interface under HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters\Interfaces through a registry preference or a script.

SMB signing. In Security Options:

  • Microsoft network server: Digitally sign communications (always) = Enabled.
  • Microsoft network client: Digitally sign communications (always) = Enabled.

Windows 11 24H2 (Pro, Enterprise and Education) already requires inbound and outbound signing by default, and Windows Server 2025 requires it outbound. The GPO brings everything else in line. What usually breaks: old NAS boxes and scanners, and guest access.

Anonymous enumeration. In Security Options:

  • Network access: Do not allow anonymous enumeration of SAM accounts and shares = Enabled.
  • Network access: Restrict anonymous access to Named Pipes and Shares = Enabled.
  • Network access: Let Everyone permissions apply to anonymous users = Disabled.

Windows LAPS. A different local admin password on every device, rotated and stored in AD. Once per forest, Update-LapsADSchema; for each computer OU, Set-LapsADComputerSelfPermission -Identity "OU=Computers,DC=contoso,DC=local". Then, in Administrative Templates › System › LAPS:

  • Configure password backup directory = Active Directory.
  • Password Settings: maximum complexity, 20 characters, 30 days.
  • Enable password encryption (needs domain functional level 2016) and Configure authorized password decryptors with the support group allowed to read them.

To read it from support: Get-LapsADPassword -Identity PC-0412 -AsPlainText.

PowerShell logging. In Administrative Templates › Windows Components › Windows PowerShell:

  • Turn on PowerShell Script Block Logging = Enabled. Every script lands in event 4104 of the Microsoft-Windows-PowerShell/Operational log, including obfuscated code once decoded.
  • Turn on Module Logging (event 4103) and, if there is somewhere to keep it, transcription. Increase the log size: at the default it is overwritten within hours.

Credential Guard and LSA protection. In Administrative Templates › System:

  • Device Guard › Turn On Virtualization Based Security = Enabled, with Credential Guard Configuration = Enabled without lock for the pilot (with UEFI lock it can no longer be removed by GPO).
  • Local Security Authority › Configures LSASS to run as a protected process = Enabled without UEFI Lock.

On Windows 11 22H2 and later, both are on by default on devices that meet the requirements; the GPO makes it explicit for everyone. Credential Guard blocks single sign-on with NTLMv1, MS-CHAPv2 and Kerberos unconstrained delegation: Wi-Fi or VPN with PEAP-MSCHAPv2 is the first place to look.

3. The pilot: apply and check on the device

The GPOs are linked to the pilot OU first. On a device in that OU, after gpupdate /force and a reboot (Credential Guard and LSA need it):

PowerShell (administrator) · PC-0412 in the pilot OU
gpresult /scope computer /rgpresult /h C:\Temp\gpo-PC-0412.htmlGet-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa | Select-Object LmCompatibilityLevel, RunAsPPLGet-SmbServerConfiguration | Select-Object RequireSecuritySignature(Get-CimInstance -Namespace root\Microsoft\Windows\DeviceGuard -ClassName Win32_DeviceGuard).SecurityServicesRunningGet-WinEvent -FilterHashtable @{LogName='System'; ProviderName='Microsoft-Windows-Wininit'; Id=12} -MaxEvents 1 | Select-Object -ExpandProperty MessageApplied Group Policy Objects    SEC-NTLM    SEC-LLMNR-NetBIOS    SEC-SMB-Signing    SEC-LAPSLmCompatibilityLevel RunAsPPL-------------------- --------                   5        2RequireSecuritySignature : True{1, 2}LSASS.exe was started as a protected process with level: 4
  • gpresult /r says which GPOs were applied and which were filtered out (and why: security filtering, WMI or a disabled link). The /h HTML report shows every value and which GPO won it.
  • In SecurityServicesRunning, 1 is Credential Guard and 2 is hypervisor-protected code integrity. Wininit event 12 confirms LSASS is protected.
  • For two weeks, the pilot collects what breaks. Each issue is solved by fixing the old system or with a documented exception, not by removing the policy for everyone.

4. Rollback

  • Before each link: Backup-GPO -All -Path \\srv-mgmt\GPO-Backups. Restore-GPO brings back an earlier version.
  • The quick rollback is disabling the link (Set-GPLink -Name "SEC-SMB-Signing" -Target "OU=Pilot,DC=contoso,DC=local" -LinkEnabled No), not deleting the GPO.

Security Options settings stay "tattooed": when the GPO is removed, the device keeps the last value. To really undo, apply a GPO with the explicit opposite value (for example SMB signing Disabled), check it with gpresult, and then remove it. Credential Guard or LSA with UEFI lock cannot be removed by GPO either: that is why the pilot runs without lock.

5. The rollout and what you watch

From the pilot to the OUs in waves (IT, one floor, everyone else, servers at the end, and domain controllers with their baseline GPO), telling the service desk which symptoms to expect. Every month: Policy Analyzer against the new baseline, devices that don't apply the GPOs, expired exceptions and 4624 events with NTLM V1.

Next steps

  • The guide Microsoft Defender Antivirus and ASR rules is the other half of the device security baseline, and Microsoft's baseline ships its own Defender GPO.
  • The Level 2 Windows Server guide explains how to read the events you use here to check.
  • Each GPO with its value, the rollout date and the gpresult report are control evidence for an audit. That is the idea behind the 25-security-controls-evidence repository on my GitHub.

Is something missing, or different in your environment? Get in touch and I'll fix it.

Tech Career Lab · newsletter

¿Te ha servido? Cada dos semanas envío una idea práctica para perfiles IT: LinkedIn, proyectos, networking y procesos de selección.Found this useful? Every two weeks I send one practical idea for IT professionals: LinkedIn, projects, networking and hiring processes.

Apúntate y llévate las 33 ideasSign up and get the 33 ideas →