feat: forest-aware coercion + credential pairing in auto_ntlm_relay#315
Merged
Merged
Conversation
…automation **Added:** - Implement forest-aware pairing for coercion sources and credentials, ensuring NTLM relay attempts use a DC and credential from the same forest as the relay target when possible - Add helper functions `same_forest_domain`, `host_domain_for_ip`, and `pick_credential_for_forest` to support domain matching and credential selection - Extend tests to cover forest-aware coercion, credential pairing, and new helper functions **Changed:** - Update relay work item construction to allow for optional credentials, enabling unauthenticated PetitPotam relays when no suitable credential is found - Replace the previous "first credential" approach with logic that selects a credential matching the coercion source's forest or falls back to unauthenticated relay - Modify relay payload construction to include the credential field only when present - Refactor coercion source selection to prefer domain controllers in the same forest as the relay target - Adjust logic to generate relay work even when no credentials are present, so unauthenticated relays are still attempted - Update and expand tests to reflect new forest-aware logic and removal of credential short-circuiting **Removed:** - Remove the `collect_relay_work_no_credentials` test, as relay work is now produced even without credentials
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/more-attack-cov #315 +/- ##
========================================================
+ Coverage 77.69% 77.88% +0.19%
========================================================
Files 439 439
Lines 121368 121877 +509
========================================================
+ Hits 94294 94927 +633
+ Misses 27074 26950 -124
🚀 New features to boost your workflow:
|
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:
same_forest_domain,host_domain_for_ip,find_coercion_source_for_forest, andpick_credential_for_forestto encapsulate domain/forest logic and credential selectionChanged:
credential: Nonewhen no suitable credential is found, enabling unauthenticated PetitPotam relaysRemoved:
collect_relay_work_no_credentials) that assumed no relay work is possible without credentials, replaced by tests verifying unauthenticated paths