Link-Local Multicast Name Resolution (LLMNR) and NetBIOS over TCP/IP (NBT-NS) are legacy fallback resolution protocols designed to resolve hostnames on local subnets when primary DNS lookups fail. However, attackers on enterprise local area networks routinely exploit these unauthenticated broadcast protocols using tools such as Responder to poison broadcast responses, spoof file servers, and harvest NetNTLM password hashes. Disabling LLMNR and NetBIOS via PowerShell is a fundamental security hardening standard for Windows 11 workstations.
Why LLMNR and NetBIOS Pose Severe Security Risks
When a Windows client attempts to access an internal resource (e.g., \\fileshare) and the primary DNS query returns an NXDOMAIN error, the operating system falls back through several legacy mechanisms:
- Broadcast Poisoning: The client broadcasts an LLMNR or NetBIOS request across the local network segment asking: “Who is \\fileshare?”
- Attacker Response: Any adversary on the network segment immediately replies: “I am \\fileshare, please authenticate.”
- Hash Harvesting: The Windows client automatically initiates an NTLM handshake, sending the logged-in user’s cryptographic NetNTLMv2 hash directly to the attacker’s listener.
Disabling LLMNR via PowerShell Registry Configuration
LLMNR is governed by the DNS client registry configuration. Launch PowerShell as Administrator and execute:
# Define DNS Client policy registry path
$DnsPolicyPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient"
# Ensure the registry path exists
if (-not (Test-Path $DnsPolicyPath)) {
New-Item -Path $DnsPolicyPath -Force | Out-Null
}
# Disable LLMNR by setting EnableMulticast to 0
New-ItemProperty -Path $DnsPolicyPath -Name "EnableMulticast" -Value 0 -PropertyType DWord -Force
# Verify the configured value
Get-ItemProperty -Path $DnsPolicyPath -Name "EnableMulticast"
Setting EnableMulticast = 0 completely disables LLMNR query broadcasts across all network interfaces.
Disabling NetBIOS Over TCP/IP via PowerShell
NetBIOS operates per network adapter. To disable NetBIOS across all active physical and wireless adapters:
# Query active network adapters
$Adapters = Get-WmiObject -Class Win32_NetworkAdapterConfiguration | Where-Object { $_.IPEnabled -eq $true }
# Configure TcpipNetbiosOptions to 2 (Disabled)
foreach ($Adapter in $Adapters) {
Write-Output "Disabling NetBIOS on: $($Adapter.Description)"
$Adapter.SetTcpipNetbiosOptions(2) | Out-Null
}
The values for TcpipNetbiosOptions indicate:
0= Use NetBIOS setting from DHCP server.1= Enable NetBIOS over TCP/IP.2= Disable NetBIOS over TCP/IP completely.
Verifying NetBIOS Deactivation
Confirm that NetBIOS ports (UDP 137, UDP 138, TCP 139) are no longer bound or active:
# Verify NetBIOS configuration across adapters
Get-CimInstance -ClassName Win32_NetworkAdapterConfiguration | Where-Object { $_.IPEnabled -eq $true } | Select-Object Description, TcpipNetbiosOptions
# Confirm no active NetBIOS listening ports remain
Get-NetTCPConnection -LocalPort 139 -ErrorAction SilentlyContinue
Get-NetUDPEndpoint -LocalPort 137, 138 -ErrorAction SilentlyContinue
With LLMNR disabled and NetBIOS unbound, the workstation is completely immune to broadcast credential-poisoning attacks.