mirror of
https://github.com/s-b-repo/rustsploit
synced 2026-06-27 09:54:12 +00:00
bruteforce: expose connection retries (medusa -r) via setg bruteforce_retries
creds_helper previously hardcoded BruteforceConfig.max_retries = 1. 'setg bruteforce_retries N' now sets the per-combo retry count for retryable (transient/connection) errors; unset or 0 keeps the historical default of 1. show options: + bruteforce_retries. Build: 0 errors, 0 warnings.
This commit is contained in:
@@ -1318,6 +1318,7 @@ async fn display_all_options(ctx: &ShellContext) {
|
||||
("bruteforce_jitter_ms","Random extra delay added to bruteforce_delay_ms (ms)", ""),
|
||||
("bruteforce_mask", "Mask brute (hydra -x) MIN:MAX:CHARSET, e.g. 1:4:a1", ""),
|
||||
("bruteforce_resume", "Resume large streamed wordlist from last batch (y/n)", ""),
|
||||
("bruteforce_retries", "Retries on transient/connection error per combo (medusa -r, default 1)", ""),
|
||||
];
|
||||
|
||||
let mut displayed = std::collections::HashSet::new();
|
||||
|
||||
@@ -259,6 +259,12 @@ where
|
||||
let delay_ms = opt_u64("bruteforce_delay_ms");
|
||||
let jitter_ms = opt_u64("bruteforce_jitter_ms");
|
||||
|
||||
// medusa `-r`-style connection retries: `setg bruteforce_retries N` re-tries a
|
||||
// retryable (transient/connection) error up to N times before giving up on a
|
||||
// combo. Defaults to 1 when unset or zero (the historical behaviour).
|
||||
let retries = opt_u64("bruteforce_retries");
|
||||
let max_retries = if retries == 0 { 1 } else { retries as usize };
|
||||
|
||||
let bf_config = BruteforceConfig {
|
||||
target: host.clone(),
|
||||
port,
|
||||
@@ -267,7 +273,7 @@ where
|
||||
verbose: false,
|
||||
delay_ms,
|
||||
jitter_ms,
|
||||
max_retries: 1,
|
||||
max_retries,
|
||||
service_name: cfg.service_name,
|
||||
source_module: cfg.source_module,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user