proxy and useragent params moved

remove proxy and useragent param from plugins
This commit is contained in:
maldevel 2016-04-22 16:38:38 +03:00
parent 9f0b341ebf
commit 8415215fb5
5 changed files with 16 additions and 15 deletions

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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()

View file

@ -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()