A ticket anyone can ask for
Any signed-in user may ask the directory for a service ticket to any service account. The ticket is locked with a key made from that account's password.
So a service account with a weak password and the old RC4 cipher is at risk. An attacker asks for its ticket, takes it away, and guesses the password offline. That is kerberoasting. You will find the weak one, prove it safely, and fix it.
The one rule
Warning
This is your own lab directory. Requesting service tickets to crack them elsewhere needs written permission. In the UK, without it, it can break the Computer Misuse Act 1990. Here you never crack anything: you confirm the weak password with a short list of the lab's own planted guesses.
Quick check: the rule
Have a go
Quick check: the rule
3 questionsBy the end of this lesson
Note
I can find a kerberoastable account, confirm it safely, and fix it with AES and a strong password.
Key words
| Word | What it means | Example |
|---|---|---|
| SPN | service principal name: the label that makes an account a service | MSSQLSvc/db01... |
| Kerberoasting | getting a service ticket and cracking its password offline | |
| RC4 | the old cipher (arcfour-hmac) a weak service account still allows | |
| gMSA | group managed service account: a long random password the directory rotates | |
| Offline | on the attacker's own machine, where no one can see the guessing |
The cells students fill in are left blank in this preview.
Starter
Have a go
Starter
3 questionsFind the service accounts
Lesson 1's filter finds every user account with an SPN, leaving out krbtgt. There is one, svc-sql, with an SPN for a database service. An account with an SPN is one anybody can request a ticket for.
Find user accounts with an SPN
sudo ldbsearch -H /var/lib/samba/private/sam.ldb '(&(servicePrincipalName=*)(objectCategory=person)(!(sAMAccountName=krbtgt)))' sAMAccountName servicePrincipalNameShown here, not run. Press Start lab to type it into your own lab’s terminal.
Request its ticket and read the cipher
Sign in (as any user; here the administrator), then kvno asks the directory for a service ticket to svc-sql's SPN. klist -e then shows that ticket's cipher.
Read the Etype. The session key is aes256, but the ticket itself is DEPRECATED:arcfour-hmac, RC4. That ticket is what an attacker would crack.
Sign in
echo Lab-Admin-2026 | kinit [email protected]Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Request the service ticket
kvno MSSQLSvc/db01.ad.college.lab:1433Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Read the ticket's cipher
klist -e | grep -A1 MSSQLSvcShown here, not run. Press Start lab to type it into your own lab’s terminal.
Check
Have a go
Check
3 questionsConfirm the weak password, safely
An attacker would crack the ticket offline. As the auditor, you do the least intrusive thing instead. Try the account's password against a short list of likely guesses, here a single planted one.
If kinit accepts Summer2025, the password is weak and the finding is proven, with no ticket cracked and nothing taken off the machine.
Test one planted guess
echo Summer2025 | kinit [email protected] && echo 'that password is one of our short list of planted guesses'Shown here, not run. Press Start lab to type it into your own lab’s terminal.
A common mistake
Warning
People think the fix is only a longer password. A long password helps, but if the account still allows RC4 and never rotates, it is one leaked backup away from trouble. Fix the cipher and the password together, and prefer a managed account that rotates its own.
Fix it: strong password and AES only
Two changes. Give the account a long random password, the kind a group managed service account (gMSA) would set and rotate for you. Then tell it to use AES only, so it can no longer hand out an RC4 ticket.
After both, request the ticket again: it comes back aes256, and the short password list no longer opens it.
Set a long random password
sudo samba-tool user setpassword svc-sql --newpassword="$(openssl rand -base64 30)"Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Allow AES only
printf 'dn: CN=svc-sql,CN=Users,DC=ad,DC=college,DC=lab\nchangetype: modify\nreplace: msDS-SupportedEncryptionTypes\nmsDS-SupportedEncryptionTypes: 24\n' | sudo ldbmodify -H /var/lib/samba/private/sam.ldbShown here, not run. Press Start lab to type it into your own lab’s terminal.
Sign in again
echo Lab-Admin-2026 | kinit [email protected]Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Request the ticket again
kvno MSSQLSvc/db01.ad.college.lab:1433Shown here, not run. Press Start lab to type it into your own lab’s terminal.
Read the new cipher
klist -e | grep -A1 MSSQLSvcShown here, not run. Press Start lab to type it into your own lab’s terminal.
What you fixed
The ticket is AES now, and the password is long and random, so a captured ticket is useless. In lesson 6 you will see the log event, a service ticket requested with RC4, that flags a roasting attempt before anyone cracks anything.
First, the assignment: an auditor's report of which accounts are roastable.
Assignment: list the roastable accounts
An audit reads the directory into a list of accounts. Each account is a dictionary with three keys: name (a string), spn (a string, empty if the account has no service name) and kind (either "user" or "computer").
Write roastable(accounts). It returns a sorted list of the names of the accounts that could be kerberoasted: those that have a service name (spn is not empty), are a user and not a computer, and are not the built-in krbtgt. If none qualify, return an empty list.
def roastable(accounts):
return []
Make a free account to save your work and track your progress.
Exit quiz
Have a go