Hijacking a legitimate task instead of creating one.
What gives it awayA recognised task name whose Command now points at a user-writable directory or a shell. Auditing by task name alone will never catch this.
ATT&CK T1053.005Nothing matches that yet. Tell us what you were looking for and it goes on the list.
Windows Security Log · Event 4702
An existing scheduled task was modified. It is far noisier than task creation, because Windows updates its own maintenance tasks constantly — and that noise is exactly what makes hijacking an existing task quieter than creating a new one.
Also written as Event ID 4702A scheduled task was updated4702 task modified
A scheduled job on this PC was changed. Windows adjusts its own maintenance schedules regularly, so this is usually nothing.
The volume difference from 4698 matters. Windows Update, defragmentation, and telemetry tasks rewrite themselves on a cycle, and those updates dominate. Baseline them by task path — most live under \Microsoft\Windows\ — and what remains is small. The detection is a task whose name you recognise but whose Command no longer points where it used to, which no amount of name-based auditing will catch.
Sanitised. Addresses come from the RFC 5737 documentation ranges.
A scheduled task was updated.
Subject:
Security ID: CORP\jbrooks
Account Name: jbrooks
Account Domain: CORP
Logon ID: 0x3E9A11
Task Information:
Task Name: \Microsoft\Windows\Defrag\ScheduledDefrag
Task Content: <?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2">
<Triggers><LogonTrigger><Enabled>true</Enabled></LogonTrigger></Triggers>
<Principals><Principal id="Author"><UserId>S-1-5-18</UserId><RunLevel>HighestAvailable</RunLevel></Principal></Principals>
<Actions>
<Exec>
<Command>C:\Users\jbrooks\AppData\Local\Temp\wh.exe</Command>
</Exec>
</Actions>
</Task> Everything else in the log line is context.
A Command that no longer matches the task's stated purposeThe hijack pattern. A familiar name now running something else. A Command in a temp or user profile directoryTasks do not normally run things from there. A newly added <LogonTrigger> or <BootTrigger>A task that did not previously run at startup now does. <UserId>S-1-5-18</UserId> addedThe task now runs as SYSTEM when it previously did not. Most of the time it is one of these.
What gives it awayA recognised task name whose Command now points at a user-writable directory or a shell. Auditing by task name alone will never catch this.
ATT&CK T1053.005What gives it awayA task that previously ran on a schedule now also carrying a logon or boot trigger.
ATT&CK T1053.005What gives it awayA task modified to run as SYSTEM or with HighestAvailable when it previously did not.
ATT&CK T1053.005What gives it awayAn update returning a task to its original definition shortly after the payload ran, which removes the evidence while leaving the task in place.
ATT&CK T1070SecurityEvent | where EventID == 4702 | where SubjectUserName != 'SYSTEM' | where RenderedDescription has_any ('\\Temp\\','\\AppData\\','powershell','cmd.exe','-enc ') | project TimeGenerated, Computer, SubjectUserName, RenderedDescription SecurityEvent | where EventID == 4702 | extend Task = extract(@'Task Name:\s*(\S+)', 1, RenderedDescription) | where Task startswith '\\Microsoft\\Windows\\' | summarize count() by Task | order by count_ desc | take 20 Get-ScheduledTask | Where-Object { $_.Date -and ([datetime]$_.Date) -gt (Get-Date).AddDays(-30) } | Select-Object TaskName, TaskPath, Date, @{n='Runs';e={$_.Actions.Execute}} Because Windows rewrites its own scheduled tasks routinely — update, defragmentation, and telemetry tasks all update their definitions on a cycle, and each rewrite logs one. Filter to updates made by accounts other than SYSTEM, and to tasks outside \Microsoft\Windows\, and the volume drops to something you can actually read.
Because the name stays familiar. A new task called something unusual stands out in a task list; an existing Windows maintenance task that now runs a different command does not. Anyone auditing by task name walks straight past it, which is why comparing the Command against a known-good machine matters more than reviewing names.
Pull the same task from a machine of the same build with `Export-ScheduledTask -TaskName <name>` and diff the XML. The Command, the triggers, and the Principal are the three parts worth checking. Task definitions are stable across identical builds, so a difference is meaningful.
Last reviewed 28 August 2026