validate domain+instagram+reddit
release 1.3.1
validate domain
instagram plugin added
reddit plugin added
validators required
maldevel
8 years ago
27 | 27 | __copyright__ = "Copyright (c) 2016 @maldevel" |
28 | 28 | __credits__ = ["maldevel", "PaulSec", "cclauss", "Christian Martorella"] |
29 | 29 | __license__ = "GPLv3" |
30 | __version__ = "1.3.0" | |
30 | __version__ = "1.3.1" | |
31 | 31 | __maintainer__ = "maldevel" |
32 | 32 | |
33 | 33 | ################################ |
34 | ||
34 | 35 | import argparse |
35 | 36 | import sys |
36 | 37 | import time |
37 | 38 | import requests |
38 | 39 | import re |
39 | 40 | import os |
41 | import validators | |
40 | 42 | |
41 | 43 | from termcolor import colored |
42 | 44 | from argparse import RawTextHelpFormatter |
43 | 45 | from sys import platform as _platform |
44 | 46 | from urllib.parse import urlparse |
47 | ||
45 | 48 | ################################ |
49 | ||
46 | 50 | |
47 | 51 | if _platform == 'win32': |
48 | 52 | import colorama |
172 | 176 | return x |
173 | 177 | raise argparse.ArgumentTypeError("Minimum results limit is 1.") |
174 | 178 | |
179 | def checkDomain(value): | |
180 | domain_checked = validators.domain(value) | |
181 | if not domain_checked: | |
182 | raise argparse.ArgumentTypeError('Invalid {} domain.'.format(value)) | |
183 | return value | |
184 | ||
175 | 185 | ################################################################### |
176 | 186 | |
177 | 187 | if __name__ == '__main__': |
191 | 201 | formatter_class=RawTextHelpFormatter) |
192 | 202 | |
193 | 203 | parser.add_argument("-d", '--domain', action="store", metavar='DOMAIN', dest='domain', |
194 | default=None, type=str, help="Domain to search.") | |
204 | default=None, type=checkDomain, help="Domain to search.") | |
195 | 205 | parser.add_argument("-s", '--save', action="store", metavar='FILE', dest='filename', |
196 | 206 | default=None, type=str, help="Save the results into a TXT and XML file (both).") |
197 | 207 |
13 | 13 | * termcolor |
14 | 14 | * colorama |
15 | 15 | * requests |
16 | * validators | |
16 | 17 | |
17 | 18 | |
18 | 19 | Features |
19 | 20 | ===== |
20 | * Retrieve Domain email addresses from Search Engines (Google, Bing, Yahoo, ASK, Baidu, Dogpile, Exalead). | |
21 | * Retrieve Domain email addresses from popular Search engines (Google, Bing, Yahoo, ASK, Baidu, Dogpile, Exalead). | |
21 | 22 | * Export results to txt and xml files. |
22 | 23 | * Limit search results. |
23 | 24 | * Define your own User-Agent string. |
24 | 25 | * Use proxy server. |
25 | 26 | * Plugins system. |
26 | * Search in popular web sites using Search engines (Twitter, LinkedIn, Google+, Github). | |
27 | * Search in popular web sites using Search engines (Twitter, LinkedIn, Google+, Github, Instagram, Reddit). | |
27 | 28 | |
28 | 29 | |
29 | 30 | Download/Installation |
46 | 47 | \____/|_| |_| |_| \__,_||_||_| \_| |_/ \__,_||_| \_/ \___||___/ \__|\___||_| |
47 | 48 | |
48 | 49 | A tool to retrieve Domain email addresses from Search Engines | @maldevel |
49 | Version: 1.3.0 | |
50 | Version: 1.3.1 | |
50 | 51 | |
51 | 52 | optional arguments: |
52 | 53 | -h, --help show this help message and exit |
0 | """ | |
1 | This file is part of EmailHarvester | |
2 | Copyright (C) 2016 @maldevel | |
3 | https://github.com/maldevel/EmailHarvester | |
4 | ||
5 | EmailHarvester - A tool to retrieve Domain email addresses from Search Engines. | |
6 | ||
7 | This program is free software: you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation, either version 3 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | For more see the file 'LICENSE' for copying permission. | |
21 | """ | |
22 | ||
23 | #config = None | |
24 | app_emailharvester = None | |
25 | ||
26 | ||
27 | def search(domain, limit): | |
28 | all_emails = [] | |
29 | app_emailharvester.show_message("\n[+] Searching in Instagram..\n") | |
30 | ||
31 | app_emailharvester.show_message("\n[+] Searching in Yahoo + Instagram..\n") | |
32 | 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}" | |
33 | app_emailharvester.init_search(yahooUrl, domain, limit, 1, 100) | |
34 | app_emailharvester.process() | |
35 | all_emails += app_emailharvester.get_emails() | |
36 | ||
37 | app_emailharvester.show_message("\n[+] Searching in Bing + Instagram..\n") | |
38 | bingUrl = "http://www.bing.com/search?q=site%3Ainstagram.com+%40{word}&count=50&first={counter}" | |
39 | app_emailharvester.init_search(bingUrl, domain, limit, 0, 50) | |
40 | app_emailharvester.process() | |
41 | all_emails += app_emailharvester.get_emails() | |
42 | ||
43 | app_emailharvester.show_message("\n[+] Searching in Google + Instagram..\n") | |
44 | googleUrl = 'https://www.google.com/search?num=100&start={counter}&hl=en&q=site%3Ainstagram.com+"%40{word}"' | |
45 | app_emailharvester.init_search(googleUrl, domain, limit, 0, 100) | |
46 | app_emailharvester.process() | |
47 | all_emails += app_emailharvester.get_emails() | |
48 | ||
49 | app_emailharvester.show_message("\n[+] Searching in Baidu + Instagram..\n") | |
50 | url = 'http://www.baidu.com/search/s?wd=site%3Ainstagram.com+"%40{word}"&pn={counter}' | |
51 | app_emailharvester.init_search(url, domain, limit, 0, 10) | |
52 | app_emailharvester.process() | |
53 | all_emails += app_emailharvester.get_emails() | |
54 | ||
55 | app_emailharvester.show_message("\n[+] Searching in Exalead + Instagram..\n") | |
56 | url = "http://www.exalead.com/search/web/results/?q=site%3Ainstagram.com+%40{word}&elements_per_page=10&start_index={counter}" | |
57 | app_emailharvester.init_search(url, domain, limit, 0, 50) | |
58 | app_emailharvester.process() | |
59 | all_emails += app_emailharvester.get_emails() | |
60 | ||
61 | #dogpile seems to not support site: | |
62 | ||
63 | return all_emails | |
64 | ||
65 | ||
66 | class Plugin: | |
67 | def __init__(self, app, conf):# | |
68 | global app_emailharvester, config | |
69 | #config = conf | |
70 | app.register_plugin('instagram', {'search': search}) | |
71 | app_emailharvester = app | |
72 | ⏎ |
0 | """ | |
1 | This file is part of EmailHarvester | |
2 | Copyright (C) 2016 @maldevel | |
3 | https://github.com/maldevel/EmailHarvester | |
4 | ||
5 | EmailHarvester - A tool to retrieve Domain email addresses from Search Engines. | |
6 | ||
7 | This program is free software: you can redistribute it and/or modify | |
8 | it under the terms of the GNU General Public License as published by | |
9 | the Free Software Foundation, either version 3 of the License, or | |
10 | (at your option) any later version. | |
11 | ||
12 | This program is distributed in the hope that it will be useful, | |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | GNU General Public License for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License | |
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | |
19 | ||
20 | For more see the file 'LICENSE' for copying permission. | |
21 | """ | |
22 | ||
23 | #config = None | |
24 | app_emailharvester = None | |
25 | ||
26 | ||
27 | def search(domain, limit): | |
28 | all_emails = [] | |
29 | app_emailharvester.show_message("\n[+] Searching in Reddit..\n") | |
30 | ||
31 | app_emailharvester.show_message("\n[+] Searching in Yahoo + Reddit..\n") | |
32 | 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}" | |
33 | app_emailharvester.init_search(yahooUrl, domain, limit, 1, 100) | |
34 | app_emailharvester.process() | |
35 | all_emails += app_emailharvester.get_emails() | |
36 | ||
37 | app_emailharvester.show_message("\n[+] Searching in Bing + Reddit..\n") | |
38 | bingUrl = "http://www.bing.com/search?q=site%3Areddit.com+%40{word}&count=50&first={counter}" | |
39 | app_emailharvester.init_search(bingUrl, domain, limit, 0, 50) | |
40 | app_emailharvester.process() | |
41 | all_emails += app_emailharvester.get_emails() | |
42 | ||
43 | app_emailharvester.show_message("\n[+] Searching in Google + Reddit..\n") | |
44 | googleUrl = 'https://www.google.com/search?num=100&start={counter}&hl=en&q=site%3Areddit.com+"%40{word}"' | |
45 | app_emailharvester.init_search(googleUrl, domain, limit, 0, 100) | |
46 | app_emailharvester.process() | |
47 | all_emails += app_emailharvester.get_emails() | |
48 | ||
49 | app_emailharvester.show_message("\n[+] Searching in Baidu + Reddit..\n") | |
50 | url = 'http://www.baidu.com/search/s?wd=site%3Areddit.com+"%40{word}"&pn={counter}' | |
51 | app_emailharvester.init_search(url, domain, limit, 0, 10) | |
52 | app_emailharvester.process() | |
53 | all_emails += app_emailharvester.get_emails() | |
54 | ||
55 | app_emailharvester.show_message("\n[+] Searching in Exalead + Reddit..\n") | |
56 | url = "http://www.exalead.com/search/web/results/?q=site%3Areddit.com+%40{word}&elements_per_page=10&start_index={counter}" | |
57 | app_emailharvester.init_search(url, domain, limit, 0, 50) | |
58 | app_emailharvester.process() | |
59 | all_emails += app_emailharvester.get_emails() | |
60 | ||
61 | #dogpile seems to not support site: | |
62 | ||
63 | return all_emails | |
64 | ||
65 | ||
66 | class Plugin: | |
67 | def __init__(self, app, conf):# | |
68 | global app_emailharvester, config | |
69 | #config = conf | |
70 | app.register_plugin('reddit', {'search': search}) | |
71 | app_emailharvester = app | |
72 | ⏎ |