diff --git a/discovery/bingsearch.py b/discovery/bingsearch.py index a169772a..93a79611 100644 --- a/discovery/bingsearch.py +++ b/discovery/bingsearch.py @@ -33,13 +33,14 @@ def do_search(self): self.totalresults += self.results def do_search_api(self): - h = http.client.HTTPConnection(self.apiserver) - h.putrequest('GET', "/xml.aspx?Appid=" + self.bingApi + "&query=%40" + - self.word + "&sources=web&web.count=40&web.offset=" + str(self.counter)) - h.putheader('Host', "api.search.live.net") - h.putheader('User-agent', self.userAgent) - h.endheaders() - self.results = str(h.getresponse().read()) + url = 'http://' + self.server + "/xml.aspx?Appid="+self.bingApi+"&query=%40" + \ + self.word + "&sources=web&web.count=40&web.offset=" + str(self.counter) + headers = { + 'Host': "api.search.live.net", + 'User-agent': self.userAgent + } + h = requests.get(url=url, headers=headers) + self.results = str(h.content) self.totalresults += self.results def do_search_vhost(self): diff --git a/discovery/googlesearch.py b/discovery/googlesearch.py index e2140a04..8cd6a3d3 100644 --- a/discovery/googlesearch.py +++ b/discovery/googlesearch.py @@ -36,10 +36,11 @@ def do_search(self): print(e) try: params = {'User-Agent': random.choice(self.userAgent)} #select random user agent - r=requests.get(urly,params= params) + r=requests.get(urly,params=params) except Exception as e: print(e) - self.results = str(r.content) + self.results = r.text + #print('self.results: ', self.results) self.totalresults += self.results def do_search_profiles(self): @@ -51,7 +52,7 @@ def do_search_profiles(self): r=requests.get(urly) except Exception as e: print(e) - self.results = r.content + self.results = r.text #'&hl=en&meta=&q=site:www.google.com%20intitle:"Google%20Profile"%20"Companies%20I%27ve%20worked%20for"%20"at%20' + self.word + '"') self.totalresults += self.results diff --git a/theHarvester.py b/theHarvester.py index 40e6ff02..7a4ac994 100644 --- a/theHarvester.py +++ b/theHarvester.py @@ -134,7 +134,6 @@ def start(argv): search = googlesearch.search_google(word, limit, start) search.process(google_dorking) all_emails = search.get_emails() - print('all_emails is: ',all_emails) all_hosts = search.get_hostnames() for x in all_hosts: try: