Lesson 7 of 12 · 18 min · Intermediate

Windows Server: a clean baseline, no legacy protocols

Choose Server Core, patch properly, remove unneeded roles, and turn off the legacy protocols attackers abuse: SMBv1, LLMNR, NetBIOS, NTLMv1, PowerShell v2 and the Print Spooler where it is not needed. Apply a Microsoft security baseline.

In this lesson you will

  • Reduce roles and features, and prefer Server Core
  • Disable SMBv1, LLMNR, NetBIOS and weak NTLM settings
  • Require SMB signing and understand the Server 2025 defaults
  • Apply and compare a Microsoft security baseline

The Windows half starts where the Ubuntu half did: fewer things running, patched, with legacy protocols switched off. Windows ships with a lot of backwards compatibility, and attackers love it, because old protocols were designed for trusted networks.

Run PowerShell as Administrator, on your lab server or an authorised host, with console or hypervisor access in case a change breaks remote management. Take a snapshot first.

Same goals, two toolchains

Step 1: choose less to attack

Server Core (no desktop experience) has a smaller attack surface and fewer patches. Use it for any role that does not need a GUI.

powershell
Get-ComputerInfo -Property WindowsInstallationType      # "Server Core" or "Server"
Get-WindowsFeature | Where-Object Installed | Select-Object Name

Remove roles and features you do not use:

powershell
Uninstall-WindowsFeature -Name Telnet-Client
Uninstall-WindowsFeature -Name PowerShell-V2        # old engine that bypasses modern logging
Uninstall-WindowsFeature -Name FS-SMB1              # SMBv1

(Some removals need a reboot. Check the output.)

Step 2: patching

Unpatched servers are the cheapest way in. Decide how patches arrive, then verify they do.

  • Windows Update / WSUS / Windows Update for Business / Azure Update Manager for fleets, or sconfig on Server Core for a single host.
  • Hotpatch (Windows Server 2025 via Azure Arc) applies many security updates without a reboot. It covers Windows security updates only, so other updates and drivers still need restarts, and licensing terms change, so confirm with Microsoft.
powershell
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 5 HotFixID,InstalledOn

Set a cadence: critical and exploited flaws within days, the rest monthly, and a reboot plan for each.

Step 3: kill SMBv1, require signing

SMBv1 is the protocol behind EternalBlue-class attacks. It should not exist anywhere.

powershell
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol,RequireSecuritySignature,EncryptData
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
Set-SmbServerConfiguration -RequireSecuritySignature $true -Force

SMB signing stops man-in-the-middle relay of SMB sessions. On Windows Server 2025, signing is required by default for outbound connections, but not inbound, so set it explicitly on servers that host shares. Watch compatibility: an old NAS or appliance without signing support will fail to connect until it is fixed. Do not disable signing to work around that.

For sensitive shares, add encryption:

powershell
Set-SmbShare -Name "Finance" -EncryptData $true

Step 4: stop name-resolution poisoning

LLMNR, NetBIOS and mDNS answer "who is this name?" to anyone on the local network, which lets an attacker on the LAN capture credentials. Turn them off.

powershell
# LLMNR off
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' -Force | Out-Null
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient' -Name EnableMulticast -Value 0 -Type DWord

# mDNS off
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Services\Dnscache\Parameters' -Name EnableMDNS -Value 0 -Type DWord

# NetBIOS over TCP/IP off (2 = disabled) on every enabled adapter
Get-CimInstance Win32_NetworkAdapterConfiguration -Filter "IPEnabled=true" |
  Invoke-CimMethod -MethodName SetTcpipNetbios -Arguments @{ TcpipNetbiosOptions = 2 }

In a domain, push these with Group Policy (Computer Configuration, Administrative Templates, Network, DNS Client, Turn off multicast name resolution) so they stick.

Step 5: tighten NTLM and TLS

NTLM is old and relayable. The long-term goal is to reduce it; the immediate step is to refuse the weakest forms.

powershell
# Send NTLMv2 only; refuse LM and NTLMv1 (matches the GPO: LAN Manager authentication level 5)
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa' -Name LmCompatibilityLevel -Value 5 -Type DWord

Audit before you restrict. Before blocking NTLM broadly, turn on NTLM auditing (Group Policy: Network security: Restrict NTLM: Audit NTLM authentication) and read the logs for a few weeks. Blocking blind breaks legacy applications.

For TLS, recent Windows releases already favour TLS 1.2 and 1.3. Verify what your services actually offer (nmap --script ssl-enum-ciphers -p 443 SERVER) and disable TLS 1.0/1.1 and weak ciphers where you still find them, using a tool such as IIS Crypto or Group Policy.

Step 6: disable what servers do not need

powershell
# Print Spooler: disable on every server that is not a print server (it has a long history of serious flaws)
Stop-Service Spooler -Force
Set-Service Spooler -StartupType Disabled

Review other services: Get-Service | Where-Object Status -eq Running. Disable what you cannot justify, one at a time.

Step 7: apply a Microsoft security baseline

You do not need to invent a configuration. Microsoft publishes security baselines for Windows Server, and the Security Compliance Toolkit (SCT) includes the baseline GPO backups plus two tools: Policy Analyzer (compare your settings to the baseline) and LGPO.exe (apply a baseline to a standalone server).

powershell
# Standalone server: import a baseline GPO backup with LGPO (run from the extracted toolkit folder)
.\LGPO.exe /g .\GPOBackups\SERVER_BASELINE_FOLDER

In a domain, import the baseline into a new GPO and link it to a test OU first. Use Policy Analyzer to see where your server differs, and treat deviations as decisions: accept, fix, or document an exception. Also compare against the current CIS Benchmark for your Windows Server version (check CIS for the latest release).

Back-out: most settings above are registry or feature changes. Reverse the specific change, remove the GPO link, or restore your snapshot.

🧪 Lab

  1. Check installation type, list installed features, and remove one you do not need.
  2. Disable SMBv1, require SMB signing, and confirm with Get-SmbServerConfiguration.
  3. Turn off LLMNR, mDNS and NetBIOS, then re-run the baseline commands.
  4. Download the Security Compliance Toolkit, run Policy Analyzer against your server and note five differences.

Checkpoint

  1. Why prefer Server Core?
  2. What attack class does SMB signing defend against, and what is the Server 2025 default?
  3. Why do LLMNR and NetBIOS help an attacker on your LAN?
  4. Why audit NTLM before restricting it?
  5. Which Windows tool compares your settings against a Microsoft baseline?