elceef / dnstwist

Domain name permutation engine for detecting homograph phishing attacks, typo squatting, and brand impersonation
https://dnstwist.it
Apache License 2.0
4.73k stars 753 forks source link

Revises --fuzzers argument docs #198

Open bwolfe-corvus opened 11 months ago

bwolfe-corvus commented 11 months ago

Resubmitting with a simpler change. You were right in that I did not originally notice that the various and tld-swap fuzzers weren't tied to class methods. Since I'm only looking to do a change that affects ease of usage, I just tried to match up the --fuzzers argument with how the default fuzzers are used within the generate() function as a preset list.

Original output sample:

$ python dnstwist.py --fuzzers --format list contoso.com
usage: dnstwist.py [OPTION]... DOMAIN
dnstwist.py: error: argument --fuzzers: expected one argument

New output:

$ python dnstwist.py --fuzzers --format list contoso.com
usage: dnstwist.py [OPTION]... DOMAIN
dnstwist.py: error: argument --fuzzers requires a comma-separated list of fuzzers.
Available fuzzers: addition, bitsquatting, cyrillic, homoglyph, hyphenation, insertion, omission, repetition, replacement, subdomain, transposition, vowel-swap, dictionary, tld-swap, various

I intentionally did not wrap the docstring error output to a specific width, as I didn't see that as a behavior in other parts of the code. However, I found that Python's stdlib has a textwrap module going back to 2.7, so if that's something of interest, I will wrap this output appropriately.

Forgive the double PR, I blew up my forked repo and had to resubmit a PR from a clean state.