Credential access · Windows
setspn.exe
SetSPN
Reads and edits service principal names on AD accounts. Listing SPNs across the domain finds service accounts that can be Kerberoasted.
Legitimate use
Admins use it to register SPNs for services such as SQL Server and IIS.
Switches
Queries for SPNs that match a pattern. Wildcards search the whole forest.
MediumLists the SPNs on one account.
LowLimits a query to a domain.
LowAdds an SPN after checking for duplicates.
MediumAdds an SPN without checking for duplicates.
MediumDeletes an SPN.
MediumReports duplicate SPNs.
LowCommand lines to worry about
- Medium
Domain-wide SPN listing
Lists every SPN in the domain. This is the usual first step before Kerberoasting. Look for a burst of 4769 events with RC4 encryption.
Detection regex
setspn(\.exe)?\s+.*-q\s+\*\/\*
Where it is recorded
- Security4688Process creation with the full command line, when command-line auditing is enabled.
- Sysmon1Process creation with command line, hashes and parent process.
- Security4769Kerberos service tickets requested on the DC. Many requests with encryption type 0x17 follow SPN enumeration in Kerberoasting.
Community detections
1 SigmaHQ rule for setspn.exe. The explainer checks every pasted command line against all of them.
- MediumPotential SPN Enumeration Via Setspn.EXE
Detects service principal name (SPN) enumeration used for Kerberoasting
T1558.003by Markus Neis, keepwatch
Rules from SigmaHQ (rules/windows/process_creation), Detection Rule License (DRL) 1.1. Each rule links to its source and credits its authors.