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.
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.
Get-ComputerInfo -Property WindowsInstallationType # "Server Core" or "Server"
Get-WindowsFeature | Where-Object Installed | Select-Object NameRemove roles and features you do not use:
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
sconfigon 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.
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 5 HotFixID,InstalledOnSet 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.
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol,RequireSecuritySignature,EncryptData
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
Set-SmbServerConfiguration -RequireSecuritySignature $true -ForceSMB 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:
Set-SmbShare -Name "Finance" -EncryptData $trueStep 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.
# 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.
# 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 DWordAudit 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
# 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 DisabledReview 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).
# Standalone server: import a baseline GPO backup with LGPO (run from the extracted toolkit folder)
.\LGPO.exe /g .\GPOBackups\SERVER_BASELINE_FOLDERIn 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
- Check installation type, list installed features, and remove one you do not need.
- Disable SMBv1, require SMB signing, and confirm with
Get-SmbServerConfiguration. - Turn off LLMNR, mDNS and NetBIOS, then re-run the baseline commands.
- Download the Security Compliance Toolkit, run Policy Analyzer against your server and note five differences.
Checkpoint
- Why prefer Server Core?
- What attack class does SMB signing defend against, and what is the Server 2025 default?
- Why do LLMNR and NetBIOS help an attacker on your LAN?
- Why audit NTLM before restricting it?
- Which Windows tool compares your settings against a Microsoft baseline?