Allow dnsbrute to accept a list of wordlists#3094
Conversation
The wordlist option now accepts either a single URL/path (existing behavior) or a list, enabling users to supplement the default wordlist with custom entries without replacing it. Multiple files are fetched and merged into a single deduplicated set before brute-forcing begins.
🚀 Performance Benchmark Report
|
|
@SpamFaux good feature, I like it. My main feedback is just that if we're going to have it , it shouldn't be confined to one module, since we have other modules that define wordlists in configs. The functionality should be generalized as a helper, probably an extension of the wordlist() helper, so things like webbrute, legba, etc can all utilize it. |
Per review feedback, generalize the feature at the helper level so all modules that accept wordlist configs (legba, ffuf, paramminer, etc.) get multi-wordlist support automatically rather than implementing it per-module. dnsbrute reverts to a single helpers.wordlist() call.
|
Good notes. I made the recommended changes. Moved it up to be more general. Let me know if you have other feedback. |
|
Some feedback: Functionally, I think this will work, but there is some redundancy here: new merge branch (lines 550-560)existing single-path branch (lines 588-599)These are nearly identical with the only difference being trunc_key vs cache_key. We should be able to merge these and remove the redundant code and clean it up a lot. The other problem is that you are putting these into a set(). Set() is non-deterministic, which means the order will essentially be random each time. That breaks the "lines=n" option, in terms of producing a deterministic predictable truncation of lines. The fix is to use dict.fromkeys(), deduplicates while preserving insertion order. and, apparently you need to lint again |
- Replace set() with dict.fromkeys() to preserve insertion order when merging wordlists, ensuring lines=n truncation is deterministic - Unify lines truncation into a single block shared by both the list and single-path branches instead of duplicating it
|
@SpamFaux I added options documentation for other modules which can now take advantage as well. Looks good to me though. |
|
@ausmaster, you need to approve since we both edited |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #3094 +/- ##
=====================================
- Coverage 90% 90% -0%
=====================================
Files 445 445
Lines 38792 38823 +31
=====================================
+ Hits 34715 34736 +21
- Misses 4077 4087 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
wordlistoption ondnsbrutenow accepts either a single URL/path (existing behavior) or a list of URLs/pathsMotivation
Users with custom subdomain wordlists previously had to choose between the default SecLists wordlist and their own. There was no way to supplement the default without replacing it entirely. With this change, a preset can specify both:
Test plan
TestDnsbruteandTestDnsbruteCanaryChecktests pass (no regression)TestDnsbruteMultiWordlisttest verifies merged wordlist size, correct deduplication of overlapping entries, and end-to-end discovery of a subdomain sourced from the second wordlist