User account attributes modified. Includes: UserAccountControl flags, PasswordExpiry, AccountExpires, SamAccountName, UserPrincipalName, ServicePrincipalNames.
Key attacks: SamAccountName spoofing (noPac/CVE-2021-42278), adding SPNs to user accounts for Kerberoasting, setting PasswordNeverExpires, disabling lockout. Attacker with write access to AD objects can silently modify these flags.
Alert: UserAccountControl change that sets DONT_REQUIRE_PREAUTH (flag 4194304) — enables AS-REP roasting. Alert: SamAccountName change on computer accounts (noPac). Alert: SPN added to user account (Kerberoasting setup). Alert: PasswordNeverExpires set on non-service accounts.
SubjectUserNameTargetUserNameLogonTypeIpAddressWorkstationName | Tactic | Technique |
|---|---|
| Persistence | Account Manipulation (T1098) |
| Credential Access | Kerberoasting (T1558.003) |
Starting points — adapt the log source, projected fields and thresholds for your environment.
SecurityEvent
| where EventID == 4738 // A user account was changed
| project TimeGenerated, Computer, SubjectUserName, TargetUserName, LogonType, IpAddress, WorkstationName
| sort by TimeGenerated desc
index=* sourcetype="WinEventLog:Security" EventCode=4738
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count `# A user account was changed — add EventData fields: SubjectUserName, TargetUserName, LogonType, IpAddress`
A user account was changed. User account attributes modified. Includes: UserAccountControl flags, PasswordExpiry, AccountExpires, SamAccountName, UserPrincipalName, ServicePrincipalNames.
Event 4738 is written to the Security channel by Microsoft-Windows-Security-Auditing. Advanced Audit Policy — enable the 'Account Management' subcategory (Success and/or Failure).
Event 4738 is associated with: Account Manipulation (T1098), Kerberoasting (T1558.003).
Alert: UserAccountControl change that sets DONT_REQUIRE_PREAUTH (flag 4194304) — enables AS-REP roasting. Alert: SamAccountName change on computer accounts (noPac). Alert: SPN added to user account (Kerberoasting setup). Alert: PasswordNeverExpires set on non-service accounts.