Bundled with Unleash skills pack. Source: C:\Users\Admin.agents\skills\windows-0day-hunting\SKILL.md
Windows 0-Day Hunting
Overview
Hunt composition bugs in Windows workflows rather than starting from a favorite exploit primitive. The recurring shape is:
attacker-controlled state
-> privileged component interprets it
-> identity/path/state changes between validation and use
-> privileged write, load, mount, execution, or disclosure
Prioritize first-party components that cross user-to-SYSTEM, user-to-other-user, offline-to-online, boot-to-recovery, or encrypted-to-unlocked boundaries. Use the specialist skills when the hypothesis centers on files, profiles/hives, or recovery state.
The methodology was distilled from public MSNightmare/NightmareEclipse repositories and Project Nightcrawler posts. Read references/msnightmare-method.md when provenance, examples, or confidence limits matter.
When research is governed by a latest-stable, widespread-deployment, non-public acquisition policy, run zero-day-target-eligibility before exploit engineering and again before reporting.
When to Use
Use for:
- Windows local privilege escalation and sandbox or security-boundary escape research;
- privileged services, COM/RPC servers, scheduled tasks, maintenance jobs, AV/EDR, setup, update, backup, restore, and recovery workflows;
- logic flaws involving path trust, object identity, stale authorization, state transitions, impersonation, or cross-user data;
- turning a suspicious Procmon/ETW/WinDbg observation into a controlled vulnerability hypothesis;
- variant analysis after a Windows LPE or boundary-bypass fix.
Do not use this as the primary workflow for kernel memory corruption, browser exploitation, or network-parser fuzzing. Route those to the corresponding specialist skill.
Core Research Invariant
Never begin with “how can I use a junction?” Begin with:
Which privileged action depends on state a weaker actor can influence, and what identity or authorization invariant must remain true from input acceptance through the final side effect?
The bug is the broken invariant. A junction, oplock, hive edit, boot artifact, RPC trigger, or scheduled task is only a way to demonstrate it.
Phase 1: Build the Research Boundary
Record before testing:
- exact Windows edition, architecture, build, cumulative update, component/package version, and security-product platform/signature version;
- initial token, integrity level, privileges, session, user SID, groups, and whether the actor is local, remote, interactive, service, or recovery environment;
- expected target boundary: SYSTEM, administrator, another user, protected path, encrypted volume, or trusted boot state;
- VM snapshot identifier and rollback procedure;
- one success signal and one negative-control signal.
Completion criterion: another researcher can recreate the starting state without relying on your machine history.
Phase 2: Select Workflow-Rich Targets
Rank candidates by boundary crossings and statefulness, not merely by binary size.
| Candidate |
High-value behavior |
| Security products |
quarantine, remediation, scanning, shadow copies, offline scan, exclusions |
| Profile and identity services |
logon, profile load/unload, hive mount, known-folder expansion, impersonation |
| Scheduled maintenance |
trusted task definition, SYSTEM execution, writable intermediate artifacts |
| Backup/restore/update |
snapshots, staging directories, replace/rename, rollback, package extraction |
| Setup and recovery |
pre-auth parsing, auto-unlock, unattend/config discovery, offline servicing |
| Virtual disk and storage |
mount namespaces, device paths, removable/ISO assumptions, reparse handling |
| Error reporting/diagnostics |
collection, staging, compression, trusted helper launch |
Prefer workflows with at least three of these properties:
- low-privileged trigger;
- privileged asynchronous worker;
- attacker-visible intermediate artifact;
- path reconstructed more than once;
- temporary directory or snapshot;
- impersonation transition;
- persisted state consumed after reboot/logon;
- final write/load/execute under stronger authority.
Completion criterion: maintain a ranked target list with a concrete trigger and expected privileged side effect for each item.
Phase 3: Trace One End-to-End Transaction
Use Procmon, ETW/WPR, service logs, WinDbg, API Monitor, RPC/COM tracing, and static RE as appropriate. Capture one clean transaction from low-privileged trigger to privileged sink.
For every meaningful event, record:
- timestamp and thread/process identity;
- token and impersonation state;
- path in Win32, NT, device, and Object Manager form when applicable;
- whether the component holds a handle or later reopens by name;
- requested access, share mode, create disposition, and reparse behavior;
- registry/config value supplying the path or state;
- side effect and cleanup behavior.
Mark all transitions:
validate -> queue -> impersonate/revert -> resolve -> open -> mutate -> execute/load
Completion criterion: the trace identifies both the first privileged interpretation of attacker-influenced state and the final security-sensitive operation.
Phase 4: Build the Hypothesis Ledger
One row per hypothesis:
| ID |
Weak actor controls |
Privileged consumer |
Required invariant |
Perturbation |
Sink |
Observable |
Status |
Useful invariant families:
- Object identity: the object validated is the object later used.
- Principal binding: data belonging to user A cannot select user B's object.
- Namespace binding: a path cannot resolve differently across process, session, device, or boot namespaces.
- Authorization continuity: access is checked under the correct principal at the final operation.
- State authenticity: persisted mode/config accurately represents the current authorized transition.
- Volume trust: writable pre-auth media cannot supply trusted commands or configuration.
- Lifecycle ordering: cleanup, unload, rename, and replacement cannot race the privileged consumer.
Reject rows that name only a primitive and no invariant.
Completion criterion: every active hypothesis predicts a specific event that distinguishes vulnerable from safe behavior.
Phase 5: Run Small Differential Experiments
Change one variable at a time:
- path spelling, namespace, case, trailing separators, short name, UNC/device form;
- symlink/junction/reparse presence before validation versus after validation;
- rename/delete/replace while a handle remains open;
- alternate stream versus default stream;
- same artifact under another user, session, volume, or boot phase;
- clean state versus prior workflow state;
- standard user versus filtered admin versus SYSTEM;
- desktop versus Server and stable versus Insider/Canary build;
- cold boot versus reboot, logon, profile unload, recovery entry, or task retry.
Use event-driven synchronization whenever possible. Sleeps may explore timing but cannot establish the final PoC.
Keep a negative control that preserves the expected invariant. If both test and control succeed, the signal is not diagnostic.
Completion criterion: the ledger contains repeatable evidence for or against each hypothesis, not just screenshots or a one-off success.
Phase 6: Assemble the Minimum Chain
Separate the chain into named stages:
- Seed: create or alter attacker-controlled state.
- Trigger: invoke the legitimate privileged workflow.
- Gate: pause at a deterministic observable event.
- Swap: change object, path, namespace, identity, or state.
- Sink: allow the privileged operation to continue.
- Proof: produce a harmless, unambiguous boundary-crossing result.
- Restore: revert modified system/user state.
First prove the primitive with a benign marker. Then prove impact. Do not add payload complexity before the root cause is stable.
Completion criterion: each stage has an independent log line or trace event and a defined failure reason.
Phase 7: Stabilize and Measure
For races and asynchronous workflows:
- replace polling and sleeps with oplocks, directory notifications, ETW events, debugger breakpoints, named events, or handle-state observations;
- measure gate-to-swap and swap-to-sink timing;
- run at least 30 trials per relevant build/state;
- record success, timeout, wrong-object, access-denied, cleanup failure, and crash separately;
- test under low/high CPU and I/O pressure only after the baseline is understood;
- ensure cleanup is idempotent after partial failure.
A PoC that works once is a lead. A vulnerability claim requires a reproducible transaction and a root-cause explanation.
Completion criterion: report trial counts and classified outcomes, including failed configurations.
Phase 8: Root Cause and Variant Hunt
State root cause in implementation terms:
<Component> accepts <attacker-influenced state> under <principal/phase>,
then later <re-resolves/reuses/trusts> it under <stronger authority>
without preserving <identity/authorization/state invariant>, enabling <impact>.
Then search siblings:
- callers of the same helper or RPC method;
- other consumers of the same registry/config value;
- similar scheduled tasks and service methods;
- all workflows using the same staging-root convention;
- server/client and online/offline implementations;
- adjacent setup passes, recovery modes, profile types, and volume types;
- pre-fix and post-fix binaries to identify incomplete checks.
Completion criterion: produce a variant matrix with tested status, not a list of guesses.
Required Research Output
Create these artifacts:
- environment and build matrix;
- transaction trace or event timeline;
- hypothesis ledger;
- root-cause statement;
- minimized PoC with stage logging and cleanup;
- reliability table;
- affected/unaffected version evidence;
- variant matrix;
- remediation invariant and regression-test idea.
Common Pitfalls
- Primitive-first tunnel vision. A reparse point is not a finding. Identify the violated invariant.
- Procmon-only conclusions. Procmon reveals behavior but not always token state, handle reuse, or internal checks. Corroborate with ETW, debugger, or RE.
- Name/handle confusion. Explicitly determine whether the component reopens by path or acts on the validated handle.
- Dirty-state false positives. Roll back and test clean versus historically primed machines.
- Uncontrolled races. Replace sleeps with observable gates before evaluating impact.
- Build overgeneralization. Component platform updates can matter independently of the OS cumulative update.
- PoC complexity hiding root cause. Reduce to one broken invariant and one harmless proof first.
- Missing rollback. Profile, hive, recovery, and security-product experiments can persist across reboot; document restoration before the first run.
Verification Checklist
1---2name: windows-0day-hunting3description: Use when hunting new Windows privilege-escalation or security-boundary vulnerabilities in first-party services, scheduled tasks, recovery flows, security products, profile handling, or other privileged workflows. Drives evidence-first attack-surface mapping, state-machine analysis, controlled experiments, exploit-chain construction, variant hunting, and reproducibility testing.4license: MIT5---67> Bundled with Unleash skills pack. Source: C:\Users\Admin\.agents\skills\windows-0day-hunting\SKILL.md89# Windows 0-Day Hunting1011## Overview1213Hunt composition bugs in Windows workflows rather than starting from a favorite exploit primitive. The recurring shape is:1415```text16attacker-controlled state17 -> privileged component interprets it18 -> identity/path/state changes between validation and use19 -> privileged write, load, mount, execution, or disclosure20```2122Prioritize first-party components that cross user-to-SYSTEM, user-to-other-user, offline-to-online, boot-to-recovery, or encrypted-to-unlocked boundaries. Use the specialist skills when the hypothesis centers on files, profiles/hives, or recovery state.2324The methodology was distilled from public MSNightmare/NightmareEclipse repositories and Project Nightcrawler posts. Read [references/msnightmare-method.md](references/msnightmare-method.md) when provenance, examples, or confidence limits matter.2526When research is governed by a latest-stable, widespread-deployment, non-public acquisition policy, run `zero-day-target-eligibility` before exploit engineering and again before reporting.2728## When to Use2930Use for:3132- Windows local privilege escalation and sandbox or security-boundary escape research;33- privileged services, COM/RPC servers, scheduled tasks, maintenance jobs, AV/EDR, setup, update, backup, restore, and recovery workflows;34- logic flaws involving path trust, object identity, stale authorization, state transitions, impersonation, or cross-user data;35- turning a suspicious Procmon/ETW/WinDbg observation into a controlled vulnerability hypothesis;36- variant analysis after a Windows LPE or boundary-bypass fix.3738Do not use this as the primary workflow for kernel memory corruption, browser exploitation, or network-parser fuzzing. Route those to the corresponding specialist skill.3940## Core Research Invariant4142Never begin with “how can I use a junction?” Begin with:4344> Which privileged action depends on state a weaker actor can influence, and what identity or authorization invariant must remain true from input acceptance through the final side effect?4546The bug is the broken invariant. A junction, oplock, hive edit, boot artifact, RPC trigger, or scheduled task is only a way to demonstrate it.4748## Phase 1: Build the Research Boundary4950Record before testing:5152- exact Windows edition, architecture, build, cumulative update, component/package version, and security-product platform/signature version;53- initial token, integrity level, privileges, session, user SID, groups, and whether the actor is local, remote, interactive, service, or recovery environment;54- expected target boundary: SYSTEM, administrator, another user, protected path, encrypted volume, or trusted boot state;55- VM snapshot identifier and rollback procedure;56- one success signal and one negative-control signal.5758Completion criterion: another researcher can recreate the starting state without relying on your machine history.5960## Phase 2: Select Workflow-Rich Targets6162Rank candidates by boundary crossings and statefulness, not merely by binary size.6364| Candidate | High-value behavior |65|---|---|66| Security products | quarantine, remediation, scanning, shadow copies, offline scan, exclusions |67| Profile and identity services | logon, profile load/unload, hive mount, known-folder expansion, impersonation |68| Scheduled maintenance | trusted task definition, SYSTEM execution, writable intermediate artifacts |69| Backup/restore/update | snapshots, staging directories, replace/rename, rollback, package extraction |70| Setup and recovery | pre-auth parsing, auto-unlock, unattend/config discovery, offline servicing |71| Virtual disk and storage | mount namespaces, device paths, removable/ISO assumptions, reparse handling |72| Error reporting/diagnostics | collection, staging, compression, trusted helper launch |7374Prefer workflows with at least three of these properties:75761. low-privileged trigger;772. privileged asynchronous worker;783. attacker-visible intermediate artifact;794. path reconstructed more than once;805. temporary directory or snapshot;816. impersonation transition;827. persisted state consumed after reboot/logon;838. final write/load/execute under stronger authority.8485Completion criterion: maintain a ranked target list with a concrete trigger and expected privileged side effect for each item.8687## Phase 3: Trace One End-to-End Transaction8889Use Procmon, ETW/WPR, service logs, WinDbg, API Monitor, RPC/COM tracing, and static RE as appropriate. Capture one clean transaction from low-privileged trigger to privileged sink.9091For every meaningful event, record:9293- timestamp and thread/process identity;94- token and impersonation state;95- path in Win32, NT, device, and Object Manager form when applicable;96- whether the component holds a handle or later reopens by name;97- requested access, share mode, create disposition, and reparse behavior;98- registry/config value supplying the path or state;99- side effect and cleanup behavior.100101Mark all transitions:102103```text104validate -> queue -> impersonate/revert -> resolve -> open -> mutate -> execute/load105```106107Completion criterion: the trace identifies both the first privileged interpretation of attacker-influenced state and the final security-sensitive operation.108109## Phase 4: Build the Hypothesis Ledger110111One row per hypothesis:112113| ID | Weak actor controls | Privileged consumer | Required invariant | Perturbation | Sink | Observable | Status |114|---|---|---|---|---|---|---|---|115116Useful invariant families:117118- **Object identity:** the object validated is the object later used.119- **Principal binding:** data belonging to user A cannot select user B's object.120- **Namespace binding:** a path cannot resolve differently across process, session, device, or boot namespaces.121- **Authorization continuity:** access is checked under the correct principal at the final operation.122- **State authenticity:** persisted mode/config accurately represents the current authorized transition.123- **Volume trust:** writable pre-auth media cannot supply trusted commands or configuration.124- **Lifecycle ordering:** cleanup, unload, rename, and replacement cannot race the privileged consumer.125126Reject rows that name only a primitive and no invariant.127128Completion criterion: every active hypothesis predicts a specific event that distinguishes vulnerable from safe behavior.129130## Phase 5: Run Small Differential Experiments131132Change one variable at a time:133134- path spelling, namespace, case, trailing separators, short name, UNC/device form;135- symlink/junction/reparse presence before validation versus after validation;136- rename/delete/replace while a handle remains open;137- alternate stream versus default stream;138- same artifact under another user, session, volume, or boot phase;139- clean state versus prior workflow state;140- standard user versus filtered admin versus SYSTEM;141- desktop versus Server and stable versus Insider/Canary build;142- cold boot versus reboot, logon, profile unload, recovery entry, or task retry.143144Use event-driven synchronization whenever possible. Sleeps may explore timing but cannot establish the final PoC.145146Keep a negative control that preserves the expected invariant. If both test and control succeed, the signal is not diagnostic.147148Completion criterion: the ledger contains repeatable evidence for or against each hypothesis, not just screenshots or a one-off success.149150## Phase 6: Assemble the Minimum Chain151152Separate the chain into named stages:1531541. **Seed:** create or alter attacker-controlled state.1552. **Trigger:** invoke the legitimate privileged workflow.1563. **Gate:** pause at a deterministic observable event.1574. **Swap:** change object, path, namespace, identity, or state.1585. **Sink:** allow the privileged operation to continue.1596. **Proof:** produce a harmless, unambiguous boundary-crossing result.1607. **Restore:** revert modified system/user state.161162First prove the primitive with a benign marker. Then prove impact. Do not add payload complexity before the root cause is stable.163164Completion criterion: each stage has an independent log line or trace event and a defined failure reason.165166## Phase 7: Stabilize and Measure167168For races and asynchronous workflows:169170- replace polling and sleeps with oplocks, directory notifications, ETW events, debugger breakpoints, named events, or handle-state observations;171- measure gate-to-swap and swap-to-sink timing;172- run at least 30 trials per relevant build/state;173- record success, timeout, wrong-object, access-denied, cleanup failure, and crash separately;174- test under low/high CPU and I/O pressure only after the baseline is understood;175- ensure cleanup is idempotent after partial failure.176177A PoC that works once is a lead. A vulnerability claim requires a reproducible transaction and a root-cause explanation.178179Completion criterion: report trial counts and classified outcomes, including failed configurations.180181## Phase 8: Root Cause and Variant Hunt182183State root cause in implementation terms:184185```text186<Component> accepts <attacker-influenced state> under <principal/phase>,187then later <re-resolves/reuses/trusts> it under <stronger authority>188without preserving <identity/authorization/state invariant>, enabling <impact>.189```190191Then search siblings:192193- callers of the same helper or RPC method;194- other consumers of the same registry/config value;195- similar scheduled tasks and service methods;196- all workflows using the same staging-root convention;197- server/client and online/offline implementations;198- adjacent setup passes, recovery modes, profile types, and volume types;199- pre-fix and post-fix binaries to identify incomplete checks.200201Completion criterion: produce a variant matrix with tested status, not a list of guesses.202203## Required Research Output204205Create these artifacts:2062071. environment and build matrix;2082. transaction trace or event timeline;2093. hypothesis ledger;2104. root-cause statement;2115. minimized PoC with stage logging and cleanup;2126. reliability table;2137. affected/unaffected version evidence;2148. variant matrix;2159. remediation invariant and regression-test idea.216217## Common Pitfalls2182191. **Primitive-first tunnel vision.** A reparse point is not a finding. Identify the violated invariant.2202. **Procmon-only conclusions.** Procmon reveals behavior but not always token state, handle reuse, or internal checks. Corroborate with ETW, debugger, or RE.2213. **Name/handle confusion.** Explicitly determine whether the component reopens by path or acts on the validated handle.2224. **Dirty-state false positives.** Roll back and test clean versus historically primed machines.2235. **Uncontrolled races.** Replace sleeps with observable gates before evaluating impact.2246. **Build overgeneralization.** Component platform updates can matter independently of the OS cumulative update.2257. **PoC complexity hiding root cause.** Reduce to one broken invariant and one harmless proof first.2268. **Missing rollback.** Profile, hive, recovery, and security-product experiments can persist across reboot; document restoration before the first run.227228## Verification Checklist229230- [ ] Exact build, component version, token, session, and starting state recorded231- [ ] Privileged transaction traced end to end232- [ ] Broken invariant identified independently of the exploit primitive233- [ ] Negative control behaves differently from the vulnerable case234- [ ] Synchronization is event-driven or its limitation is quantified235- [ ] PoC stages and cleanup are independently observable236- [ ] Reliability measured across repeated trials237- [ ] Clean-snapshot reproduction completed238- [ ] Affected/unaffected matrix includes meaningful state and edition differences239- [ ] Variant hunt follows the root-cause pattern240- [ ] Fix recommendation preserves identity/authorization through the final side effect241