The sign-in from the 1990s is still on
Long before Kerberos, Windows signed people in with NTLM: a challenge and a response made from the password hash. It still works on most directories today, and that is a problem.
NTLM can be relayed. An attacker gets one machine to authenticate to them, then passes that authentication straight on to another server, as the victim. You will see it is on, learn the relay, and turn it off.
The one rule
Warning
Everything here is on your own lab directory. Capturing or relaying authentication on a network that is not yours needs written permission. In the UK, without it, it can break the Computer Misuse Act 1990. The lab has no second machine, so the relay itself is explained, not run.
Quick check: the rule
Have a go
Quick check: the rule
3 questionsBy the end of this lesson
Note
I can check whether a directory accepts NTLM, explain a relay, and turn NTLM off safely.
Key words
| Word | What it means |
|---|---|
| NTLM | the old challenge-response sign-in, made from the password hash |
| Relay | passing a captured authentication on to another server as the victim |
| SMB signing | signing each SMB message so a relay cannot be injected |
| testparm | the tool that shows Samba's effective settings |
| Fallback | an old method a system keeps accepting beside a new one |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
3 questionsIs NTLM accepted?
The least intrusive check is to read the setting and then try one sign-in. testparm shows Samba's effective value for ntlm auth. The default, ntlmv2-only, means NTLM is accepted.
Then prove it: ask smbclient to list the shares while forbidding Kerberos, so it must use NTLM. It works.
Read the NTLM setting
testparm -v -s 2>/dev/null | grep -i 'ntlm auth ='Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Sign in with NTLM only
smbclient -L DC01 -U svc-sql%Summer2025 --option=clientusekerberos=noShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsHow a relay works
Picture three machines. An attacker tricks a server into authenticating to them with NTLM, with an email link to a share, say. The attacker cracks nothing. They open a connection to a second server and forward the victim's challenge-response to it, step for step.
The second server sees a valid NTLM login as the victim and lets the attacker in.
The two defences against relay
The defence is twofold. Do not accept NTLM at all, and sign every SMB message so a forwarded one is rejected. Your lab's domain controller already requires SMB signing. The piece left is NTLM itself.
Turn NTLM off
Set ntlm auth = disabled in the directory's configuration and reload it. One line does both. After it, an NTLM sign-in has nothing to relay.
Turning NTLM off can break something old that still needs it. So in real life you watch the logs first (lesson 6) to see who still uses it. Here, nothing does.
Disable NTLM and reload
sudo sed -i '/^\[global\]/a ntlm auth = disabled' /etc/samba/smb.conf && sudo smbcontrol all reload-configShown here, not run. Press Start lab to type it into your own lab’s terminal.
Try the NTLM sign-in again
smbclient -L DC01 -U svc-sql%Summer2025 --option=clientusekerberos=noShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check Kerberos still works
smbclient -L DC01.ad.college.lab --use-kerberos=requiredShown here, not run. Press Start lab to type it into your own lab’s terminal.
A common mistake
Warning
People fear that turning NTLM off locks everyone out. It does not: Kerberos still signs people in, as the last Run shows. What breaks is only software that never learned Kerberos, which is exactly what you want to find and replace.
What you changed
You read that NTLM was accepted, saw a sign-in use it, disabled it, and confirmed the same sign-in is now blocked while Kerberos carries on. In lesson 6 you will find the log event that shows who was using NTLM before you turned it off.
Next, the weak ticket from lesson 2: kerberoasting.
Exit quiz
Have a go