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

SSdeep error #151

Closed Seotoolsdeveloper closed 1 year ago

Seotoolsdeveloper commented 2 years ago

I can't seem to get ssdeep working correctly in webapp.py I am getting nan

where could I be going wrong .

in def scan(self): I have added worker.option_ssdeep = True worker.ssdeep_init =True

and this one in csv export str(domain.get('ssdeep', '')),

elceef commented 2 years ago

You didn't specify ssdeep hash of the original web page to compare with.

Seotoolsdeveloper commented 2 years ago

What you mean by I did not specify "ssdeep hash of the original web page". Because I am giving the domain in the webapp.py and then want it to return the domains typos with ssdeep.

Also can you give an example implementation in webapp

elceef commented 2 years ago

You need to fetch the original web page on your own, then calculate ssdeep hash and pass it as worker.ssdeep_init

Seotoolsdeveloper commented 2 years ago

Let me try this hack

Seotoolsdeveloper commented 2 years ago

I think from the Scanner Class we have the ssdeep set

< `if self.option_ssdeep:

            if dns_a is True or dns_aaaa is True:
                try:
                    r = UrlOpener(self.url.full_uri(domain),
                        timeout=REQUEST_TIMEOUT_HTTP,
                        headers={'User-Agent': self.useragent,
                            'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9',
                            'Accept-Encoding': 'gzip,identity',
                            'Accept-Language': 'en-GB,en-US;q=0.9,en;q=0.8'},
                        verify=False)
                except Exception as e:
                    self._debug(e)
                else:
                    if r.url.split('?')[0] != self.ssdeep_effective_url:
                        ssdeep_curr = ssdeep.hash(r.normalized_content)
                        task['ssdeep'] = ssdeep.compare(self.ssdeep_init, ssdeep_curr)

`>

and If ssdeep is set to true then it should show the ssdeep data

       <worker.setDaemon(True)
        worker.option_extdns = True
        worker.option_geoip = True
        worker.option_ssdeep = True
        worker.ssdeep_init =True>