Skip to content

Commit 932ca05

Browse files
committed
validate domain+instagram+reddit
release 1.3.1 validate domain instagram plugin added reddit plugin added validators required
1 parent b0cbc08 commit 932ca05

File tree

5 files changed

+164
-6
lines changed

5 files changed

+164
-6
lines changed

EmailHarvester.py

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

3434
################################
35+
3536
import argparse
3637
import sys
3738
import time
3839
import requests
3940
import re
4041
import os
42+
import validators
4143

4244
from termcolor import colored
4345
from argparse import RawTextHelpFormatter
4446
from sys import platform as _platform
4547
from urllib.parse import urlparse
48+
4649
################################
4750

51+
4852
if _platform == 'win32':
4953
import colorama
5054
colorama.init()
@@ -173,6 +177,12 @@ def limit_type(x):
173177
return x
174178
raise argparse.ArgumentTypeError("Minimum results limit is 1.")
175179

180+
def checkDomain(value):
181+
domain_checked = validators.domain(value)
182+
if not domain_checked:
183+
raise argparse.ArgumentTypeError('Invalid {} domain.'.format(value))
184+
return value
185+
176186
###################################################################
177187

178188
if __name__ == '__main__':
@@ -192,7 +202,7 @@ def limit_type(x):
192202
formatter_class=RawTextHelpFormatter)
193203

194204
parser.add_argument("-d", '--domain', action="store", metavar='DOMAIN', dest='domain',
195-
default=None, type=str, help="Domain to search.")
205+
default=None, type=checkDomain, help="Domain to search.")
196206
parser.add_argument("-s", '--save', action="store", metavar='FILE', dest='filename',
197207
default=None, type=str, help="Save the results into a TXT and XML file (both).")
198208

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ Requirements
1414
* termcolor
1515
* colorama
1616
* requests
17+
* validators
1718

1819

1920
Features
2021
=====
21-
* Retrieve Domain email addresses from Search Engines (Google, Bing, Yahoo, ASK, Baidu, Dogpile, Exalead).
22+
* Retrieve Domain email addresses from popular Search engines (Google, Bing, Yahoo, ASK, Baidu, Dogpile, Exalead).
2223
* Export results to txt and xml files.
2324
* Limit search results.
2425
* Define your own User-Agent string.
2526
* Use proxy server.
2627
* Plugins system.
27-
* Search in popular web sites using Search engines (Twitter, LinkedIn, Google+, Github).
28+
* Search in popular web sites using Search engines (Twitter, LinkedIn, Google+, Github, Instagram, Reddit).
2829

2930

3031
Download/Installation
@@ -47,7 +48,7 @@ usage: EmailHarvester.py [-h] [-d DOMAIN] [-s FILE] [-e ENGINE] [-l LIMIT]
4748
\____/|_| |_| |_| \__,_||_||_| \_| |_/ \__,_||_| \_/ \___||___/ \__|\___||_|
4849
4950
A tool to retrieve Domain email addresses from Search Engines | @maldevel
50-
Version: 1.3.0
51+
Version: 1.3.1
5152
5253
optional arguments:
5354
-h, --help show this help message and exit

plugins/instagram.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
"""
2+
This file is part of EmailHarvester
3+
Copyright (C) 2016 @maldevel
4+
https://github.com/maldevel/EmailHarvester
5+
6+
EmailHarvester - A tool to retrieve Domain email addresses from Search Engines.
7+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 3 of the License, or
11+
(at your option) any later version.
12+
13+
This program is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
21+
For more see the file 'LICENSE' for copying permission.
22+
"""
23+
24+
#config = None
25+
app_emailharvester = None
26+
27+
28+
def search(domain, limit):
29+
all_emails = []
30+
app_emailharvester.show_message("\n[+] Searching in Instagram..\n")
31+
32+
app_emailharvester.show_message("\n[+] Searching in Yahoo + Instagram..\n")
33+
yahooUrl = "http://search.yahoo.com/search?p=site%3Ainstagram.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)
35+
app_emailharvester.process()
36+
all_emails += app_emailharvester.get_emails()
37+
38+
app_emailharvester.show_message("\n[+] Searching in Bing + Instagram..\n")
39+
bingUrl = "http://www.bing.com/search?q=site%3Ainstagram.com+%40{word}&count=50&first={counter}"
40+
app_emailharvester.init_search(bingUrl, domain, limit, 0, 50)
41+
app_emailharvester.process()
42+
all_emails += app_emailharvester.get_emails()
43+
44+
app_emailharvester.show_message("\n[+] Searching in Google + Instagram..\n")
45+
googleUrl = 'https://www.google.com/search?num=100&start={counter}&hl=en&q=site%3Ainstagram.com+"%40{word}"'
46+
app_emailharvester.init_search(googleUrl, domain, limit, 0, 100)
47+
app_emailharvester.process()
48+
all_emails += app_emailharvester.get_emails()
49+
50+
app_emailharvester.show_message("\n[+] Searching in Baidu + Instagram..\n")
51+
url = 'http://www.baidu.com/search/s?wd=site%3Ainstagram.com+"%40{word}"&pn={counter}'
52+
app_emailharvester.init_search(url, domain, limit, 0, 10)
53+
app_emailharvester.process()
54+
all_emails += app_emailharvester.get_emails()
55+
56+
app_emailharvester.show_message("\n[+] Searching in Exalead + Instagram..\n")
57+
url = "http://www.exalead.com/search/web/results/?q=site%3Ainstagram.com+%40{word}&elements_per_page=10&start_index={counter}"
58+
app_emailharvester.init_search(url, domain, limit, 0, 50)
59+
app_emailharvester.process()
60+
all_emails += app_emailharvester.get_emails()
61+
62+
#dogpile seems to not support site:
63+
64+
return all_emails
65+
66+
67+
class Plugin:
68+
def __init__(self, app, conf):#
69+
global app_emailharvester, config
70+
#config = conf
71+
app.register_plugin('instagram', {'search': search})
72+
app_emailharvester = app
73+

plugins/reddit.py

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
"""
2+
This file is part of EmailHarvester
3+
Copyright (C) 2016 @maldevel
4+
https://github.com/maldevel/EmailHarvester
5+
6+
EmailHarvester - A tool to retrieve Domain email addresses from Search Engines.
7+
8+
This program is free software: you can redistribute it and/or modify
9+
it under the terms of the GNU General Public License as published by
10+
the Free Software Foundation, either version 3 of the License, or
11+
(at your option) any later version.
12+
13+
This program is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
GNU General Public License for more details.
17+
18+
You should have received a copy of the GNU General Public License
19+
along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
21+
For more see the file 'LICENSE' for copying permission.
22+
"""
23+
24+
#config = None
25+
app_emailharvester = None
26+
27+
28+
def search(domain, limit):
29+
all_emails = []
30+
app_emailharvester.show_message("\n[+] Searching in Reddit..\n")
31+
32+
app_emailharvester.show_message("\n[+] Searching in Yahoo + Reddit..\n")
33+
yahooUrl = "http://search.yahoo.com/search?p=site%3Areddit.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)
35+
app_emailharvester.process()
36+
all_emails += app_emailharvester.get_emails()
37+
38+
app_emailharvester.show_message("\n[+] Searching in Bing + Reddit..\n")
39+
bingUrl = "http://www.bing.com/search?q=site%3Areddit.com+%40{word}&count=50&first={counter}"
40+
app_emailharvester.init_search(bingUrl, domain, limit, 0, 50)
41+
app_emailharvester.process()
42+
all_emails += app_emailharvester.get_emails()
43+
44+
app_emailharvester.show_message("\n[+] Searching in Google + Reddit..\n")
45+
googleUrl = 'https://www.google.com/search?num=100&start={counter}&hl=en&q=site%3Areddit.com+"%40{word}"'
46+
app_emailharvester.init_search(googleUrl, domain, limit, 0, 100)
47+
app_emailharvester.process()
48+
all_emails += app_emailharvester.get_emails()
49+
50+
app_emailharvester.show_message("\n[+] Searching in Baidu + Reddit..\n")
51+
url = 'http://www.baidu.com/search/s?wd=site%3Areddit.com+"%40{word}"&pn={counter}'
52+
app_emailharvester.init_search(url, domain, limit, 0, 10)
53+
app_emailharvester.process()
54+
all_emails += app_emailharvester.get_emails()
55+
56+
app_emailharvester.show_message("\n[+] Searching in Exalead + Reddit..\n")
57+
url = "http://www.exalead.com/search/web/results/?q=site%3Areddit.com+%40{word}&elements_per_page=10&start_index={counter}"
58+
app_emailharvester.init_search(url, domain, limit, 0, 50)
59+
app_emailharvester.process()
60+
all_emails += app_emailharvester.get_emails()
61+
62+
#dogpile seems to not support site:
63+
64+
return all_emails
65+
66+
67+
class Plugin:
68+
def __init__(self, app, conf):#
69+
global app_emailharvester, config
70+
#config = conf
71+
app.register_plugin('reddit', {'search': search})
72+
app_emailharvester = app
73+

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
termcolor
22
colorama
3-
requests
3+
requests
4+
validators

0 commit comments

Comments
 (0)