Existing scheduled task was modified. New TaskContent replaces old content.
Stealthy persistence by modifying existing legitimate tasks rather than creating new ones — task retains its original name but executes attacker payload.
Alert: TaskContent changes adding PowerShell, cmd, or paths in temp/user directories. Compare new vs. old task content if available.
SubjectUserNameTargetUserNameLogonTypeIpAddressWorkstationName | Tactic | Technique |
|---|---|
| Persistence | Scheduled Task (T1053.005) |
Starting points — adapt the log source, projected fields and thresholds for your environment.
SecurityEvent
| where EventID == 4702 // A scheduled task was updated
| project TimeGenerated, Computer, SubjectUserName, TargetUserName, LogonType, IpAddress, WorkstationName
| sort by TimeGenerated desc
index=* sourcetype="WinEventLog:Security" EventCode=4702
| stats count earliest(_time) as first_seen latest(_time) as last_seen by ComputerName
| sort - count `# A scheduled task was updated — add EventData fields: SubjectUserName, TargetUserName, LogonType, IpAddress`
A scheduled task was updated. Existing scheduled task was modified. New TaskContent replaces old content.
Event 4702 is written to the Security channel by Microsoft-Windows-Security-Auditing. Advanced Audit Policy — enable the 'Policy Change' subcategory (Success and/or Failure).
Event 4702 is associated with: Scheduled Task (T1053.005).
Alert: TaskContent changes adding PowerShell, cmd, or paths in temp/user directories. Compare new vs. old task content if available.