elceef / dnstwist

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

Error when trying to fuzz with --tld #169

Closed ebereorisi closed 1 year ago

ebereorisi commented 1 year ago

I get an error when trying to fuzz with --tld. Is there a fuzzer algorithm name for tld-swap? dnstwist

elceef commented 1 year ago

According to Python3 docs, open() uses local environment to choose encoding:

The default encoding is platform dependent (whatever locale.getpreferredencoding() returns), but any text encoding supported by Python can be used.

The error you encountered is due to the fact that common_tlds.dict contains UTF-8 characters and locales.getpreferredencoding() returns cp1252.

Probably the best solution is to run Python in UTF-8 mode, for example by running it -Xutf8 parameter, like this:

python -Xutf dnstwist.py
ebereorisi commented 1 year ago

This works, but it uses other fuzzer algorithms also. I only want tld-swap, is that possible? or is there a switch to exclude some algorithms? Thank you!

elceef commented 1 year ago

The latest release introduced --fuzzers option. Try this:

dnstwist.py --fuzzers tld-swap --tld ./dictionaries/common_tlds.dict -r
ebereorisi commented 1 year ago

Thank you very much!