Skip to content

Commit da2bc32

Browse files
committed
output improvement+youtube plugin
output improvement youtube plugin added
1 parent 932ca05 commit da2bc32

File tree

16 files changed

+139
-94
lines changed

16 files changed

+139
-94
lines changed

EmailHarvester.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
__copyright__ = "Copyright (c) 2016 @maldevel"
2929
__credits__ = ["maldevel", "PaulSec", "cclauss", "Christian Martorella"]
3030
__license__ = "GPLv3"
31-
__version__ = "1.3.1"
31+
__version__ = "1.3.2"
3232
__maintainer__ = "maldevel"
3333

3434
################################
@@ -93,6 +93,7 @@ def __init__(self, userAgent, proxy):
9393
self.proxy = proxy
9494
self.userAgent = userAgent
9595
self.parser = myparser()
96+
self.activeEngine = "None"
9697
path = "plugins/"
9798
plugins = {}
9899

@@ -112,14 +113,15 @@ def get_plugins(self):
112113
def show_message(self, msg):
113114
print(green(msg))
114115

115-
def init_search(self, url, word, limit, counterInit, counterStep):
116+
def init_search(self, url, word, limit, counterInit, counterStep, engineName):
116117
self.results = ""
117118
self.totalresults = ""
118119
self.limit = int(limit)
119120
self.counter = int(counterInit)
120121
self.url = url
121122
self.step = int(counterStep)
122123
self.word = word
124+
self.activeEngine = engineName
123125

124126
def do_search(self):
125127
try:
@@ -143,11 +145,11 @@ def process(self):
143145
self.do_search()
144146
time.sleep(1)
145147
self.counter += self.step
146-
print("\tSearching " + str(self.counter) + " results...")
148+
print(green("[+] Searching in {}:".format(self.activeEngine)) + cyan(" {} results".format(str(self.counter))))
147149

148150
def get_emails(self):
149151
self.parser.extract(self.totalresults, self.word)
150-
return self.parser.emails()
152+
return self.parser.emails()
151153

152154
###################################################################
153155

@@ -160,6 +162,9 @@ def green(text):
160162
def red(text):
161163
return colored(text, 'red', attrs=['bold'])
162164

165+
def cyan(text):
166+
return colored(text, 'cyan', attrs=['bold'])
167+
163168
def unique(data):
164169
return list(set(data))
165170

@@ -230,14 +235,12 @@ def checkDomain(value):
230235

231236
if args.listplugins:
232237
path = "plugins/"
233-
msg = "[+] Available plugins:"
234-
print(green(msg))
235-
print(green("-" * len(msg)))
238+
print(green("[+] Available plugins"))
236239
sys.path.insert(0, path)
237240
for f in os.listdir(path):
238241
fname, ext = os.path.splitext(f)
239242
if ext == '.py':
240-
print(fname)
243+
print(green("[+] Plugin: ") + cyan(fname))
241244
sys.exit(1)
242245

243246
if not args.domain:
@@ -248,10 +251,10 @@ def checkDomain(value):
248251
userAgent = (args.uagent or
249252
"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1")
250253

251-
print("User-Agent in use: {}".format(yellow(userAgent)))
254+
print(green("[+] User-Agent in use: ") + cyan(userAgent))
252255

253256
if args.proxy:
254-
print("Proxy server in use: {}".format(yellow(args.proxy.scheme + "://" + args.proxy.netloc)))
257+
print(green("[+] Proxy server in use: ") + cyan(args.proxy.scheme + "://" + args.proxy.netloc))
255258

256259
filename = args.filename or ""
257260
limit = args.limit
@@ -264,40 +267,38 @@ def checkDomain(value):
264267
if args.exclude:
265268
excluded = args.exclude.split(',')
266269
if engine == "all":
267-
print(green("[+] Searching everywhere.."))
270+
print(green("[+] Searching everywhere"))
268271
for search_engine in plugins:
269272
if search_engine not in excluded:
270273
all_emails += plugins[search_engine]['search'](domain, limit)
271274
elif engine not in plugins:
272-
print(red("Search engine plugin not found"))
275+
print(red("[-] Search engine plugin not found"))
273276
sys.exit(3)
274277
else:
275278
all_emails = plugins[engine]['search'](domain, limit)
276279
all_emails = unique(all_emails)
277280

278281
if not all_emails:
279-
print(red("\nNo emails found!"))
282+
print(red("[-] No emails found"))
280283
sys.exit(4)
281284

282-
msg = "\n\n[+] {} emails found:".format(len(all_emails))
283-
print(green(msg))
284-
print(green("-" * len(msg)))
285+
print(green("[+] Emails found: ") + cyan(len(all_emails)))
285286

286287
if not args.noprint:
287288
for emails in all_emails:
288289
print(emails)
289290

290291
if filename:
291292
try:
292-
print(green("\n[+] Saving files..."))
293+
print(green("[+] Saving results to files"))
293294
with open(filename, 'w') as out_file:
294295
for email in all_emails:
295296
try:
296297
out_file.write(email + "\n")
297298
except:
298-
print(red("Exception " + email))
299+
print(red("[-] Exception: " + email))
299300
except Exception as e:
300-
print(red("Error saving TXT file: " + e))
301+
print(red("[-] Error saving TXT file: " + e))
301302

302303
try:
303304
filename = filename.split(".")[0] + ".xml"
@@ -306,7 +307,7 @@ def checkDomain(value):
306307
for email in all_emails:
307308
out_file.write('<email>{}</email>'.format(email))
308309
out_file.write('</EmailHarvester>')
309-
print(green("Files saved!"))
310+
print(green("[+] Files saved"))
310311
except Exception as er:
311-
print(red("Error saving XML file: " + er))
312+
print(red("[-] Error saving XML file: " + er))
312313

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Features
2525
* Define your own User-Agent string.
2626
* Use proxy server.
2727
* Plugins system.
28-
* Search in popular web sites using Search engines (Twitter, LinkedIn, Google+, Github, Instagram, Reddit).
28+
* Search in popular web sites using Search engines (Twitter, LinkedIn, Google+, Github, Instagram, Reddit, Youtube).
2929

3030

3131
Download/Installation
@@ -48,7 +48,7 @@ usage: EmailHarvester.py [-h] [-d DOMAIN] [-s FILE] [-e ENGINE] [-l LIMIT]
4848
\____/|_| |_| |_| \__,_||_||_| \_| |_/ \__,_||_| \_/ \___||___/ \__|\___||_|
4949
5050
A tool to retrieve Domain email addresses from Search Engines | @maldevel
51-
Version: 1.3.1
51+
Version: 1.3.2
5252
5353
optional arguments:
5454
-h, --help show this help message and exit

plugins/ask.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,19 @@
2424
import requests
2525
import time
2626
import sys
27+
from termcolor import colored
2728

2829
config = None
2930
app_emailharvester = None
3031

32+
def green(text):
33+
return colored(text, 'green', attrs=['bold'])
34+
35+
def red(text):
36+
return colored(text, 'red', attrs=['bold'])
37+
38+
def cyan(text):
39+
return colored(text, 'cyan', attrs=['bold'])
3140

3241
class AskSearch(object):
3342

@@ -65,15 +74,14 @@ def process(self):
6574
time.sleep(1)
6675
self.counter += 10
6776
self.page += 1
68-
print("\tSearching " + str(self.counter) + " results...")
77+
print(green("[+] Searching in ASK:") + cyan(" {} results".format(str(self.counter))))
6978

7079
def get_emails(self):
7180
app_emailharvester.parser.extract(self.totalresults, self.word)
7281
return app_emailharvester.parser.emails()
7382

7483

7584
def search(domain, limit):
76-
app_emailharvester.show_message("\n[+] Searching in ASK..\n")
7785
url = "http://www.ask.com/web?q=%40{word}&page={page}"
7886
search = AskSearch(url, domain, limit)
7987
search.process()

plugins/baidu.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626

2727

2828
def search(domain, limit):
29-
app_emailharvester.show_message("\n[+] Searching in Baidu..\n")
3029
url = 'http://www.baidu.com/search/s?wd="%40{word}"&pn={counter}'
31-
app_emailharvester.init_search(url, domain, limit, 0, 10)
30+
app_emailharvester.init_search(url, domain, limit, 0, 10, 'Baidu')
3231
app_emailharvester.process()
3332
return app_emailharvester.get_emails()
3433

plugins/bing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626

2727

2828
def search(domain, limit):
29-
app_emailharvester.show_message("\n[+] Searching in Bing..\n")
3029
url = "http://www.bing.com/search?q=%40{word}&count=50&first={counter}"
31-
app_emailharvester.init_search(url, domain, limit, 0, 50)
30+
app_emailharvester.init_search(url, domain, limit, 0, 50, 'Bing')
3231
app_emailharvester.process()
3332
return app_emailharvester.get_emails()
3433

plugins/dogpile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626

2727

2828
def search(domain, limit):
29-
app_emailharvester.show_message("\n[+] Searching in Dogpile..\n")
3029
url = 'http://www.dogpile.com/search/web?qsi={counter}&q="%40{word}"'
31-
app_emailharvester.init_search(url, domain, limit, 1, 10)
30+
app_emailharvester.init_search(url, domain, limit, 1, 10, 'Dogpile')
3231
app_emailharvester.process()
3332
return app_emailharvester.get_emails()
3433

plugins/exalead.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626

2727

2828
def search(domain, limit):
29-
app_emailharvester.show_message("\n[+] Searching in Exalead..\n")
3029
url = "http://www.exalead.com/search/web/results/?q=%40{word}&elements_per_page=10&start_index={counter}"
31-
app_emailharvester.init_search(url, domain, limit, 0, 50)
30+
app_emailharvester.init_search(url, domain, limit, 0, 50, 'Exalead')
3231
app_emailharvester.process()
3332
return app_emailharvester.get_emails()
3433

plugins/github.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,35 +27,30 @@
2727

2828
def search(domain, limit):
2929
all_emails = []
30-
app_emailharvester.show_message("\n[+] Searching in Github..\n")
30+
app_emailharvester.show_message("[+] Searching in Github")
3131

32-
app_emailharvester.show_message("\n[+] Searching in Yahoo + Github..\n")
3332
yahooUrl = "http://search.yahoo.com/search?p=site%3Agithub.com+%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}"
34-
app_emailharvester.init_search(yahooUrl, domain, limit, 1, 100)
33+
app_emailharvester.init_search(yahooUrl, domain, limit, 1, 100, 'Yahoo + Github')
3534
app_emailharvester.process()
3635
all_emails += app_emailharvester.get_emails()
3736

38-
app_emailharvester.show_message("\n[+] Searching in Bing + Github..\n")
3937
bingUrl = "http://www.bing.com/search?q=site%3Agithub.com+%40{word}&count=50&first={counter}"
40-
app_emailharvester.init_search(bingUrl, domain, limit, 0, 50)
38+
app_emailharvester.init_search(bingUrl, domain, limit, 0, 50, 'Bing + Github')
4139
app_emailharvester.process()
4240
all_emails += app_emailharvester.get_emails()
4341

44-
app_emailharvester.show_message("\n[+] Searching in Google + Github..\n")
4542
googleUrl = 'https://www.google.com/search?num=100&start={counter}&hl=en&q=site%3Agithub.com+"%40{word}"'
46-
app_emailharvester.init_search(googleUrl, domain, limit, 0, 100)
43+
app_emailharvester.init_search(googleUrl, domain, limit, 0, 100, 'Google + Github')
4744
app_emailharvester.process()
4845
all_emails += app_emailharvester.get_emails()
4946

50-
app_emailharvester.show_message("\n[+] Searching in Baidu + Github..\n")
5147
url = 'http://www.baidu.com/search/s?wd=site%3Agithub.com+"%40{word}"&pn={counter}'
52-
app_emailharvester.init_search(url, domain, limit, 0, 10)
48+
app_emailharvester.init_search(url, domain, limit, 0, 10, 'Baidu + Github')
5349
app_emailharvester.process()
5450
all_emails += app_emailharvester.get_emails()
5551

56-
app_emailharvester.show_message("\n[+] Searching in Exalead + Github..\n")
5752
url = "http://www.exalead.com/search/web/results/?q=site%3Agithub.com+%40{word}&elements_per_page=10&start_index={counter}"
58-
app_emailharvester.init_search(url, domain, limit, 0, 50)
53+
app_emailharvester.init_search(url, domain, limit, 0, 50, 'Exalead + Github')
5954
app_emailharvester.process()
6055
all_emails += app_emailharvester.get_emails()
6156

plugins/google.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@
2626

2727

2828
def search(domain, limit):
29-
app_emailharvester.show_message("\n[+] Searching in Google..\n")
3029
url = 'https://www.google.com/search?num=100&start={counter}&hl=en&q="%40{word}"'
31-
app_emailharvester.init_search(url, domain, limit, 0, 100)
30+
app_emailharvester.init_search(url, domain, limit, 0, 100, 'Google')
3231
app_emailharvester.process()
3332
return app_emailharvester.get_emails()
3433

plugins/googleplus.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,10 @@
2626

2727

2828
def search(domain, limit):
29-
app_emailharvester.show_message("\n[+] Searching in Google+..\n")
3029
#search google+ only with google search engine
3130
#who is gonna have google+ indexed better than google itself?
3231
url = 'https://www.google.com/search?num=100&start={counter}&hl=en&q=site%3Aplus.google.com+intext:"Works at"+-inurl:photos+-inurl:about+-inurl:posts+-inurl:plusones+%40{word}'
33-
app_emailharvester.init_search(url, domain, limit, 0, 100)
32+
app_emailharvester.init_search(url, domain, limit, 0, 100, 'Google+')
3433
app_emailharvester.process()
3534
return app_emailharvester.get_emails()
3635

0 commit comments

Comments
 (0)