elceef / dnstwist

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

problem with SSDEEP on python3 #164

Closed talelbaz closed 2 years ago

talelbaz commented 2 years ago

Exception in thread Thread-9: Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/threading.py", line 973, in _bootstrap_inner self.run() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/dnstwist.py", line 786, in run task['ssdeep'] = ssdeep.compare(self.ssdeep_init, ssdeep_curr) File "ssdeep.pyx", line 39, in ssdeep.compare (ssdeep.c:695) TypeError: expected bytes, str found

elceef commented 2 years ago

Which dnstwist version?

talelbaz commented 2 years ago

Version 20220131 with python 3.9

elceef commented 2 years ago

Did you install the tool using brew with all dependencies including ssdeep or the latter was installed in some other way? It seems like the Python wrapper for ssdeep is returning TypeError here. File "ssdeep.pyx", line 39, in ssdeep.compare (ssdeep.c:695)

talelbaz commented 2 years ago

I am working with the python package, I installed the package for the dnstwist for the version above.(pip3 install dnstwist)

elceef commented 2 years ago

pip3 install dnstwist pulls ppdeep=20200505 which is pure Python implementation of ssdeep, but the tool itself prefers ssdeep over ppdeep. It looks like you must have installed ssdeep. Could you please run Python interpreter with the following code?

import ssdeep
ssdeep.__version__
ssdeep.compare('3::', '3::')
talelbaz commented 2 years ago

Traceback (most recent call last): File "/xxx.py", line 3, in ssdeep.compare('3::', '3::') File "ssdeep.pyx", line 39, in ssdeep.compare (ssdeep.c:695) TypeError: expected bytes, str found

talelbaz commented 2 years ago

ssdeep.version = 2.5

elceef commented 2 years ago

Your ssdeep.version is ancient - originally released in 2010. Try upgrading to ssdeep 3.1

talelbaz commented 2 years ago

thx!