fix: rewrite compound share names in generated variants - #36
Merged
Conversation
**Added:** - Compound share name handling via a new `shareAliases` map that rewrites forms like `thewallserver` that word-boundary matching cannot reach from the bare share name - `cli/internal/variant/generator.go` - `TestCompoundShareNameRewritten` covering the archived kerberoasting script's `thewallserver` case - `cli/internal/variant/generator_test.go` **Changed:** - Renamed the `thewall` share to `records` across GOAD variant-1 config, dev overlay, mapping, and delegation/kerberoasting scripts to align share naming - Updated user `patrick` credentials and description, adjusting the corresponding password mapping in `mapping.json` - Extended `mapShares` to emit compound alias forms into Misc for plain longest-first replacement so they resolve before the bare share name
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.
Key Changes:
Added:
shareAliasesmap ingenerator.goto associate a base share name with compound forms (e.g.,thewall->thewallserver) that word-boundary replacement cannot reach on its ownmapSharesto emit compound aliases into the Misc replacement list with the appropriate suffix, relying on longest-first sorting so they match before the bare share nameTestCompoundShareNameRewritteningenerator_test.goverifying that "thewallserver" in an archived kerberoasting script is properly rewritten and no "thewall" fragments surviveChanged:
thewallshare torecordsand updated its path fromC:\thewalltoC:\recordsinconfig.jsonanddev-overlay.jsonkerberoasting.ps1,constrained_delegation_use_any.ps1) to referencerecords/recordsserverinstead ofthewall/thewallserverpatrickuser's password topatrickand description toPatrickinconfig.jsonmapping.jsonwith the newhodorpassword, asharesmapping (thewall->records), and athewallserver->recordsservermisc entry