Skip to content
Tutorials Center
My learning

Topics

Lesson 40 of 53 ยท Systems and Post-Exploitation Concepts

AD Network Attacks, Enumeration and Defenses

Understand LLMNR/NBT-NS poisoning, SMB relay, mitm6 and IPv6 abuse, and AD attack-path analysis with BloodHound, with simulated examples and concrete defenses for each.

Once an attacker (or an authorized tester) has a foothold on a Windows network, the interesting question is how to move from a low-privilege position to something that matters. In Active Directory environments the answers are often not software bugs but protocols that trust too much and permissions that add up in unexpected ways. This lesson covers both: the classic name-resolution and relay attacks on the network, and the graph-based analysis that reveals privilege paths. For every technique the defense is as important as the attack.

These techniques work against real networks and can lock out accounts, disrupt services or capture other people's credentials. Use them only inside an isolated lab you built (see Active Directory Lab and Concepts) or on a network you are explicitly authorized to test. The code in this lesson is a simulation in memory that never sends or captures network traffic.

Why name resolution gets abused

When a Windows computer needs to reach \\fileserver it asks DNS first. If DNS cannot answer (a typo, a stale shortcut, a missing record), older fallback protocols step in: LLMNR (Link-Local Multicast Name Resolution) and NBT-NS (NetBIOS Name Service) simply ask everyone on the local network, "does anyone know where fileserver is?" These broadcasts have no authentication. Any machine on the segment can answer "that's me", and the asker believes it.

sequenceDiagram
  participant V as Victim PC
  participant D as DNS
  participant L as Local network
  participant A as Rogue lab host
  V->>D: Where is "fileserevr"? (typo)
  D-->>V: No such name
  V->>L: Broadcast: who is "fileserevr"?
  A-->>V: That is me
  V->>A: Sends authentication attempt

A typo and an unauthenticated fallback let a rogue host receive a login attempt.

The victim then tries to authenticate to the rogue host. What it sends is not the password itself but an NTLM challenge-response. That material can be attacked in two ways, and both explain why this class of weakness matters.

  1. Offline cracking. The captured response can be tested against password guesses offline. Weak passwords fall quickly; long random ones do not. See Password Security.
  2. Relaying. The attacker passes the authentication straight on to another machine in real time, so the other machine thinks the victim is logging in. If the victim has rights there, the attacker acts with those rights, and the password is never cracked.

SMB relay and signing

SMB signing makes each SMB message carry a cryptographic signature tied to the session, so a relayed connection fails: the relaying host cannot sign as the victim. If signing is not required on a target, relay is possible when the victim account has local admin rights there. Many networks have signing required on domain controllers but not on ordinary servers and workstations, which is why scanners report "SMB signing not required" as a finding. (Related enumeration is covered in Service Enumeration.)

Relay can also target other protocols, for example LDAP or HTTP certificate services, if they accept NTLM without extra protections such as signing, channel binding or extended protection.

mitm6 and IPv6

Most Windows machines have IPv6 enabled by default but many networks do not run an IPv6 service. A rogue host on the segment can answer a machine's IPv6 configuration requests (DHCPv6), become its DNS server for IPv6 and then redirect name lookups. The result is the same as with LLMNR: authentication attempts flow to the wrong place and can be relayed. The lesson is general: any default-on protocol that nobody monitors is an attack surface.

Defenses that work

  • Disable LLMNR and NBT-NS by Group Policy. Legitimate resolution should work through DNS, so fix DNS records and stale shortcuts instead of relying on broadcast fallback.
  • Require SMB signing everywhere (via GPO) and enable LDAP signing and channel binding.
  • Reduce NTLM: audit its use, then restrict it, preferring Kerberos.
  • Disable IPv6 only if you must, or better, control it deliberately (for example with DHCPv6 guard on switches) and apply firewall rules.
  • Strong, long passwords or passphrases so captured responses do not crack, and least privilege, so that a relayed account has little to gain.
  • Network segmentation and switch features such as port security and DHCP snooping.
  • Detection: honeypot name lookups for names that do not exist (any answer is a rogue responder), alerts on unexpected LLMNR/NBT-NS responders, and monitoring for authentication from unusual hosts.

A poisoning detection stand-in

The model below has no network. A "network" is a list of events: name queries and who answered them. A defender's check flags answers to queries for names that should not exist (decoys) and answers from hosts that are not known DNS or name servers.

Node.js Detect a rogue name responder

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

The decoy-name idea is simple and effective: a legitimate computer never answers for a name that does not exist, so any answer is a strong, low-noise signal.

Enumeration with BloodHound

Defenders and testers share another problem: in a directory with thousands of users, groups and permissions, nobody can see the privilege paths by reading lists. BloodHound answers by turning directory data into a graph: nodes are users, groups and computers; edges are relationships such as MemberOf, AdminTo (administrator on a machine), HasSession (a privileged user is logged on there) and GenericAll (full control over an object). A collector (SharpHound) gathers this data from the directory and from the machines it can query, using normal domain access. Then you ask questions such as "show the shortest path from this user to Domain Admins".

The surprising result is that paths are often short: a help-desk user is local admin on a server, where a domain admin has a session; that is two hops. Defenders can run the same analysis on their own domain, which is the recommended use, and fix the paths before someone else finds them.

Fixes the graph usually points to: remove unnecessary local admin rights, stop privileged accounts logging on to lower-tier machines, clean up risky permissions and nested groups, and shrink privileged groups.

The stand-in below is a miniature of the idea: a breadth-first search over an invented edge list, printing the shortest chain and the edge that is easiest to cut.

Node.js Find the shortest attack path in a graph

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Real BloodHound data sets contain tens of thousands of edges and the tool does the search and visualization for you, but the principle is the same: model, search, cut the cheapest edge.

Attack vectors and detection summary

Attackers on an internal network chase authentication. Common vectors are Kerberos-based attacks (requesting service tickets or abusing weak pre-authentication), name-resolution poisoning, and forcing machines to authenticate to an attacker-controlled host (for example by triggering authentication requests through a feature that makes a server connect outward). They are widespread because default Windows settings favor compatibility.

LLMNR and NBT-NS poisoning: when DNS fails, Windows broadcasts a name query and any host can answer. A malicious answer causes the victim to send a NetNTLMv2 authentication attempt, which is then captured. Captured responses can be cracked offline (hashcat mode 5600 is the identifier for NetNTLMv2), so weak passwords fall quickly. Fixes: disable LLMNR and NBT-NS through Group Policy, use DNS properly, require long passwords and enable SMB signing.

SMB relay: instead of cracking, an attacker relays the captured authentication to another server that does not require signing. Fixes: require SMB signing everywhere, disable NTLM where possible, and use account tiering (separate admin accounts for workstations, servers and domain controllers, so a stolen low-tier credential never opens a high-tier door). Toolkits such as Impacket implement these protocols in Python, which is why defenders study them too.

PowerView and domain enumeration: this PowerShell toolkit reads domain information (controllers, policy, computers, groups, GPOs) with normal directory queries. Because any domain user can read much of it, defenders monitor for bursts of directory queries, enable script-block logging and restrict who can run PowerShell remotely.

Detection and mitigation strategy: log authentication events (4624, 4625, 4768, 4769), alert on LLMNR traffic and on one account touching many hosts, patch, deploy tiering and protect privileged groups.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Why is LLMNR a security risk?

    LLMNR and NBT-NS fall back to unauthenticated broadcasts, so a rogue host can claim a name and receive authentication attempts.
  2. 2. Which control stops an SMB relay attack against a server?

    With signing required, a relayed session cannot produce valid signatures, so the connection fails.
  3. 3. What does a BloodHound graph edge such as AdminTo represent?

    Edges express relationships and permissions. Chains of them form attack paths to privileged targets.
  4. 4. Why are decoy names effective for detecting poisoning?

    A decoy query that receives an answer almost certainly came from a rogue responder, giving a low-noise alert.

Summary

  • LLMNR, NBT-NS and rogue IPv6 services let a host on the local network capture or relay authentication attempts because the fallbacks are unauthenticated.
  • Captured NTLM responses can be cracked offline or relayed live; strong passwords and SMB/LDAP signing defeat much of the risk.
  • Disable LLMNR and NBT-NS, require signing, reduce NTLM and control IPv6.
  • Decoy-name lookups and alerts on unexpected responders detect poisoning cheaply.
  • BloodHound models Active Directory as a graph so privilege paths become visible; defenders use it to cut the cheapest edges first.
  • All of this is practiced only in isolated labs or with written authorization.

Next: Logging, Monitoring and SIEM Basics