diff --git a/EmailHarvester.py b/EmailHarvester.py index db09c16..9d38b7b 100644 --- a/EmailHarvester.py +++ b/EmailHarvester.py @@ -81,8 +81,11 @@ class myparser: class EmailHarvester(object): - def __init__(self): + def __init__(self, userAgent, proxy): self.plugins = {} + self.proxy = proxy + self.userAgent = userAgent + path = "plugins/" plugins = {} @@ -102,16 +105,14 @@ class EmailHarvester(object): def show_message(self, msg): print(green(msg)) - def init_search(self, urlPattern, word, limit, counterInit, counterStep, userAgent, proxy): + def init_search(self, urlPattern, word, limit, counterInit, counterStep): self.results = "" self.totalresults = "" - self.userAgent = userAgent self.limit = int(limit) self.counter = int(counterInit) self.urlPattern = urlPattern self.step = int(counterStep) self.word = word - self.proxy = proxy def do_search(self): try: @@ -232,19 +233,19 @@ if __name__ == '__main__': filename = args.filename or "" limit = args.limit engine = args.engine - app = EmailHarvester() + app = EmailHarvester(userAgent, args.proxy) plugins = app.get_plugins() all_emails = [] if engine == "all": print(green("[+] Searching everywhere..")) for search_engine in plugins: - all_emails += plugins[search_engine]['search'](domain, limit, userAgent, args.proxy) + all_emails += plugins[search_engine]['search'](domain, limit) elif engine not in plugins: print(red("Search engine plugin not found")) sys.exit(3) else: - msg, all_emails = plugins[engine]['search'](domain, limit, userAgent, args.proxy) + msg, all_emails = plugins[engine]['search'](domain, limit) print(green(msg)) all_emails = unique(all_emails) diff --git a/plugins/ask.py b/plugins/ask.py index 89e787f..661468e 100644 --- a/plugins/ask.py +++ b/plugins/ask.py @@ -25,10 +25,10 @@ app_emailharvester = None -def search(domain, limit, userAgent, proxy): +def search(domain, limit): app_emailharvester.show_message("\n[+] Searching in ASK..\n") url = "http://www.ask.com/web?q=%40{word}" - app_emailharvester.init_search(url, domain, limit, 0, 100, userAgent, proxy) + app_emailharvester.init_search(url, domain, limit, 0, 100) app_emailharvester.process() return app_emailharvester.get_emails() diff --git a/plugins/bing.py b/plugins/bing.py index 5454880..40a392c 100644 --- a/plugins/bing.py +++ b/plugins/bing.py @@ -25,10 +25,10 @@ app_emailharvester = None -def search(domain, limit, userAgent, proxy): +def search(domain, limit): app_emailharvester.show_message("\n[+] Searching in Bing..\n") url = "http://www.bing.com/search?q=%40{word}&count=50&first={counter}" - app_emailharvester.init_search(url, domain, limit, 0, 50, userAgent, proxy) + app_emailharvester.init_search(url, domain, limit, 0, 50) app_emailharvester.process() return app_emailharvester.get_emails() diff --git a/plugins/google.py b/plugins/google.py index 260dc9a..f6c3c29 100644 --- a/plugins/google.py +++ b/plugins/google.py @@ -25,10 +25,10 @@ app_emailharvester = None -def search(domain, limit, userAgent, proxy): +def search(domain, limit): app_emailharvester.show_message("\n[+] Searching in Google..\n") url = 'http://www.google.com/search?num=100&start={counter}&hl=en&q=%40"{word}"' - app_emailharvester.init_search(url, domain, limit, 0, 100, userAgent, proxy) + app_emailharvester.init_search(url, domain, limit, 0, 100) app_emailharvester.process() return app_emailharvester.get_emails() diff --git a/plugins/yahoo.py b/plugins/yahoo.py index 0669a28..6cd39df 100644 --- a/plugins/yahoo.py +++ b/plugins/yahoo.py @@ -25,10 +25,10 @@ app_emailharvester = None -def search(domain, limit, userAgent, proxy): +def search(domain, limit): app_emailharvester.show_message("\n[+] Searching in Yahoo..\n") url = "http://search.yahoo.com/search?p=%40{word}&n=100&ei=UTF-8&va_vt=any&vo_vt=any&ve_vt=any&vp_vt=any&vd=all&vst=0&vf=all&vm=p&fl=0&fr=yfp-t-152&xargs=0&pstart=1&b={counter}" - app_emailharvester.init_search(url, domain, limit, 1, 100, userAgent, proxy) + app_emailharvester.init_search(url, domain, limit, 1, 100) app_emailharvester.process() return app_emailharvester.get_emails()