A user or computer account was renamed. OldTargetUserName → NewTargetUserName.
Renaming built-in accounts (Administrator, Guest) to hide them. Renaming backdoor accounts to mimic legitimate accounts. SamAccountName rename is used in noPac exploitation.
Alert: renaming of Administrator, Guest, DefaultAccount. Alert: new name closely resembles existing admin accounts (typosquatting).
SubjectUserNameTargetUserNameLogonTypeIpAddressWorkstationName | Tactic | Technique |
|---|---|
| Defense Evasion | Masquerading (T1036) |
Starting points — adapt the log source, projected fields and thresholds for your environment.
SecurityEvent
| where EventID == 4781 // The name of an account was changed
| project TimeGenerated, Computer, SubjectUserName, TargetUserName, LogonType, IpAddress, WorkstationName
| sort by TimeGenerated desc
index=* sourcetype="WinEventLog:Security" EventCode=4781
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count `# The name of an account was changed — add EventData fields: SubjectUserName, TargetUserName, LogonType, IpAddress`
The name of an account was changed. A user or computer account was renamed. OldTargetUserName → NewTargetUserName.
Event 4781 is written to the Security channel by Microsoft-Windows-Security-Auditing. Advanced Audit Policy — enable the 'Account Management' subcategory (Success and/or Failure).
Event 4781 is associated with: Masquerading (T1036).
Alert: renaming of Administrator, Guest, DefaultAccount. Alert: new name closely resembles existing admin accounts (typosquatting).