From b2ce0c19ac39cce2457d317653a314022b25235a Mon Sep 17 00:00:00 2001 From: Brandon Wolfe Date: Mon, 24 Jul 2023 15:17:01 -0400 Subject: [PATCH] Revises --fuzzers argument docs - If used with no arguments, prints available fuzzers - default fuzzer list matches with generate() function's possible defaults --- .gitignore | 2 ++ dnstwist.py | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b5743da9..2ffa34fb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ venv/ .idea *.pyc *.swp +# VSCode project directory +.vscode \ No newline at end of file diff --git a/dnstwist.py b/dnstwist.py index 3275ecd2..25014db2 100755 --- a/dnstwist.py +++ b/dnstwist.py @@ -1081,13 +1081,15 @@ def run(**kwargs): '''typosquatting, fraud and brand impersonation.''', formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=30) ) - + _default_fuzzers = ['addition', 'bitsquatting', 'cyrillic', 'homoglyph', 'hyphenation', + 'insertion', 'omission', 'repetition', 'replacement', 'subdomain', + 'transposition', 'vowel-swap', 'dictionary', 'tld-swap', 'various'] parser.add_argument('domain', help='Domain name or URL to scan') parser.add_argument('-a', '--all', action='store_true', help='Print all DNS records instead of the first ones') parser.add_argument('-b', '--banners', action='store_true', help='Determine HTTP and SMTP service banners') parser.add_argument('-d', '--dictionary', type=str, metavar='FILE', help='Generate more domains using dictionary FILE') parser.add_argument('-f', '--format', type=str, default='cli', help='Output format: cli, csv, json, list (default: cli)') - parser.add_argument('--fuzzers', type=str, metavar='LIST', help='Use only selected fuzzing algorithms (separated with commas)') + parser.add_argument('--fuzzers', type=str, metavar='LIST', nargs='?', default=', '.join(_default_fuzzers), help='Use only selected fuzzing algorithms (separated with commas).') parser.add_argument('-g', '--geoip', action='store_true', help='Lookup for GeoIP location') parser.add_argument('--lsh', type=str, metavar='LSH', nargs='?', const='ssdeep', help='Evaluate web page similarity with LSH algorithm: ssdeep, tlsh (default: ssdeep)') @@ -1183,6 +1185,9 @@ def signal_handler(signal, frame): parser.error('argument --dictionary cannot be used with selected fuzzing algorithms (consider enabling fuzzer: dictionary)') if args.tld and 'tld-swap' not in fuzzers: parser.error('argument --tld cannot be used with selected fuzzing algorithms (consider enabling fuzzer: tld-swap)') + if not args.fuzzers: + parser.error('argument --fuzzers requires a comma-separated list of fuzzers.\nAvailable fuzzers: {}' + .format(', '.join(_default_fuzzers))) nameservers = [] if args.nameservers: