Chapter 04

Networking Configuration

Default Windows networking settings were designed for compatibility, not security. LLMNR, NBT-NS, SMB without signing, and IPv6 with default settings are each independently exploitable by an attacker on the same network segment.

Scenario

A junior analyst plugs Responder into a corporate network segment during a penetration test with no prior configuration and no special access — just an Ethernet jack. Within sixty seconds, Responder has captured seventeen NTLMv2 hashes. Within four minutes, three of them are cracked offline. None of the affected machines were misconfigured in any obvious way. They were all running current Windows 10 with current patches. The only thing wrong was that LLMNR and NBT-NS were enabled — which is the default.

This chapter explains exactly how those protocols turn a passive network presence into credential theft, and what other networking defaults create similar exposure.

Name Resolution and Why It Gets Abused

When a Windows machine needs to resolve a hostname to an IP address, it tries several methods in order. The order matters enormously for security, because two of the methods in the default chain broadcast the hostname to the local network segment — and any machine on that segment can respond, whether or not it is the legitimate target.

  Windows Name Resolution Order (Default)
  ══════════════════════════════════════════════════════════════════════

  Application calls getaddrinfo("fileserver")
          │
          ▼
  1. Check local hosts file (C:\Windows\System32\drivers\etc\hosts)
     Fast, authoritative. Rarely contains the queried name.
          │ (not found)
          ▼
  2. DNS query to configured DNS server(s)
     Correct answer if DNS is configured and has the record.
     Fails with NXDOMAIN if name doesn't exist in DNS.
          │ (NXDOMAIN or DNS fails)
          ▼
  3. LLMNR (Link-Local Multicast Name Resolution)
     Broadcasts UDP multicast to 224.0.0.252 (IPv4) / FF02::1:3 (IPv6)
     "Does anyone on this segment know 'fileserver'?"
     ANY host on the segment can respond. No authentication.
          │ (no response)
          ▼
  4. NBT-NS (NetBIOS Name Service)
     Broadcasts UDP to 255.255.255.255 port 137
     "Does anyone know NetBIOS name 'FILESERVER'?"
     ANY host on the segment can respond. No authentication.

  The attack:
  ─────────────────────────────────────────────────────────────────
  Step 1: User tries to access \\filesrver\share (typo)
  Step 2: DNS returns NXDOMAIN (no such name)
  Step 3: LLMNR broadcast: "Who is 'filesrver'?"
  Step 4: Attacker's Responder tool responds: "I am 'filesrver'"
  Step 5: Victim's machine connects to attacker, presents
          NTLMv2 challenge-response for authentication
  Step 6: Attacker captures hash, cracks offline
    
Why LLMNR and NBT-NS are still enabled by default

LLMNR (RFC 4795, 2007) and NBT-NS were designed for peer-to-peer environments without a DNS server — home networks, small offices. They make it easy to find other computers on the network without any centralized infrastructure. On a corporate domain with a working DNS server, they serve no necessary function — everything should be resolvable via DNS. But Microsoft ships them enabled for compatibility. Disabling them requires deliberate Group Policy configuration. Organizations that don't know to do this leave the door open. The fix: Group Policy → Computer Configuration → Administrative Templates → Network → DNS Client → "Turn off multicast name resolution" = Enabled. And for NBT-NS: Network adapter properties → TCP/IP → Advanced → WINS → "Disable NetBIOS over TCP/IP".

NTLM Relay: How Unsigned SMB Becomes a Lateral Movement Vector

NTLM relay is a category of attack where an attacker intercepts an NTLM authentication attempt and relays it to a different target — using the victim's credentials to authenticate to a service the attacker chooses. It doesn't require cracking the hash. The hash is never seen in plaintext. The attacker simply acts as a man-in-the-middle, forwarding the authentication messages between the victim and the target.

  NTLM Relay Attack Flow
  ══════════════════════════════════════════════════════════════════════

  Normal NTLM Authentication (without relay):
  ─────────────────────────────────────────────────────────────────
  Client ──NEGOTIATE──────────────────────────────► Server
  Client ◄─CHALLENGE (random nonce)────────────────  Server
  Client ──AUTHENTICATE (HMAC-MD5 of nonce+hash)──► Server
                                                      Server validates
  NTLM Relay (attacker in the middle):
  ─────────────────────────────────────────────────────────────────
  [Victim]         [Attacker/Responder]       [Target Server]

  1. Victim tries to connect to \\attacker\ (or is redirected)
     Victim ──NEGOTIATE──────────────────► Attacker
  2. Attacker forwards NEGOTIATE to Target
                          Attacker ──NEGOTIATE──────────────► Target
  3. Target sends challenge
                          Attacker ◄─CHALLENGE (nonce)────── Target
  4. Attacker sends that same challenge back to Victim
     Victim ◄─CHALLENGE (Target's nonce)── Attacker
  5. Victim computes AUTHENTICATE response using its own hash
     Victim ──AUTHENTICATE────────────────► Attacker
  6. Attacker forwards the AUTHENTICATE response to Target
                          Attacker ──AUTHENTICATE──────────► Target
  7. Target validates — it was a valid response to its challenge
                          Target: ACCESS GRANTED

  The attacker is now authenticated to Target as the Victim.
  Without knowing the password. Without cracking the hash.

  SMB Signing prevents this:
  ─────────────────────────────────────────────────────────────────
  With SMB signing required, every SMB packet is signed with the
  session key derived from the authentication. An NTLM relay
  attacker doesn't have the session key — they only have the
  authentication exchange. The signed packets from the attacker
  fail verification. Relay is defeated.
    
SMB Signing State Default On NTLM Relay Risk
Domain Controllers Required (enforced) Protected. DCs reject unsigned SMB.
Domain-joined workstations Enabled but not required Vulnerable. Signing is negotiated but not enforced — attackers negotiate "no signing".
Domain-joined servers (non-DC) Enabled but not required Vulnerable. Same as workstations.
Windows 11 (2022+) Required by default in newer builds Protected on modern Windows 11 builds.

Network Location Profiles: What Actually Changes

When Windows connects to a network, it assigns a network profile: Domain, Private, or Public. This is not cosmetic — the profile controls the Windows Firewall ruleset, network discovery settings, and file sharing defaults. The wrong profile assignment has real security consequences.

Profile When Applied Firewall Default Network Discovery
Domain Machine is domain-joined and can reach a DC Less restrictive — assumes corporate IT manages security via Group Policy Enabled (other domain machines are visible)
Private User manually designated this as a trusted network Moderately restrictive — allows some inbound connections for sharing Enabled
Public Default for unrecognized networks (coffee shop, hotel) Most restrictive — blocks most inbound connections Disabled
Common mistake: corporate laptops connecting to hotel WiFi on Domain profile

A domain-joined laptop that can't reach a DC (at a hotel, working remotely) will fall back to Public profile — this is correct behavior. But if the network is somehow recognized as the previous trusted network (e.g., via matching SSID or network ID), it might stay on Private profile with more permissive firewall rules. The practical risk: on a Domain profile, file sharing and network discovery are enabled, and the firewall allows more inbound traffic. On a hotel network, this means the laptop is more visible and more accessible to other hotel guests than it should be. Verify via Windows Firewall settings that the active profile is Public on untrusted networks.

Windows Firewall as a Segmentation Control

Windows Firewall with Advanced Security is more than a port filter. It supports application-aware rules, connection security rules (IPsec), and different rulesets per network profile. For security architecture, the most important uses are not blocking external threats (that's the network perimeter's job) but limiting lateral movement between Windows machines inside the network.

  Windows Firewall for Lateral Movement Prevention
  ══════════════════════════════════════════════════════════════════════

  Default: Windows allows SMB (445), WMI (135/dynamic), WinRM (5985),
  RDP (3389) inbound from any source on the Domain profile.

  An attacker with credentials can:
  ✓ Connect via SMB to any reachable machine
  ✓ Execute commands via WMI (wmic /node:target)
  ✓ Execute commands via PSRemoting (Invoke-Command -ComputerName)
  ✓ Connect via RDP

  Host-based firewall segmentation:
  ─────────────────────────────────────────────────────────────────
  Rule: Block SMB (445) inbound EXCEPT from management subnet
  Rule: Block WMI (135) inbound EXCEPT from management subnet
  Rule: Block WinRM (5985) inbound EXCEPT from management subnet
  Rule: Allow RDP (3389) inbound ONLY from jump server IPs

  Effect: Attacker who compromises a workstation can't pivot
  to other workstations via SMB/WMI — even with valid credentials.
  Lateral movement requires going through the management segment
  (or finding a separate vulnerability to bypass the firewall rule).

  This is host-based microsegmentation: using Windows Firewall
  as a control plane for east-west traffic, independent of
  network-level ACLs.
    

IPv6: The Default-Enabled Attack Surface

IPv6 is enabled by default on every Windows network interface since Vista. In environments that have not deployed IPv6 infrastructure, this creates an interesting attack surface: Windows will prefer IPv6 over IPv4 when both are available, and it will actively seek DHCPv6 configuration even when no DHCPv6 server is present. Attackers can exploit this preference.

  mitm6 / DHCPv6 Spoofing Attack
  ══════════════════════════════════════════════════════════════════════

  1. Attacker runs mitm6 on the network segment.
     mitm6 responds to DHCPv6 solicitations from Windows clients,
     assigning them IPv6 addresses and setting the attacker's machine
     as the IPv6 DNS server.

  2. Victim machine accepts the IPv6 configuration (it's valid DHCP).
     Victim now uses attacker as DNS for IPv6 queries.

  3. When victim makes a DNS query for any domain name,
     attacker returns the attacker's own IP as the answer for
     queries that would go to WPAD (Web Proxy Auto-Discovery) or
     other Windows-default name lookups.

  4. Victim connects to attacker expecting a legitimate service.
     Attacker captures NTLM authentication, relays to real targets.

  Key insight: this attack works even in IPv4-only environments
  because Windows has IPv6 enabled and prefers it. The attacker
  never needed a real IPv6 network — just a machine that answers
  DHCPv6 solicitations.

  Defense options:
  ─────────────────────────────────────────────────────────────────
  1. Disable IPv6 on all interfaces (Group Policy or registry)
     Only if IPv6 is genuinely not used in the environment.
  2. Enable DHCPv6 Guard on managed switches (blocks rogue DHCPv6)
  3. Deploy real IPv6 infrastructure with proper DHCPv6 security
  4. Disable WPAD via Group Policy (eliminates one relay target)
    
Wild: mitm6 + NTLM relay gets Domain Admin in default AD environments

The combination of mitm6 (DHCPv6 spoofing) with ntlmrelayx targeting LDAP on domain controllers is a well-documented attack chain that works against default Active Directory configurations. The attacker uses the relayed credentials to write to AD via LDAP — specifically, to create a new computer account and configure Resource-Based Constrained Delegation (RBCD) on a target. This ultimately allows requesting service tickets for the target on behalf of any user, including domain admins. The entire chain, from initial network access to Domain Admin equivalent privilege, requires no password cracking and exploits only default Windows and AD configurations. Published by dirkjanm in 2018, it remains effective in environments that haven't explicitly disabled LLMNR, NBT-NS, and IPv6 DHCPv6, or required LDAP signing.

SMB Security Configuration

SMB (Server Message Block) is the primary Windows file sharing and remote administration protocol. Its security configuration has significant impact on lateral movement risk and credential exposure.

SMB Security Setting What It Controls Security Impact
SMB Signing (Required) Every SMB packet is digitally signed; unsigned packets rejected Defeats NTLM relay attacks against SMB. Set "Require" not just "Enabled".
SMB Encryption Encrypts SMB 3.x traffic end-to-end Prevents network sniffing of SMB traffic. Requires SMB 3.x (Windows 8/2012+).
SMBv1 Disabled Legacy protocol version with no security features EternalBlue (WannaCry/NotPetya) required SMBv1. Disabled by default on modern Windows. Verify it stays disabled.
Guest Access Disabled Prevents unauthenticated access to shares Default disabled on modern Windows. Historical CIFS shares sometimes re-enabled it.
RestrictNullSessAccess Blocks null-session (anonymous) access to shares and named pipes Prevents anonymous enumeration of user and group lists. Should remain at default (1 = restricted).

Q & A

1. Why can't the NTLM relay attack be prevented by making NTLMv2 required instead of NTLMv1?

NTLMv2 prevents some older attacks that relied on NTLMv1's weaker cryptography (specifically, the LM hash and downgrade attacks). But NTLM relay works against NTLMv2 just as well as NTLMv1 — the relay doesn't require breaking the hash's cryptography. The relay passes the authentication exchange intact. NTLMv2 uses the server's challenge as part of the HMAC-MD5 computation; the relay attacker simply passes the legitimate server's challenge to the victim, gets the victim's response, and relays it to the server. The entire NTLMv2 authentication sequence is valid from the server's perspective, because every value in it is genuinely computed with the victim's credentials responding to the server's real challenge. The relay attacker never needs to know the hash or the password. The fix is SMB signing (or LDAP signing, or EPA for HTTP), which requires the session key — and the relay attacker doesn't have the session key, only the authentication exchange.

2. What is WPAD and why is it a network security concern?

WPAD (Web Proxy Auto-Discovery Protocol) allows Windows machines to automatically discover proxy server configuration. Windows queries for WPAD via DHCP option 252 first, then via DNS for "wpad.domain.com", then — in environments without a DNS answer — via LLMNR and NBT-NS for "wpad". The attacker opportunity: if LLMNR/NBT-NS are enabled and the DNS server doesn't have a WPAD record, an attacker can respond to the LLMNR/NBT-NS "wpad" query, serve a malicious PAC (Proxy Auto-Configuration) file that redirects all HTTP/HTTPS traffic through the attacker's machine, and capture credentials from the proxy authentication challenge. The attack is trivially executed with Responder's WPAD module. Defence: either create a real WPAD DNS entry pointing to a legitimate server (or returning NXDOMAIN), or disable WPAD via Group Policy (Internet Explorer → Automatic detection of proxy settings → Disabled). Disabling LLMNR/NBT-NS also prevents the name resolution step.

3. An EDR alert fires on a machine: outbound connection to 224.0.0.252 on UDP 5355. Is this malicious?

224.0.0.252:5355 is the LLMNR multicast address and port — this is a normal LLMNR query, not inherently malicious. The machine is broadcasting a name resolution request to the local network segment. This is default behavior on Windows and by itself is benign. The security relevance is that LLMNR should ideally be disabled in managed enterprise environments to prevent Responder-style attacks. An alert on this traffic could be triggered by a detection that flags LLMNR activity as a configuration gap (hardening-focused detection) rather than as a compromise indicator. If you're investigating a suspected attack, the relevant indicator would be inbound traffic on that port from an unexpected source (a potential Responder operator answering LLMNR queries), or NTLM authentication events following shortly after the LLMNR query — specifically Event ID 4624 logon type 3 with a source IP that doesn't match any legitimate server for that resource.

4. What is LDAP signing and why does NTLM relay to LDAP matter so much for Active Directory?

LDAP (Lightweight Directory Access Protocol) is the protocol used to query and modify Active Directory. LDAP signing requires LDAP sessions to be cryptographically signed, preventing an NTLM relay attacker from reusing captured authentication against the LDAP service. Without LDAP signing required, an attacker who relays NTLM credentials to AD's LDAP port can perform writes to AD — creating computer accounts, modifying ACLs, configuring delegation settings — using the victim's identity. If the victim account has sufficient rights (domain admin, or a standard user in the default "domain computers can write some AD attributes" configuration), this can escalate to domain compromise. LDAP channel binding is a related control that prevents relay attacks via TLS. The recommended configuration: require LDAP signing (Group Policy: "Domain Controller: LDAP server signing requirements" = Require signing) and enable LDAP channel binding ("Domain Controller: LDAP server channel binding token requirements" = Always). These are not enabled by default in older AD environments, though Microsoft increasingly pushes them in baseline recommendations.