Add exclude-hostname-length flag to dynamically adjust exclude-length #530
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.
This PR introduces the --exclude-hostname-length flag for the vhost option to Gobuster, allowing users to dynamically adjust the exclude-length value based on the length of the hostname (fuzzing word) in the response. This feature is useful for cases where webservers return the subdomain or hostname in the response, causing the response length to vary.
Key Changes:
if (found && !v.options.ExcludeLengthParsed.Contains(int(size)-wordLength))
(subtracts the hostname length from the returned size, always matching the static size entered by the user)PoC
In the following screenshot, the response size is variable because of the subdomain included in the response. The problem could be bypassed by submitting a range but it would be less precise.
By submitting the static size to --exclude-length (283 in this case) and the --exclude-hostname-length flag, Gobuster skips all the previous false positives.