feat: add --stop-on-rate-limit and --retry-on-rate-limit flags for dir mode#641
Open
feat: add --stop-on-rate-limit and --retry-on-rate-limit flags for dir mode#641
Conversation
…r mode When targets return HTTP 429 (Too Many Requests), gobuster now supports two new mutually exclusive flags for the dir mode: - --stop-on-rate-limit: gracefully stops the scan when a 429 is received - --retry-on-rate-limit: waits for the Retry-After header duration (or 5 seconds by default) then retries the same request These flags are particularly useful in bug bounty and penetration testing scenarios where rate limiting is expected behavior from the target. Addresses OJ#363
8ab9a92 to
2ce5e00
Compare
Author
|
Rebased on upstream |
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.
Summary
Adds two new flags to the
dirmode to handle HTTP 429 (Too Many Requests) responses gracefully. Addresses #363.Flags
--stop-on-rate-limitWhen a 429 response is received, the scan stops gracefully with a clear error message.
--retry-on-rate-limitWhen a 429 response is received, gobuster waits for the duration specified in the
Retry-Afterheader (or 5 seconds by default) and retries the same request.The two flags are mutually exclusive — setting both will produce an error.
Use Case
In bug bounty and penetration testing scenarios, targets commonly enforce rate limiting. Currently, gobuster keeps hammering the target with requests even after receiving 429 responses, which:
With
--retry-on-rate-limit, testers can slow down automatically and respect the target rate limits while still completing the scan. With--stop-on-rate-limit, testers can abort early and adjust their approach (e.g., reduce threads, add delay).Implementation Details
Retry-Afterheader as both seconds (integer) and HTTP-date formatscontext.CancelFunconProgressto allow plugins to signal graceful stop