Skip to content

WinPrep v0.2.0-alpha.2

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 24 Nov 07:45

WinPrep 0.2.0-alpha.2 fixes Audit Mode detection, which did not work on any
real Windows installation. The previous build queried a registry value name
that real Windows never writes and required a setup command line that real
systems never carry, so every machine - including genuine Audit Mode
machines - was rejected as "setup state unknown", blocking both operations.

What was wrong

Two independent defects, either of which alone broke detection:

  1. The detector read StateName from
    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\State. That name
    appears in the prose of Microsoft's "Windows Setup States" documentation,
    but the page's own examples - and every real installation, deployment
    script, and field report - use ImageState. No StateName value has
    ever been observed on a real machine, so the read always came back
    empty.
  2. The detector required HKLM\SYSTEM\Setup\CmdLine to equal audit.exe.
    On real systems that value holds whatever the setup engine queued before
    logon - oobe\windeploy.exe, SetupComplete.cmd, or nothing - so the
    required combination could never occur.

How detection works now

WinPrep reads the setup state from ImageState (with State.ini and the
documented StateName name as fallbacks), the audit boot flag under
HKLM\SYSTEM\Setup\Status (AuditBoot and its Windows 11-observed
AuditBootVolatile sibling), the OOBE indicator, and the session user's
SID. Audit Mode is confirmed only when the signals agree; anything missing
or contradictory stays "uncertain", and uncertain machines get no
state-changing operations. CmdLine is reported as an observation only.

The new winprep signals command prints every raw value the detector read,
where it came from, and how the state was evaluated - the evidence to attach
if a genuine Audit Mode session is ever rejected. See
docs/troubleshooting.md for the full procedure.

Also fixed in this release

  • The handover fails closed when the process list cannot be read, and the
    full preflight re-runs after confirmation, so a blocker that appears in
    the meantime (a new account, a pending restart) stops the handover before
    anything is deleted.
  • The cleanup refuses to traverse an approved directory that became a
    symlink or junction after planning, closing a redirection attack window.
  • A failed cleanup can be retried in the same window; the operation lock is
    released unless the reseal was initiated.
  • The TUI confirmation screen shows the cleanup plan it is asking about,
    and several smaller TUI defects (stale notices, cancelled status check,
    Ctrl+C falling into the fallback menu) are fixed.
  • Running WinPrep no longer creates %ProgramData%\WinPrep on inspection
    alone, so dry runs are strictly read-only.

Verification status

  • Unit tests (fakes) and cross-platform checks pass on Linux; Windows
    integration tests run in CI on a normally deployed Windows runner, which
    must be classified as a deployed installation. The integration suite now
    asserts that ImageState is actually read - the regression guard for
    defect 1.
  • A regression test reproducing the real-world Audit Mode machine (the
    registry shape observed in field reports: ImageState set, AuditBoot
    set, no StateName, no audit.exe command line, built-in Administrator
    session) fails against the previous implementation and passes now.
  • What has NOT been verified: a live Windows Audit Mode session. This
    release was developed without access to a real Audit Mode machine, so the
    signal set is grounded in Microsoft's documentation, production deployment
    tooling, and field reports (Windows 7-10 audit machines). In particular
    the audit boot flag is not officially documented by Microsoft. A machine
    that is genuinely in Audit Mode but lacks the expected signals is
    reported as uncertain with its reasons - never guessed - and
    winprep signals produces exactly the evidence needed to extend the
    rules.
  • The full Windows lifecycle (real handover and verified OOBE boot) remains
    unexecuted, which is why this is still a prerelease.

Upgrading

Replace winprep.exe. No configuration, manifest format, or command changes
affect existing usage; winprep signals is new.