Bundled with Unleash skills pack. Source: C:\Users\Admin.agents\skills\windows-recovery-state-research\SKILL.md
Windows Recovery-State Vulnerability Research
Overview
Hunt trust failures that appear only when Windows transitions between the online OS, reboot orchestration, WinRE/WinPE, Defender Offline, setup, and BitLocker unlock states. For acquisition-focused research, require zero-day-target-eligibility to pass on current stable bytes.
The key invariant is:
Pre-authentication code and configuration must come from authenticated, correctly bound storage, and an unlocked OS volume must not become accessible to attacker-controlled recovery code or state.
These bugs are usually state-machine and provenance failures, not cryptographic breaks.
When to Use
Use for:
- WinRE/WinPE command or configuration discovery;
- BitLocker volume availability before user authentication;
- Defender Offline scan scheduling and persisted recovery state;
ReAgent.xml, BCD entries, recovery sequence, or scheduled operations;
unattend.xml, RunSynchronous, Windows PE setup passes, or offline servicing;
- writable recovery/EFI/removable media consumed as trusted input;
- transaction logs, restore artifacts, or filesystem metadata interpreted during recovery;
- behavior that depends on whether a workflow was previously initiated in the full OS.
Phase 1: Establish the Boot Trust Model
Record:
- hardware/VM, UEFI/legacy mode, Secure Boot, TPM version and state;
- BitLocker conversion/protection status, encryption method, key protectors, auto-unlock state, and PIN/startup-key policy;
- OS edition/build and exact
winre.wim build/hash;
- recovery partition type, GPT GUID, filesystem, offset, size, ACLs, and mount state;
- EFI and other auxiliary partitions;
- BCD store hash/export and recovery sequence;
reagentc /info output and ReAgent.xml hash/content;
- Defender platform version and offline-scan state where relevant;
- physical/removable media assumptions.
Do not claim a BitLocker bypass until the protector model is explicit. TPM-only and TPM+PIN are materially different.
Completion criterion: another researcher can rebuild the same boot and protector state from the record.
Phase 2: Draw the Cross-Reboot State Machine
Model at least:
online OS
-> privileged feature schedules recovery/offline action
-> state/config written to disk/BCD
-> reboot manager selects WinRE
-> BitLocker key release/volume unlock
-> WinRE locates config/artifacts
-> command/component starts
-> operation completes or aborts
-> state is cleared or persists
-> return to online OS
For each transition record:
- component making the decision;
- storage location and writer permissions;
- integrity/authenticity protection, if any;
- volume and path resolution order;
- whether removable or alternate partitions are searched;
- whether OS volume unlock occurs before configuration validation;
- cleanup/persistence behavior after cancellation, failure, and successful completion.
Completion criterion: identify each persisted state field that survives reboot and every parser/launcher that consumes it.
Phase 3: Inventory Pre-Auth Inputs
Search and diff:
- recovery partition
Recovery\WindowsRE tree;
ReAgent.xml and sibling files;
- BCD device/path objects and recovery sequence;
- Defender Offline directories and operation parameters;
- Panther/setup/unattend locations recognized by WinPE;
- startup scripts, answer files, drivers, packages, and offline-servicing manifests;
System Volume Information, transaction/restore metadata, and filesystem logs;
- EFI boot applications and configuration;
- removable media roots and volume-label/GUID-based discovery.
For every artifact record:
| Artifact |
Writer |
Writable pre-auth? |
Consumer |
Search order |
Authenticated? |
Sensitive effect |
Completion criterion: all command-bearing and path-bearing artifacts have provenance and consumer entries.
Phase 4: Differential State Testing
Change one state variable at a time:
- clean machine versus one where Defender Offline was initiated once;
- operation pending, completed, canceled, interrupted, and stale;
- warm reboot, cold boot, power loss, and recovery entered through different paths;
- internal recovery partition versus removable USB versus copied EFI/recovery contents;
- valid, missing, malformed, duplicated, and conflicting config files;
- OS/recovery image versions matched versus mismatched;
- recovery enabled/disabled, partition relocated, and custom WinRE image;
- TPM-only, TPM+PIN, recovery-password-only, and suspended protection;
- Windows 10/11 and relevant Server builds.
After every run, recapture BCD, ReAgent.xml, mount/unlock events, and artifact hashes. Machine history is a test variable, not background noise.
Completion criterion: a table identifies the minimum state transition required for the unexpected behavior.
Phase 5: Trace File and Component Discovery
Static and dynamic options:
- mount
winre.wim read-only and inventory binaries, services, scripts, manifests, and strings;
- compare same-named binaries in normal Windows and WinRE by hash, imports, strings, and CFG;
- Procmon in a lab WinPE/WinRE environment where feasible;
- boot logging, ETW, serial/kernel debugging, and filesystem minifilter traces;
- reverse engineer code that builds search paths or parses
ReAgent.xml, BCD, setup XML, or transaction metadata;
- inspect signature verification and device/volume binding before launch.
When a component exists both online and in WinRE, diff behavior rather than assuming equivalence. Recovery-only code paths are high-value.
Completion criterion: identify the exact parser/launcher and its input search order.
Phase 6: Test Provenance and Volume Binding
High-yield hypotheses:
Trusted config from writable media
A recovery component locates XML, logs, scripts, or metadata on a partition an attacker can modify offline, then executes or interprets it after the OS volume is unlocked.
Test which property selects the source: disk number, partition GUID, offset, relative path, volume label, first match, or copied state.
Stale privileged mode
An online privileged workflow sets “offline scan,” “scheduled operation,” or similar mode. Cancellation or completion fails to clear all state, so later manual WinRE entry inherits stronger behavior.
Search-order confusion
An artifact on removable or auxiliary media shadows the intended recovery-partition artifact.
Unattended setup crossover
WinRE enters or invokes a Windows PE/setup path that honors an answer file or synchronous command from writable storage.
Auto-unlock before trust validation
The OS volume is unlocked for a legitimate recovery operation before the command/config that runs in that environment is authenticated and bound to the trusted recovery image.
Completion criterion: prove the untrusted artifact's bytes and storage provenance reach the pre-auth consumer after unlock.
Phase 7: Minimize the Proof
Use the smallest harmless proof:
- create a marker on WinRE RAM drive;
- print environment and mounted-volume state;
- demonstrate read access to a non-sensitive marker on the OS volume;
- demonstrate write access only in a disposable test location;
- only then assess full boundary impact.
Record:
- exact copy paths and hashes;
- commands used to mount/unmount partitions and WIMs;
- BCD/ReAgent before/after diffs;
- key protector state;
- boot entry method and keys held, if interaction matters;
- video/serial logs with timestamps;
- restoration commands.
Completion criterion: the trigger consists only of the required state and artifacts; unrelated setup-generator content is removed.
Phase 8: Root Cause and Variants
Root-cause form:
During <recovery state>, <component> accepts <artifact/state> from <untrusted or incorrectly bound source>
after <volume unlock/privileged transition> and performs <command/read/write> without authenticating
<provenance, device binding, or current operation state>.
Variant search:
- every
ScheduledOperation and OperationParam consumer;
- all WinRE tools that unlock or mount the OS volume;
- other setup passes and answer-file search locations;
- reset, repair, restore, startup repair, update rollback, and OEM tools;
- same-named online/WinRE binary pairs;
- alternate removable filesystem types and partition placements;
- stale-state paths after interrupted operations;
- recovery image updates that leave old configs or BCD state;
- Server/Core and custom enterprise recovery images.
Cleanup and Safety of the Test Environment
Before modifying recovery state:
- export BCD and copy original
ReAgent.xml;
- record partition GUIDs and offsets;
- create full VM/disk snapshots, not only OS checkpoints;
- retain BitLocker recovery material outside the test VM;
- define commands to restore BCD, recovery registration, and partition contents;
- test recovery restoration before destructive experiments;
- never infer clean state from successful normal boot.
Completion criterion: the original recovery sequence and BitLocker state are verified after restoration.
Common Pitfalls
- Calling auto-unlock a cryptographic break. State the actual trust/provenance failure.
- Ignoring machine history. Prior offline-scan/setup state can be the trigger.
- Using a huge generated unattend file. Minimize to the exact honored setting and command.
- Assuming partition location implies trust. Record who can modify it offline and how the consumer binds to it.
- Mixing TPM-only and TPM+PIN conclusions. Report protector-specific results.
- Testing only one recovery-entry path. Shift-restart, automatic repair, BCD boot, and offline scan can differ.
- Ignoring WinRE image version. Recovery images can lag the online OS.
- Failing to restore BCD/ReAgent. Cross-reboot state can survive the PoC.
Verification Checklist
1---2name: windows-recovery-state-research3description: Use when hunting Windows pre-authentication and recovery vulnerabilities involving WinRE, WinPE, BitLocker auto-unlock, Defender Offline, ReAgent.xml, BCD, unattended setup, offline servicing, recovery or EFI partitions, removable media, and persisted state that changes trusted behavior across reboot.4license: MIT5---67> Bundled with Unleash skills pack. Source: C:\Users\Admin\.agents\skills\windows-recovery-state-research\SKILL.md89# Windows Recovery-State Vulnerability Research1011## Overview1213Hunt trust failures that appear only when Windows transitions between the online OS, reboot orchestration, WinRE/WinPE, Defender Offline, setup, and BitLocker unlock states. For acquisition-focused research, require `zero-day-target-eligibility` to pass on current stable bytes.1415The key invariant is:1617> Pre-authentication code and configuration must come from authenticated, correctly bound storage, and an unlocked OS volume must not become accessible to attacker-controlled recovery code or state.1819These bugs are usually state-machine and provenance failures, not cryptographic breaks.2021## When to Use2223Use for:2425- WinRE/WinPE command or configuration discovery;26- BitLocker volume availability before user authentication;27- Defender Offline scan scheduling and persisted recovery state;28- `ReAgent.xml`, BCD entries, recovery sequence, or scheduled operations;29- `unattend.xml`, `RunSynchronous`, Windows PE setup passes, or offline servicing;30- writable recovery/EFI/removable media consumed as trusted input;31- transaction logs, restore artifacts, or filesystem metadata interpreted during recovery;32- behavior that depends on whether a workflow was previously initiated in the full OS.3334## Phase 1: Establish the Boot Trust Model3536Record:3738- hardware/VM, UEFI/legacy mode, Secure Boot, TPM version and state;39- BitLocker conversion/protection status, encryption method, key protectors, auto-unlock state, and PIN/startup-key policy;40- OS edition/build and exact `winre.wim` build/hash;41- recovery partition type, GPT GUID, filesystem, offset, size, ACLs, and mount state;42- EFI and other auxiliary partitions;43- BCD store hash/export and recovery sequence;44- `reagentc /info` output and `ReAgent.xml` hash/content;45- Defender platform version and offline-scan state where relevant;46- physical/removable media assumptions.4748Do not claim a BitLocker bypass until the protector model is explicit. TPM-only and TPM+PIN are materially different.4950Completion criterion: another researcher can rebuild the same boot and protector state from the record.5152## Phase 2: Draw the Cross-Reboot State Machine5354Model at least:5556```text57online OS58 -> privileged feature schedules recovery/offline action59 -> state/config written to disk/BCD60 -> reboot manager selects WinRE61 -> BitLocker key release/volume unlock62 -> WinRE locates config/artifacts63 -> command/component starts64 -> operation completes or aborts65 -> state is cleared or persists66 -> return to online OS67```6869For each transition record:7071- component making the decision;72- storage location and writer permissions;73- integrity/authenticity protection, if any;74- volume and path resolution order;75- whether removable or alternate partitions are searched;76- whether OS volume unlock occurs before configuration validation;77- cleanup/persistence behavior after cancellation, failure, and successful completion.7879Completion criterion: identify each persisted state field that survives reboot and every parser/launcher that consumes it.8081## Phase 3: Inventory Pre-Auth Inputs8283Search and diff:8485- recovery partition `Recovery\WindowsRE` tree;86- `ReAgent.xml` and sibling files;87- BCD device/path objects and recovery sequence;88- Defender Offline directories and operation parameters;89- Panther/setup/unattend locations recognized by WinPE;90- startup scripts, answer files, drivers, packages, and offline-servicing manifests;91- `System Volume Information`, transaction/restore metadata, and filesystem logs;92- EFI boot applications and configuration;93- removable media roots and volume-label/GUID-based discovery.9495For every artifact record:9697| Artifact | Writer | Writable pre-auth? | Consumer | Search order | Authenticated? | Sensitive effect |98|---|---|---|---|---|---|---|99100Completion criterion: all command-bearing and path-bearing artifacts have provenance and consumer entries.101102## Phase 4: Differential State Testing103104Change one state variable at a time:105106- clean machine versus one where Defender Offline was initiated once;107- operation pending, completed, canceled, interrupted, and stale;108- warm reboot, cold boot, power loss, and recovery entered through different paths;109- internal recovery partition versus removable USB versus copied EFI/recovery contents;110- valid, missing, malformed, duplicated, and conflicting config files;111- OS/recovery image versions matched versus mismatched;112- recovery enabled/disabled, partition relocated, and custom WinRE image;113- TPM-only, TPM+PIN, recovery-password-only, and suspended protection;114- Windows 10/11 and relevant Server builds.115116After every run, recapture BCD, `ReAgent.xml`, mount/unlock events, and artifact hashes. Machine history is a test variable, not background noise.117118Completion criterion: a table identifies the minimum state transition required for the unexpected behavior.119120## Phase 5: Trace File and Component Discovery121122Static and dynamic options:123124- mount `winre.wim` read-only and inventory binaries, services, scripts, manifests, and strings;125- compare same-named binaries in normal Windows and WinRE by hash, imports, strings, and CFG;126- Procmon in a lab WinPE/WinRE environment where feasible;127- boot logging, ETW, serial/kernel debugging, and filesystem minifilter traces;128- reverse engineer code that builds search paths or parses `ReAgent.xml`, BCD, setup XML, or transaction metadata;129- inspect signature verification and device/volume binding before launch.130131When a component exists both online and in WinRE, diff behavior rather than assuming equivalence. Recovery-only code paths are high-value.132133Completion criterion: identify the exact parser/launcher and its input search order.134135## Phase 6: Test Provenance and Volume Binding136137High-yield hypotheses:138139### Trusted config from writable media140141A recovery component locates XML, logs, scripts, or metadata on a partition an attacker can modify offline, then executes or interprets it after the OS volume is unlocked.142143Test which property selects the source: disk number, partition GUID, offset, relative path, volume label, first match, or copied state.144145### Stale privileged mode146147An online privileged workflow sets “offline scan,” “scheduled operation,” or similar mode. Cancellation or completion fails to clear all state, so later manual WinRE entry inherits stronger behavior.148149### Search-order confusion150151An artifact on removable or auxiliary media shadows the intended recovery-partition artifact.152153### Unattended setup crossover154155WinRE enters or invokes a Windows PE/setup path that honors an answer file or synchronous command from writable storage.156157### Auto-unlock before trust validation158159The OS volume is unlocked for a legitimate recovery operation before the command/config that runs in that environment is authenticated and bound to the trusted recovery image.160161Completion criterion: prove the untrusted artifact's bytes and storage provenance reach the pre-auth consumer after unlock.162163## Phase 7: Minimize the Proof164165Use the smallest harmless proof:1661671. create a marker on WinRE RAM drive;1682. print environment and mounted-volume state;1693. demonstrate read access to a non-sensitive marker on the OS volume;1704. demonstrate write access only in a disposable test location;1715. only then assess full boundary impact.172173Record:174175- exact copy paths and hashes;176- commands used to mount/unmount partitions and WIMs;177- BCD/ReAgent before/after diffs;178- key protector state;179- boot entry method and keys held, if interaction matters;180- video/serial logs with timestamps;181- restoration commands.182183Completion criterion: the trigger consists only of the required state and artifacts; unrelated setup-generator content is removed.184185## Phase 8: Root Cause and Variants186187Root-cause form:188189```text190During <recovery state>, <component> accepts <artifact/state> from <untrusted or incorrectly bound source>191after <volume unlock/privileged transition> and performs <command/read/write> without authenticating192<provenance, device binding, or current operation state>.193```194195Variant search:196197- every `ScheduledOperation` and `OperationParam` consumer;198- all WinRE tools that unlock or mount the OS volume;199- other setup passes and answer-file search locations;200- reset, repair, restore, startup repair, update rollback, and OEM tools;201- same-named online/WinRE binary pairs;202- alternate removable filesystem types and partition placements;203- stale-state paths after interrupted operations;204- recovery image updates that leave old configs or BCD state;205- Server/Core and custom enterprise recovery images.206207## Cleanup and Safety of the Test Environment208209Before modifying recovery state:210211- export BCD and copy original `ReAgent.xml`;212- record partition GUIDs and offsets;213- create full VM/disk snapshots, not only OS checkpoints;214- retain BitLocker recovery material outside the test VM;215- define commands to restore BCD, recovery registration, and partition contents;216- test recovery restoration before destructive experiments;217- never infer clean state from successful normal boot.218219Completion criterion: the original recovery sequence and BitLocker state are verified after restoration.220221## Common Pitfalls2222231. **Calling auto-unlock a cryptographic break.** State the actual trust/provenance failure.2242. **Ignoring machine history.** Prior offline-scan/setup state can be the trigger.2253. **Using a huge generated unattend file.** Minimize to the exact honored setting and command.2264. **Assuming partition location implies trust.** Record who can modify it offline and how the consumer binds to it.2275. **Mixing TPM-only and TPM+PIN conclusions.** Report protector-specific results.2286. **Testing only one recovery-entry path.** Shift-restart, automatic repair, BCD boot, and offline scan can differ.2297. **Ignoring WinRE image version.** Recovery images can lag the online OS.2308. **Failing to restore BCD/ReAgent.** Cross-reboot state can survive the PoC.231232## Verification Checklist233234- [ ] UEFI/Secure Boot/TPM/BitLocker protector model recorded235- [ ] OS and WinRE versions/hashes recorded236- [ ] Recovery/EFI partition provenance and writeability documented237- [ ] Cross-reboot state machine mapped238- [ ] Pre-auth artifact search order traced239- [ ] Clean versus historically primed states compared240- [ ] Unlock occurs before/after trust validation established241- [ ] Minimal harmless proof reproduced from a full disk snapshot242- [ ] Protector, edition, build, and recovery-entry matrix tested243- [ ] BCD, ReAgent, partitions, and BitLocker state restored and verified244- [ ] Variant search covers sibling recovery operations and parsers245