Reading width
Wide uses the full column for everything, text, diagrams, code, and exercises. Narrow keeps the standard reading width.
Text size
Scales the body text. Headings and code blocks keep their size.
In this section
Proving Execution on Windows: Prefetch, Amcache, Shimcache and BAM
Introduction
"Did it run?" is the question asked most often in a Windows investigation, and the one answered wrongly most often. A file on disk is not evidence that it ran.
A file in a list of recently seen programs may not be either. Windows records execution in several independent places, each written by a different component for its own purposes, and each one records a different fact about the same event.
One program, six places. Each records a different fact about the same execution, and none of them records everything.
This lesson reads all of them for the four programs at the center of this course's ransomware case, on YORK-WS-033, the finance workstation encrypted on 18 March. It takes each artifact in turn, says what it proves and what it does not, and ends with the cross-source matrix an investigator writes before saying any program ran.
Module 2 teaches each artifact in full; here the aim is the habit of never resting on one.
What Counts as Proof of Execution
Presence, inventory and a process startingThree different claims hide inside "the program ran". The weakest is that the file existed on the system. Stronger is that Windows inventoried it as a program it had seen.
Strongest is that a process was created from it, at a known time, by a known account, from a known parent. Investigators who blur the three end up writing findings that a defense expert takes apart in one question: how do you know it executed?
The artifacts sort roughly by which claim they support:
Execution evidence from strongest to weakest. The top two say a process started; the bottom two mainly say a file existed, and need corroboration before anyone writes "it ran".
Written as the three claims, with the evidence each one needs, the distinction is easier to hold on to during an investigation:
Three claims inside "it ran"
Before any findingThe order is not absolute. A process creation event is the strongest evidence only if logging was on and the log survived, and lesson 0.8 shows how often it does not.
Prefetch is strong but can be disabled, and on servers often is. Amcache and shimcache exist on almost every Windows system, which is why they matter even though they prove less: when the stronger sources are gone, they are what is left.
That is the working rule for this whole module. Every execution finding names at least two independent artifacts, and says which claim each one supports. A single artifact is a lead to follow, never a conclusion.
On the ransomware workstation, every program that mattered left enough independent traces to meet the rule several times over, which is typical when an attacker moves quickly and does not expect a forensic examination. A careful attacker deletes prefetch, clears logs and timestomps files, and lesson 0.8 shows what survives each of those.
The order of reading also matters. An investigator starts from the artifact most likely to exist and most likely to name the program: prefetch on a workstation, amcache everywhere. Then each candidate is checked against the stronger sources for time, account and parent. Working the other way, from the event logs first, misses programs that ran while logging was off.
Prefetch
A run count, run times and every file the program loadedPrefetch exists to make programs start faster. Windows watches the first seconds of each program's start, records which files it loaded, and writes a .pf file named for the executable and a hash of its path. The next start reads that list and preloads the files.
As a side effect, the prefetch file records that the program ran, how many times, and when. The PECmd documentation lists what it parses from each file: the executable's name, full path and hash, the run count and last run times, the volumes, and the directories and files loaded.
The encryptor's prefetch record:
Executable name LOCKER.EXE
Prefetch file C:\Windows\Prefetch\LOCKER.EXE-A9B0C1D2.pf
Path hash A9B0C1D2
Run count 1
Last run 2026-03-18T02:30:00.000Z
Previous runs (none)
Directories 34
Files referenced 2,847
One run, at 02:30:00 on 18 March, from a program whose prefetch file is named for LOCKER.EXE with path hash A9B0C1D2. The striking field is the last one: 2,847 files referenced.
A legitimate program loads a few dozen files at start; a ransomware encryptor walking a user's documents touches thousands within the window prefetch watches. The referenced-file list itself names them, and Module 2 reads it to scope what the encryptor reached.
The run count matters as much as the times. PsExec's record shows two runs:
Executable name PSEXEC.EXE
Run count 2
Last run 2026-03-18T02:14:33.000Z
Previous run 1 2026-03-18T02:12:11.000Z
Files referenced 8
Two runs two minutes apart. The parsed record has room for eight run times, so a program run many times keeps its last eight; a count higher than the number of times shown means older runs have rolled off. Here both runs are present, and the process creation events in section six show they were two connections to two different servers.
Parsing a whole prefetch folder is one command with PECmd, writing a CSV of every file and a timeline with one row per run:
PS C:\> .\PECmd.exe -d E:\Cases\YORK-WS-033\C\Windows\Prefetch `
--csv E:\Out\YORK-WS-033 --csvf prefetch.csv
The CSV holds one row per prefetch file and the timeline file one row per run time, so a host's whole execution history from prefetch can be sorted by time in seconds.
On a workstation that is usually several hundred programs, nearly all of them ordinary, and the attacker's handful stand out by name, path, run count and time together. Prefetch is not enabled on every Windows edition by default; servers often have it off, which is one reason the other artifacts in this lesson matter.
Amcache
What Windows inventoried, with a hashAmcache is a registry hive, Amcache.hve, in which Windows keeps an inventory of programs and files it has seen, for compatibility purposes. Its value to an investigator is twofold: it records a SHA-1 hash of each file, which identifies the binary even after it is renamed or deleted, and it links files to the installed programs they came from.
AmcacheParser's documentation makes the point directly: linking file entries to their programs means what did not come from an installed program stands out.
On the ransomware workstation, the difference is visible at a glance:
ProgramName Publisher First seen (UTC)
---------------- ---------------------- --------------------
Microsoft Edge Microsoft Corporation 2025-06-15T10:22:33
PuTTY Simon Tatham 2025-09-14T11:33:44
DocuSign_Review (none) 2026-03-18T01:50:44
mshelper64 (none) 2026-03-18T02:00:55
locker (none) 2026-03-18T02:28:33
Edge and PuTTY have publishers, versions and inventory dates months old. Three entries have no publisher and no version: DocuSign_Review, mshelper64 and locker, inventoried at 01:50:44, 02:00:55 and 02:28:33 on 18 March, from a Downloads folder and a temp folder. Three programs with no publisher, from user-writable folders,, first seen within forty minutes of each other at night, are the shape of an intrusion.
What amcache does not prove is execution. Windows can inventory a file without running it, and the time recorded is when the entry was written, which is usually close to the first run but not always. In this case each amcache time sits seconds or minutes before the matching prefetch run, which is consistent with execution, and the stronger artifacts confirm it.
The hash is the field to carry forward. The SHA-1 of locker.exe can be searched in threat intelligence, compared across every host in the estate, and used in Module 2 to find the same binary under a different name elsewhere.
The absence of a publisher is a lead, not a verdict. Plenty of legitimate in-house tools and scripts compiled by an IT team have no publisher either, and some malware carries a stolen or forged one.
What makes these three entries stand out is the combination: no publisher, a user-writable folder, a first-seen time at night, and a gap of minutes between them. Any one of those alone would be weak; together they choose which files an investigator hashes and looks up first.
Shimcache
Present on disk, and a flag that is easy to misreadThe application compatibility cache, usually called shimcache, is kept in the SYSTEM hive so Windows can apply compatibility fixes to programs quickly. It records file paths in order, most recently added or updated first, with each file's last-modified time.
AppCompatCacheParser's documentation is precise about the two fields most often misread: the time is the file's $STANDARD_INFORMATION modified time when it was added to the cache, and on Windows 10 and 11 the executed field comes from a tag in the entry's data.
The newest entries on the ransomware workstation, and one older entry for comparison:
Pos Path Modified Exec
--- ------------------------------------------------------ ---------- ----
29 C:\Users\t.bennett\AppData\Local\Temp\locker.exe 2026-03-18 Yes
28 C:\Users\t.bennett\AppData\Local\Temp\PsExec.exe 2026-03-18 Yes
27 C:\Users\t.bennett\AppData\Local\Temp\mshelper64.exe 2026-03-18 Yes
26 C:\Users\t.bennett\Downloads\DocuSign_Review.exe 2026-03-18 Yes
11 Program Files\Microsoft Office\root\Office16\EXCEL.EXE 2026-03-11 No
The newest four are the attacker's programs, in the order they arrived: the download, the helper, PsExec, the encryptor. Their times are when each file was last modified, which for a freshly written file is close to when it landed on disk, not when it ran.
The Excel entry shows the other case: a program present in the cache with the executed field set to No, though Excel certainly ran on this machine, as its own prefetch and BAM records show.
That is shimcache's lesson. It is strong evidence that a file existed at a path, and useful for ordering, and weak evidence of execution. 6 entries on this host carry No, and at least one of them is a program the user ran daily. A finding that rests on shimcache alone should say that the file was present, and look elsewhere for whether it ran.
Its other strength is persistence. Shimcache is written to the registry at shutdown and survives the deletion of the file it describes, so a tool the attacker deleted after use can still be named here when nothing else remains on disk.
The ordering is the other reason to read it. Because entries are kept most recent first, the four attacker programs sit at the top of the list in the sequence they arrived. Where every other source has been wiped, that ordering alone can say which tool came before which, even when it cannot say when any of them ran.
BAM and UserAssist
Which account ran itPrefetch, amcache and shimcache are system-wide: they say a program ran on the machine, not who ran it. Two artifacts record execution per account.
The Background Activity Moderator, BAM, keeps a key per user SID in the SYSTEM hive with the last execution time of each program that account ran. UserAssist, in each user's NTUSER.DAT, records programs that account launched through the Windows shell, with a run count and the time spent in focus.
BAM on the ransomware workstation, for the last evening:
Account Program Last execution (UTC)
------- --------------------- --------------------
...-2156 msedge.exe 2026-03-17T20:54:24
...-2156 DocuSign_Review.exe 2026-03-18T01:51:22
...-500 mshelper64.exe 2026-03-18T02:01:15
...-500 PsExec.exe 2026-03-18T02:12:11
...-500 locker.exe 2026-03-18T02:30:00
The SID column is the finding. The download ran under the SID ending 2156, t.bennett's own account. The helper, PsExec and the encryptor ran under the SID ending 500, the built-in Administrator. Between the first program and the second, the attacker went from a user's privileges to the most privileged local account on the machine, and BAM records the boundary without anyone having configured it to.
UserAssist agrees on the first step and is silent on the rest. t.bennett's UserAssist records DocuSign_Review.exe launched once from the shell at 01:51:22, beside everyday entries such as Edge with 445 runs. The attacker's later programs are not in it, because they were started from a command prompt by another account rather than by t.bennett double-clicking them. An artifact's silence is evidence too, when its scope is understood.
BAM has limits worth knowing before relying on it. It keeps the last execution time only, not a history, so a program run every day shows one time. And it records programs run by an account in the background as well as in the foreground, which is why the Administrator's command-line tools appear in it while UserAssist ignores them.
A Process Creation Event
Parent, command line, account and hashThe strongest single record of execution is a process creation event: Sysmon event 1, or Security event 4688 when command-line auditing is on. It records the moment a process started, the program, its full command line, its parent process, the account and integrity level, and with Sysmon a hash. The ransomware workstation ran Sysmon, and its process creation events for the four programs read:
01:51:22 DocuSign_Review.exe parent msedge.exe t.bennett
02:01:15 mshelper64.exe parent cmd.exe SYSTEM
02:12:11 PsExec.exe parent cmd.exe nge-admin
02:14:11 PsExec.exe parent cmd.exe nge-admin
02:30:00 locker.exe parent cmd.exe SYSTEM
locker.exe command line:
locker.exe --encrypt --target C:\Users --ext .locked --note !!README_RESTORE_FIL
ES!!.txt
These records answer questions no other artifact can. The download was started by Edge, so the user ran it from the browser, which points Module 4 at the browser and mail for how it arrived.
The helper was started from a command prompt as SYSTEM with the argument --dump, which suggests credential dumping. PsExec was run twice as nge-admin against the file server and the domain controller. The encryptor's command line names its targets, its extension and its ransom note.
They also depend on configuration. The Security log on this host has no event 4688 at all, because process auditing was not enabled, so without Sysmon none of this would exist. Sysmon itself records only what its configuration asks for, and an attacker with administrator rights can stop it. That is why process creation events sit at the top of the ladder and still need the artifacts below them.
Small differences between sources are normal. Sysmon records PsExec's second start at 02:14:11 and prefetch records its last run at 02:14:33; prefetch writes its time a few seconds into the program's start. Module 9 sets out how much disagreement between sources is expected and how much is a finding.
The command lines deserve a second reading for what they say about the attacker. The encryptor was told exactly where to go and what to leave behind, and PsExec was given a named administrator account and a password on its command line; the parsed record shows the password masked, but the switch that carried it is there.
An attacker who passes credentials on a command line has already stolen them, which sends the investigation back to the helper's --dump argument and to the question Module 2 asks next: which credential tool ran, and what did it take?
Putting the Sources Together
An execution matrixWith every artifact read, the four programs line up:
Four programs on 18 March, each confirmed by at least four artifacts. The account changes after the first: the user ran the download, and everything after it ran with more privilege than the user had.
Each name in that chain rests on several independent records, written by different components for different reasons, agreeing on the program and the time. That agreement is what makes the finding strong. Writing it down is the step most often skipped:
Execution matrix: four programs, YORK-WS-033
CorroboratedHow to read it
A program named by one artifact is a lead. A program named by three that record different things, in agreement on the time, is a finding.
The matrix is also where gaps show. PsExec has no amcache entry here, though it has every other artifact; an investigator notes the absence and does not need to explain it to reach the finding, because four other sources agree. A program named by only one weak source, by contrast, stays a lead in the matrix until something stronger confirms it.
Two findings come out of this table that no single artifact gives.
The attack moved from the user's account to the Administrator account between the download and the helper, which BAM shows and Sysmon confirms. And the encryptor was the last step of a sequence that began with a program the user ran from the browser forty minutes earlier, which only the combined timeline shows. Both are questions Module 2 and the investigation modules answer in full.
The matrix is also the document that survives scrutiny. When a finding is challenged, by a lawyer, an insurer or the attacker's own employer, the question is always the same: how do you know?
An answer that lists independent sources, says what each one recorded and shows they agree is very hard to dispute. An answer that names one artifact and an interpretation of it is easy to dispute, however confident the analyst was.
What Module 2 Builds On It
The execution artifacts in fullModule 2 takes the hierarchy in this lesson and teaches each layer in depth: the execution evidence hierarchy itself, prefetch, amcache, BAM, DAM and SRUM, process creation events, PowerShell evidence, identifying credential tools and command-and-control and lateral movement tools from what they leave, the anti-forensic tricks aimed at execution evidence, and a cross-source execution timeline built from all of them.
The habits it builds on are the ones this lesson used. Name the claim each artifact supports. Never write "ran" on the strength of presence alone. Read the account wherever an artifact records one, because the change of account is often the most important fact in the case. And put every program into a matrix before writing a finding about it.
The questions Module 2 trains, asked of every program in every case, fit on one card:
Five questions for every program in a case
Module 2Those habits carry into every later module. Lateral movement, persistence and anti-forensics all begin with a program running, and each of their findings is only as strong as the execution evidence underneath it.
A persistence mechanism matters because of the program it starts; a lateral movement finding names the tool that crossed; an exfiltration finding names the program that sent the data. Each of those programs goes through the same five questions first.
Practice
What ran, and as whom? prepared evidenceThe prepared evidence below is part of the ransomware workstation's prefetch, its newest shimcache entries and its BAM records. Separate proof of execution from proof of presence, and find the account each program ran under.
If you have a Windows machine of your own, run PECmd against C:\Windows\Prefetch and AppCompatCacheParser against the live registry, then pick one program you ran today and find it in both. Note which fields agree and which time each artifact records.
Windows records execution in several places, each for its own purposes: prefetch for performance, amcache and shimcache for compatibility, BAM and UserAssist per account, and process creation events where logging is on. Each proves a different claim, from presence to a process starting, and a finding that a program ran names at least two of them in agreement.
The next lesson moves from programs to people: which accounts were present, how they logged on, and what they touched.
Resources
Microsoft revises these pages; where a page and this lesson disagree, the page is newer.