Who really holds the keys
Every weakness so far ends in the same place: an account powerful enough to own the directory. The last job is to know who those accounts are, keep them away from ordinary machines, and watch what everyone does.
You will find an everyday account that should not be a domain admin. Then you will learn how to keep the powerful accounts safe, and turn on the logging that catches the earlier attacks.
The one rule
Warning
Read your own lab directory's members and logs. Reading another organisation's admin groups or authentication logs needs written permission; in the UK, without it, it can break the Computer Misuse Act 1990.
Quick check: the rule
Have a go
Quick check: the rule
3 questionsBy the end of this lesson
Note
I can find over-powered accounts, apply admin tiering, and turn on logging that catches these attacks.
Key words
| Word | What it means | Example |
|---|---|---|
| Tiering | keeping admin accounts off ordinary machines, by level | |
| Tier 0 | the accounts and machines that control the whole directory | |
| Protected Users | a group that hardens its members' sign-ins | |
| Audit log | the record of who signed in, how and whether it worked | |
| Event 4624 | the logon event, with the method used | NTLMSSP or Kerberos |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
3 questionsWho is a domain admin
List the members of Domain Admins. There should be as few as possible, and each should be an account used only for admin work, never for email or browsing.
You find two: the built-in Administrator, and t0admin, an everyday account. One of those is one too many.
List the domain admins
sudo samba-tool group listmembers 'Domain Admins'Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsAdmin tiering
The defence is tiering. Tier 0 is the accounts and machines that control the directory. A tier-0 account never signs in to an ordinary laptop, because a hacked laptop could steal its ticket. That is the delegation risk from lesson 5.
Protected Users
Put the powerful accounts in the Protected Users group. It forbids them weak ciphers and NTLM and shortens their tickets. Give each admin a separate everyday account for mail and browsing.
The fix for t0admin is to move its daily use to an ordinary account, and keep the admin one for admin work only.
Turn on the logging that catches all this
A fix you cannot see fail is a fix you cannot trust. Turn on the domain controller's authentication audit. It writes one JSON record per sign-in: who, how (NTLM or Kerberos) and whether it worked.
Make one NTLM sign-in, then read the last record. It is event 4624 with NTLMSSP as the method. That is the exact thing to alert on while you phase NTLM out. Alert too on an RC4 service ticket (lesson 4) and a tier-0 logon to an ordinary host.
Turn on authentication audit logging
sudo sed -i '/^\[global\]/a log level = 0 auth_json_audit:3' /etc/samba/smb.conf && sudo smbcontrol all reload-configShown here, not run. Press Start lab to type it into your own lab’s terminal.
Make one NTLM sign-in
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.
Read the logged event
grep '"type": "Authentication"' /var/log/samba/log.smbd | tail -1 | python3 -c 'import sys,json; a=json.load(sys.stdin)["Authentication"]; print("event", a["eventId"], "|", a["authDescription"], "|", a["clientAccount"], "|", a["status"])'Shown here, not run. Press Start lab to type it into your own lab’s terminal.
A common mistake
Warning
Teams turn on logging and never decide what to alert on, so the records pile up unread. A log is only a detection if something watches it. Name the handful of events worth an alert, NTLM logons, RC4 service tickets, tier-0 logons off tier 0, and start there.
What you built
You found an over-powered account and learned to tier and protect the powerful ones. You turned on the log that shows NTLM, RC4 and admin misuse as they happen. That closes the loop from every earlier lesson.
The assignment turns the raw log into the two reports a defender actually reads.
Assignment: read the audit log
Turn an audit log into two reports.
ntlm_accounts(events) takes a list of logon events. Each is a dictionary with account (a string) and method (a string, "NTLMSSP" for NTLM or "Kerberos"). Return a sorted list of the distinct account names that signed in with NTLM. Each name appears once.
tier0_offences(sessions) takes a list of sessions. Each is a dictionary with account, is_tier0 (True if it is a tier-0 admin account) and host_is_dc (True if the machine is a domain controller). Return a sorted list of the distinct tier-0 account names that signed in to a machine that is not a domain controller.
def ntlm_accounts(events):
return []
def tier0_offences(sessions):
return []
Make a free account to save your work and track your progress.
Exit quiz
Have a go