fix(windows): harden the ABE payload injection lifecycle - #638
Open
slimwang wants to merge 2 commits into
Open
Conversation
The browser main thread is never resumed, so no window appears and the temp user-data-dir is unnecessary. Payload memory is RW then RX, with an explicit FlushInstructionCache before the remote thread executes it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the Windows ABE injection lifecycle deterministic and tighten the memory
permissions used for the raw payload.
The spawned browser's primary thread now remains suspended for the entire
operation. Only the remote Bootstrap thread runs, so the injector no longer
needs a temporary
--user-data-dir, a normal browser window, or a fixed 500 msstartup delay.
What changed
VirtualProtectEx, and callFlushInstructionCachebefore execution.BootstrapParamsblock instead of patching the payload's DOS stub.The explicit cache flush follows the Windows API contract documented for
VirtualProtectExand
FlushInstructionCache.Validation
go test ./...with Go 1.26.2 on macOS arm64go test ./...with Go 1.20.14 on macOS arm64go vet ./...make gen-layout-verifymake payload-verify(75,776-byte payload;Bootstrapexport present)make build-windowswithabe_embedusing Go 1.26.2 and Go 1.20.14Windows test binaries and browser integration were not executed during this
macOS review.
Runtime validation supplied with the patch
The patch handoff reports Windows 10 execution against Chrome, Edge, CocCoc,
and Brave, including successful ABE extraction and no residual browser
processes. These results were not rerun as part of the validation above.
Checklist
mainbranchgo.modremains at Go 1.20