feat: add deterministic ADCS ESC4 and ESC8 exploitation chains and agent wrap-up nudge#306
Merged
Merged
Conversation
**Added:** - Implement deterministic ESC4 (writeable template) exploitation chain, chaining template-modify, request, and auth steps to ensure full privilege escalation via certipy tools - Add `build_esc4_chain_args` helper for constructing certipy_esc4_full_chain arguments in the required JSON shape - Add `dispatch_esc4_deterministic` function to handle deduplication, retries, and state management for ESC4 exploitation, mirroring the lifecycle of ESC1/ESC3 - Introduce tests for `build_esc4_chain_args` to verify all required fields and template handling **Changed:** - Update main exploitation loop to route ESC4 items through the new deterministic chain, ensuring full chain execution and robust retry handling
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/more-attack-cov #306 +/- ##
========================================================
+ Coverage 75.90% 75.94% +0.04%
========================================================
Files 439 439
Lines 117164 117571 +407
========================================================
+ Hits 88930 89289 +359
- Misses 28234 28282 +48
🚀 New features to boost your workflow:
|
…rd helpers **Added:** - Added Esc4ChainInputs struct and try_extract_esc4_inputs function to validate all required ESC4 chain fields are present before dispatch - Introduced credit_esc4_exploited helper to mark ESC4 vulnerabilities as exploited in the scoreboard when the deterministic chain succeeds - Added clear_esc4_dedup_for_retry helper to clear deduplication state for retrying failed ESC4 chains - Implemented unit and async tests for ESC4 input validation, scoreboard marking, and dedup clearing **Changed:** - Refactored dispatch_esc4_deterministic to use try_extract_esc4_inputs for input validation, improving clarity and reducing duplicate code - Updated ESC4 success and retry logic to use new credit_esc4_exploited and clear_esc4_dedup_for_retry helpers, centralizing error handling and dedup management - Improved debug log messages for missing ESC4 inputs to clarify which fields are required and the retry behavior
…exploitation **Added:** - Introduced `lock_esc4_dedup_for_abandoned` to permanently lock dedup on abandoned ESC4 vulns - Added `build_esc4_tool_call` to construct the certipy_esc4_full_chain ToolCall payload - Added `build_esc4_task_id` for generating unique ESC4 chain task IDs - Implemented `handle_esc4_chain_outcome` to process ESC4 chain results and manage dedup/scoreboard logic - Added comprehensive unit tests for dedup locking, tool call construction, task ID generation, and outcome handling **Changed:** - Refactored ESC4 dedup locking in `dispatch_esc4_deterministic` to use new helper for clarity and reuse - Updated deterministic dispatch logic to use new helpers for task ID and ToolCall construction - Replaced inline outcome handling in dispatch logic with new centralized outcome handler for better testability and maintainability **Removed:** - Removed duplicated and inline logic for dedup locking, task ID construction, and ToolCall argument assembly from the deterministic dispatch function - Eliminated outcome processing logic from the dispatch closure, now handled by the shared outcome handler
**Added:** - Introduced `RelayMode` enum to distinguish between ESC8 (HTTP web enrollment) and ESC11 (RPC ICPR) relay modes, controlling target endpoint and labeling - Added optional `relay_target_url` parameter to relay-coerce argument construction and parsing, enabling arbitrary relay targets (including ESC11) - Implemented validation for `relay_target_url` to restrict to supported schemes (`http://`, `https://`, `rpc://`) and reject unsafe characters in `ares-tools` - Extended tests to cover new `relay_target_url` behaviors, including scheme validation and default fallback - Added unit tests for `RelayMode` logic and argument emission in both orchestrator and tools modules **Changed:** - Refactored orchestrator logic to route ESC8 and ESC11 through a unified `dispatch_relay_coerce_chain` function, reducing code duplication and improving clarity - Updated candidate walk, deduplication, and logging to reflect the specific relay mode and target endpoint for both ESC8 and ESC11 - Modified relay-coerce argument construction and task labeling to support the distinction between HTTP and RPC relay targets **Removed:** - Replaced the dedicated `dispatch_esc8_deterministic` and `esc8_clear_dedup` functions with generic, mode-aware versions for both relay paths
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:
adcs_exploitation.rsadministrator_upn,admin_rid500_sid, chain argument builders, relay output parsing, candidate capping, and result detectionbuild_esc4_chain_args,build_esc1_chain_args,build_relay_coerce_args)format/json.rsrunner.rs, along with tests for the injection predicateChanged:
adcs_exploitation.rs, ensuring deduplication and correct scoreboard markingmssql_exploitation.rstoken_categoryfunction visible to sibling modules for consistent text/JSON classification indisplay.rsrunner.rsRemoved:
adcs_exploitation.rs