Skip to content

feat: enforce lockout-safe password spraying and expand multi-domain credential access#238

Merged
l50 merged 6 commits into
mainfrom
fix/problems-md
Apr 27, 2026
Merged

feat: enforce lockout-safe password spraying and expand multi-domain credential access#238
l50 merged 6 commits into
mainfrom
fix/problems-md

Conversation

@l50
Copy link
Copy Markdown
Contributor

@l50 l50 commented Apr 27, 2026

Key Changes:

  • Enforced lockout policy safety for password spraying, requiring explicit lockout threshold or override
  • Updated LLM and agent instructions/templates to prioritize safe, multi-domain credential access (including user description field search)
  • Enhanced Redis task queue to allow dedicated connections for blocking commands, preventing agent serialization
  • Fixed extraction of AD domain from hostnames to avoid incorrect domain assignment for short hostnames

Added:

  • Lockout threshold enforcement and safety buffer for password_spray tool in ares-tools
  • New parameters to password_spray: lockout_threshold, attempts_used_per_account, and acknowledge_no_policy
  • Test cases for lockout policy enforcement, refusal conditions, and override behavior in password_spray
  • dedicated_connection method to TaskQueue for opening dedicated Redis connections for blocking operations

Changed:

  • password_spray tool now refuses to run unless lockout threshold is provided or override is explicitly set, preventing accidental account lockouts
  • Default password spray list updated to more common values and clarified in LLM prompt and templates
  • LLM agent and orchestrator instructions/templates updated to:
    • Require password_policy call before spraying and enforce passing thresholds
    • Emphasize multi-domain coverage for credential access, AS-REP roasting, kerberoasting, and user description field searches
    • Instruct agents to increment attempts_used_per_account between sprays
    • Highlight criticality of searching user description fields for passwords
  • Improved Redis tool dispatcher to use dedicated connections for blocking BRPOP calls, resolving agent serialization bug
  • Domain extraction from hostnames in state publishing now requires at least three dot-separated parts, preventing incorrect domain assignment for two-part hostnames
  • Recovery flow now collects interrupted tasks for re-dispatch through the normal submission flow, rather than pushing to unused queues; logging and struct field names updated accordingly

Removed:

  • Deprecated direct use of requeue_task during task recovery in favor of re-dispatch through LLM submission

l50 added 2 commits April 27, 2026 12:22
…red team guidance

**Added:**

- Collect interrupted tasks for re-dispatch via the normal LLM submission flow during orchestrator recovery instead of pushing to dead Redis queues
- Store the Redis URL in TaskQueueCore to allow creation of dedicated connections for blocking commands (BRPOP), and add a method to open a dedicated connection for each BRPOP call
- Define a RecoveryTask struct to track tasks needing re-dispatch after recovery

**Changed:**

- Orchestrator now re-dispatches recovered tasks using dispatcher.do_submit, with improved logging for successful, deferred, and failed re-dispatches
- Recovery manager collects tasks to be re-dispatched through LLM submission and prepares payloads accordingly, updating recovery logs and results
- RedisToolDispatcher uses a dedicated Redis connection for BRPOP per tool result wait, preventing agent loop serialization and falling back to the shared connection on error
- Host domain extraction logic now requires at least three dot-separated hostname parts to avoid extracting meaningless domains from two-part hostnames (fixes domain detection bug)
- Password spraying guidance in credential_access/no_cred.rs and red team templates expanded to emphasize deriving 3-5 contextual passwords from environment themes (domain, hostname, usernames) and using seasonal/year patterns
- Red team agent and orchestrator templates updated to prioritize ldap_search_descriptions (description field password discovery), multi-domain coverage for asrep_roast/kerberoast/ldap_search_descriptions, and detailed instructions for credential expansion and ACL abuse chains
- Recon agent template emphasizes checking user description fields for passwords on all domains

**Removed:**

- Direct requeue_task calls during recovery in favor of the new re-dispatch approach, with requeue_task retained but unused for potential future use
…ial guidance

**Added:**

- Implement lockout-aware precondition checks in password_spray; requires lockout_threshold from password_policy or explicit override with acknowledge_no_policy in ares-tools/src/credential_access/misc.rs
- Add safety buffer to stay one attempt below lockout threshold and refuse to spray when budget is exhausted
- Provide detailed refusal messages for unsafe spray attempts
- Unit and async tests for password_spray lockout logic, refusal conditions, and overrides in misc.rs

**Changed:**

- Update password_spray tool description and schema in netexec_tools.rs to clarify lockout policy requirements and new arguments
- Revise redteam LLM prompts and instructions to require password_policy before spraying, detail lockout_threshold/attempts_used_per_account handling, and remove context password derivation steps
- Adjust documentation and comments throughout code and templates to reflect new lockout enforcement and example values (e.g., update sample domains, clarify host/domain examples)
- Default spray jitter to 1s if not specified, ensuring safer spreading of authentication attempts

**Removed:**

- Remove LLM prompt/task instructions about deriving contextual/thematic passwords for spraying, focusing guidance on standard and seasonal patterns with strict lockout handling
- Omit outdated comments and example user references in automation logic for improved clarity
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

❌ Patch coverage is 77.47036% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.94%. Comparing base (30415fd) to head (97dc43d).

Files with missing lines Patch % Lines
ares-cli/src/orchestrator/task_queue.rs 19.04% 17 Missing ⚠️
...c/orchestrator/tool_dispatcher/redis_dispatcher.rs 0.00% 16 Missing ⚠️
ares-cli/src/orchestrator/recovery/manager.rs 0.00% 15 Missing ⚠️
ares-cli/src/orchestrator/mod.rs 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #238      +/-   ##
==========================================
+ Coverage   74.89%   74.94%   +0.04%     
==========================================
  Files         383      382       -1     
  Lines       80225    80418     +193     
==========================================
+ Hits        60086    60267     +181     
- Misses      20139    20151      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

l50 added 4 commits April 27, 2026 12:43
**Changed:**

- Reformatted long lines to improve readability and maintain consistent style in the password_spray function and related test in misc.rs
… cases

**Added:**

- Added test to ensure RecoveryTask carries correct payload and fields for redispatch in `types.rs`
- Added tests for domain controller registration edge cases:
  - Two-part hostnames use fallback domain instead of registering TLD
  - Two-part hostnames with no fallback domain skip registration entirely
  - Three-part hostnames extract the correct full domain in registration
**Changed:**

- Removed outdated comments referencing prior requeue behavior in recovery manager and orchestrator modules to improve clarity
- Clarified comments in domain extraction logic and Redis BRPOP connection handling for accuracy and brevity

**Removed:**

- Deleted the unused `requeue.rs` module and its reference in recovery/mod.rs as the requeue approach is no longer used
- Removed inline comments describing the old requeue flow from related modules and tests
@l50 l50 merged commit 7899d61 into main Apr 27, 2026
11 checks passed
@l50 l50 deleted the fix/problems-md branch April 27, 2026 19:22
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.

1 participant