DataSploit / datasploit

An #OSINT Framework to perform various recon techniques on Companies, People, Phone Number, Bitcoin Addresses, etc., aggregate all the raw data, and give data in multiple formats.
GNU General Public License v3.0
3.02k stars 425 forks source link

Unicode Encoding and total_results in domain_pastes.py #123

Closed mainframed closed 6 years ago

mainframed commented 7 years ago

Two quick fixes in domain_pastes.py:

Line 41

https://github.com/DataSploit/datasploit/blob/master/domain_pastes.py#L41

Causes unicode error for non ascii characters. Change:

From

print "Title: %s\nURL: %s\nSnippet: %s\n" % (x['title'], colorize(x['link']), colorize(x['snippet']))

To

snippet = x['snippet'].encode('ascii', 'ignore').decode('ascii')
title = x['title'].encode('ascii', 'ignore').decode('ascii')
print "Title: %s\nURL: %s\nSnippet: %s\n" % (title, colorize(x['link']), colorize(snippet))

This prevents it from erroring out when encountering unicode characters (it removes them).

Line 59

https://github.com/DataSploit/datasploit/blob/master/domain_pastes.py#L59

the google_search function returns a tuple ('total results', 'results') but your comparison is done against numbers. A simple fix:

From:

total_results = google_search(domain, 1)

To:

total_results = google_search(domain, 1)[0]
KunalAggarwal commented 6 years ago

@mainframed Thanks for the inputs. Incorporated in commit 0c2b10083c6a7a865e914d04e10225a57b9b2c78. Marking as closed.