# Windows Forensics

> Use when examining a Windows host, disk image, or triage package during an authorized forensic investigation. Covers Registry hives and values, Prefetch and ShimCache and Amcache execution artifacts, Windows Event Logs, LNK shortcut files, SRUM application usage, and user activity artifacts such as Recent files and Jump Lists. Use when you need to prove what ran, when it ran, who was logged on, and which devices or files a Windows user touched.

- Skill: `mizazhaider-ceh/windows-forensics` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/windows-forensics`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/windows-forensics/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/windows-forensics

---


Windows leaves execution and usage traces in many places at once, and the
strength of a Windows finding is usually corroboration across two or more
of them. A program that ran leaves Prefetch, a Registry trace, and often an
Event Log entry; a USB device leaves a Registry key, a setup log, and a
volume trace. This skill covers the offline workflow: extract the artifacts
from a forensic image or triage package, parse them on your workstation,
normalize every timestamp to UTC, and build the story from the artifacts
that agree. Scope: analyze Windows systems you are authorized to examine
only, and treat Registry and Event Log contents as sensitive, because they
record user behavior in detail.

## Quick Workflow

1. Identify the image or triage package, hash it, and work on a copy.
2. Extract the core artifacts: SYSTEM, SOFTWARE, SAM, SECURITY, NTUSER.DAT
   hives, Event Logs, Prefetch, Amcache, LNK files, and SRUM.
3. Parse execution artifacts first: Prefetch, ShimCache, Amcache, and
   UserAssist, to list what ran and when it last ran.
4. Parse Event Logs for logons, service installs, scheduled tasks, and
   account changes.
5. Parse user artifacts: Recent files, Jump Lists, LNK targets, and
   browser-adjacent traces, to show what the user opened.
6. Check persistence: Run keys, services, scheduled tasks, and Startup
   folders, and compare them against the execution list.
7. Correlate across artifacts and with the network and disk timelines.
8. Report each claim with the artifact, the path, and the UTC timestamp.

## 1. Extracting artifacts from an image

```bash
# List the Windows directory and confirm the artifact paths exist
fls -r -p /dev/loop0p2 | grep -Ei "Windows/(System32/config|Prefetch)|Users/[^/]+/NTUSER|Amcache|Recent" | head -60

# Extract the Registry hives by inode or path with icat, then hash them
mkdir -p /evidence/case01/windows/{hives,evtx,prefetch}
icat /dev/loop0p2 12345 > /evidence/case01/windows/hives/SYSTEM
icat /dev/loop0p2 12346 > /evidence/case01/windows/hives/SOFTWARE
sha256sum /evidence/case01/windows/hives/*

# Extract Event Logs and Prefetch the same way, keeping a manifest
fls -r -p /dev/loop0p2 | grep -i "winevt" > /evidence/case01/windows/evtx_manifest.txt
cat /evidence/case01/windows/evtx_manifest.txt | head -40
```

Inode numbers differ on every image, so find them with fls for the image
in front of you rather than reusing numbers from another case. If a hive
is missing from the image, say so, because a missing SOFTWARE hive removes
a whole class of installed-software and persistence evidence.

## 2. Registry triage with Python

```python
# Read Registry values offline with a Registry parsing library, on a copy
# of the hive, never on the original image. This example lists Run keys
# and the CurrentControlSet services, two classic persistence locations.
from Registry import Registry

reg = Registry.Registry("/evidence/case01/windows/hives/SOFTWARE")
for path in [
    r"Microsoft\Windows\CurrentVersion\Run",
    r"Microsoft\Windows\CurrentVersion\RunOnce",
]:
    try:
        key = reg.open(path)
        for value in key.values():
            print(path, value.name(), value.value())
    except Exception as exc:
        print("missing key", path, exc)

system = Registry.Registry("/evidence/case01/windows/hives/SYSTEM")
key = system.open(r"ControlSet001\Services")
for subkey in key.subkeys():
    print("service", subkey.name())
```

```bash
# Search raw hive text and parsed output for indicators of compromise
rg -i "powershell|certutil|bitsadmin|rundll32" /evidence/case01/windows/parsed/ 2>/dev/null | head -40

# UserAssist shows programs launched from Explorer, with run counts
# Parse NTUSER.DAT UserAssist values and sort by last execution time
python3 /evidence/case01/scripts/parse_userassist.py /evidence/case01/windows/hives/NTUSER.DAT | sort -k 2 | tail -40
```

A Run key value alone proves persistence was configured, not that the
program ran. Pair it with Prefetch or an Event Log entry before claiming
execution, and check whether the target file still exists on the image.

## 3. Prefetch, ShimCache, and Amcache execution evidence

```bash
# Prefetch files encode the executable name, run count, and last run time
ls -l /evidence/case01/windows/prefetch/
python3 /evidence/case01/scripts/parse_prefetch.py /evidence/case01/windows/prefetch/*.pf | sort -t $'\t' -k 3 | tail -40

# Amcache records first execution and file metadata for programs that ran
python3 /evidence/case01/scripts/parse_amcache.py /evidence/case01/windows/Amcache.hve | head -60

# ShimCache from the SYSTEM hive lists executables seen by the loader
python3 /evidence/case01/scripts/parse_shimcache.py /evidence/case01/windows/hives/SYSTEM | sort | uniq | head -60
```

Prefetch is capped, usually at 128 entries on modern Windows, and old
entries age out, so absence of a Prefetch file is weak evidence of
non-execution. ShimCache and Amcache survive longer but have their own
limits, which is why execution claims should cite every artifact that
supports them and note which ones were checked and empty.

## 4. Windows Event Log triage

```bash
# Convert EVTX to JSON lines for filtering with jq
python3 -m Evtx.Evtx -o /evidence/case01/windows/evtx_json /evidence/case01/windows/evtx/Security.evtx

# Successful and failed logons, with account and source address
jq -r 'select(.Event.System.EventID == 4624 or .Event.System.EventID == 4625)
  | [.Event.System.TimeCreated["#attributes"].SystemTime,
     .Event.System.EventID,
     .Event.EventData.Data[5],
     .Event.EventData.Data[18]] | @tsv' \
  /evidence/case01/windows/evtx_json/Security.json | sort | head -60

# Service installs and scheduled task creation, classic persistence events
jq -r 'select(.Event.System.EventID == 7045 or .Event.System.EventID == 4698)
  | [.Event.System.TimeCreated["#attributes"].SystemTime,
     .Event.System.EventID,
     .Event.System.Computer] | @tsv' \
  /evidence/case01/windows/evtx_json/System.json \
  /evidence/case01/windows/evtx_json/Security.json 2>/dev/null | sort | head -40
```

Event IDs are stable, but the position of fields inside EventData varies
by Windows version and by event, so verify the field mapping against one
known event in the log before trusting a bulk extraction. A logon type 3
from a workstation is normal, while the same event at an odd hour from an
unusual source deserves a closer look, not an automatic verdict.

## Edge cases

- The SYSTEM hive has multiple ControlSets. Check which one is marked
  Current in the Select key, and parse that one, or parse all of them and
  label which is current.
- Event Logs rolled over and the oldest entries are gone. Note the
  earliest timestamp present, and do not claim nothing happened before it.
- Prefetch is disabled on some systems, and SSD optimizations change
  Prefetch behavior. Confirm the PrefetchParameters value before treating
  an empty Prefetch folder as suspicious.
- Timestamps in Registry values and Event Logs use different formats
  and timezones. Convert everything to UTC before comparing, and record
  the conversion.
- A user profile hive is locked or missing because the user was deleted.
  Check for a backup hive, the profile list in SOFTWARE, and the remaining
  user folder for what survives.

## Key references

- NIST SP 800-86 (Guide to Integrating Forensic Techniques into Incident
  Response).
- Microsoft documentation on Windows Event Log event IDs and Registry
  structure.
- SANS Windows Forensic Analysis poster and artifact reference material.
- The Sleuth Kit documentation for fls and icat on Windows filesystems.

