Skip to content

Fix bypass.ps1 crash, strip dead answer-file payload, refresh docs for 2026 - #23

Closed
Stensel8 wants to merge 4 commits into
mainfrom
claude/repo-audit-modernization-7byt68
Closed

Fix bypass.ps1 crash, strip dead answer-file payload, refresh docs for 2026#23
Stensel8 wants to merge 4 commits into
mainfrom
claude/repo-audit-modernization-7byt68

Conversation

@Stensel8

@Stensel8 Stensel8 commented Aug 29, 2026

Copy link
Copy Markdown
Member

Audit of the repo: does the bypass still work, is the documented information still accurate, and are there better routes now?

The bypass still works, but the answer file was doing far less than it appeared to, and the script had a guaranteed crash on its failure path.

Bugs

Write-Error ... -ForegroundColor Red cannot bind — Write-Error has no -ForegroundColor parameter, so the final error handler threw a ParameterBindingException instead of reporting the problem. Reproduced on PowerShell 7.5.4. There were also two duplicate comment-based help blocks from an earlier merge.

The answer file was mostly dead code

Sysprep /oobe without /generalize does not re-run the specialize pass, so everything in it never executed: ~40 app removals, 16 capability removals, 4 optional-feature removals and the ExtractScript machinery. Because ExtractScript never ran, FirstLogon.ps1 was never written either, so the FirstLogonCommands entry pointing at it failed every time — leaving AutoLogonCount unreset and the answer file undeleted.

512 to 100 lines. What remains is the oobeSystem pass, which is what actually performs the bypass, with self-contained FirstLogonCommands. Removed rather than repaired: someone running a tool called "bypassnro" to get a local account should not silently lose Notepad and Paint.

Script

bypass.ps1 now has a confirmation prompt (-Force to skip), -WhatIf via ShouldProcess, $ProgressPreference off for speed, download to a temp file with XML validation before anything lands in C:\Windows\Panther, a backup of any existing answer file, and a pointer to setuperr.log when Sysprep refuses to run.

Documentation

README said December 2025. Updated, and one claim corrected: ms-cxh:localonly is confirmed blocked on Insider builds (Dev 26220.6772 / Beta 26120.6772), but whether that reached retail 25H2 (26200.x) is not something I could verify, so the README now says so instead of asserting it.

Added the faster route — put the file on the USB as autounattend.xml and Setup consumes it directly, no Sysprep and no second OOBE pass. Also documented that both accounts are created without a password and Admin signs in automatically, which was previously unstated.

Repo hygiene

Added the missing LICENSE (MIT, matching WinDeploy), SECURITY.md, .gitignore and a PSScriptAnalyzerSettings.psd1 wired into the workflow.

Testing

PowerShell 7.5.4 and PSScriptAnalyzer 1.24: parses clean, 0 findings, comment-based help parses, unattend.xml well-formed with CRLF preserved.

Not tested against a real Sysprep run — the specialize-pass finding is based on Microsoft's documented behaviour, so worth a spot-check on a VM before merging.


🤖 Generated with Claude Code

https://claude.ai/code/session_01Pt5Q3XvjMT6HMdubvkyLMW


Generated by Claude Code

…r 2026

bypass.ps1 had a guaranteed crash on its failure path: Write-Error does
not take -ForegroundColor, so the final error handler threw a
ParameterBindingException instead of reporting the problem. The file also
carried two duplicate comment-based help blocks from an earlier merge.

Rewrote it with the things a script that reboots your machine should
have: a confirmation prompt (with -Force to skip), -WhatIf support via
ShouldProcess, TLS 1.2 for images that still default to TLS 1.0, download
to a temp file with XML validation before anything lands in
C:\Windows\Panther, a backup of any existing answer file, and a pointer
to setuperr.log when Sysprep refuses to run.

unattend.xml went from 512 to 100 lines. Sysprep /oobe without
/generalize does not re-run the specialize pass, so the ~40 app removals,
16 capability removals and all the script-extraction machinery parked
there never executed - while making the file look like it debloated the
machine. Removed rather than left in place looking functional. The
oobeSystem pass, which is what actually performs the bypass, is kept and
now also carries HideOnlineAccountScreens/HideLocalAccountScreen, plus
self-contained FirstLogonCommands that no longer depend on files the
specialize pass was supposed to have written.

README rechecked against the current state (August 2026): ms-cxh:localonly
is now blocked in stable, not just Insider, so the previous "only works on
the current 25H2 stable branch" note was out of date. Added the working
alternatives (Rufus, domain join on Pro, the BypassNRO registry value and
its caveat) and documented putting the file on the USB as autounattend.xml,
which avoids Sysprep and the second OOBE pass entirely.

Also documented what was previously unstated: both accounts are created
without a password and Admin autologs in once.

Added the missing LICENSE, SECURITY.md, .gitignore and a
PSScriptAnalyzer settings file, and wired the settings into CI.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pt5Q3XvjMT6HMdubvkyLMW
Copilot AI lite review requested due to automatic review settings August 29, 2026 22:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread bypass.ps1 Fixed
Comment thread bypass.ps1 Fixed
Comment thread bypass.ps1 Fixed
Comment thread bypass.ps1 Fixed
Claude and others added 3 commits August 29, 2026 22:53
DevSkim flags this as an error on the PR (DS440000 and DS440020, both
"Do not hardcode SSL/TLS versions within an application", severity
important). Verified against the rule definitions: DS440020 applies to
PowerShell and matches SecurityProtocolType, DS440000 matches the Tls12
literal.

The scanner is right. Windows 11 is the only supported target here, and
it already negotiates TLS 1.2/1.3 through SystemDefault. Pinning a
version only stops the OS from handing us a better protocol later. The
TLS 1.0 default this was guarding against belongs to Windows 7/8.1-era
images, which this script does not support.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pt5Q3XvjMT6HMdubvkyLMW
…m DS104456

Two unrelated corrections.

I overstated the ms-cxh:localonly row. I wrote that the block had "since
rolled into stable", but I never verified that. Every primary source was
unreachable from this environment (the egress proxy blocks learn.microsoft.com,
the tech press and the forums), so the claim rested on search-result
summaries saying "not supported anymore on the latest Windows 11 builds" -
which is vague, and the build numbers actually cited are Insider ones
(Dev 26220.6772, Beta 26120.6772). The retail 25H2 branch is 26200.x, and
whether the block reached it is exactly the part I could not confirm. The
previous README said it still worked on stable, so this was a change to a
factual claim on thin evidence.

The row now says "Blocked on Insider; retail unconfirmed" and states plainly
that it has not been re-tested. Added a short note on how current the table
is, so readers can see which rows are verified and which are compiled from
public reporting.

Separately: DevSkim reported two errors on this PR, DS104456 "Use of
restricted functions". Fetched the check-run annotations to get the exact
lines rather than guessing - both were the bare token `iex` in the
comment-based help, which DevSkim matches because it does not treat a
<# #> block as a comment. Reworded both .EXAMPLE entries to the script-block
form, which is what supports parameters anyway; the one-liner stays
documented in the README, which was not flagged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pt5Q3XvjMT6HMdubvkyLMW
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pt5Q3XvjMT6HMdubvkyLMW
Stensel8 added a commit that referenced this pull request Sep 2, 2026
- Update bypass.ps1 with fixes from PR #23
- Update unattend.xml (cleaned up)
- Update README.md with cleaned up version from PR #23
- Add SECURITY.md and LICENSE from PR #23
- Update .gitignore with Windows-specific entries
- Add PSScriptAnalyzer workflow from PR #23
- Update checksums for new bypass.ps1
- Update all links to use bypassnro.thectic.nl domain

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@Stensel8 Stensel8 closed this Sep 2, 2026
@Stensel8
Stensel8 deleted the claude/repo-audit-modernization-7byt68 branch September 2, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants