├── .gitignore ├── README.md ├── emailosint.py ├── lib ├── __init__.py ├── banner.py ├── check.py ├── color.py ├── output.py ├── parser.py └── request.py ├── recon ├── __init__.py ├── ask.py ├── baidu.py ├── bing.py ├── dogpile.py ├── exalead.py ├── google.py ├── mailtester.py ├── pgp.py ├── pwned.py ├── shodan.py └── yahoo.py ├── requirements.txt └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | lib/__pycache__/ 3 | recon/__pycache__/ 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # emailosint 2 | emailosint is a tool for gathering email accounts informations (ip,hostname,country, etc...) 3 | 4 | [![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com) 5 | 6 | # Installation 7 | ``` 8 | git clone https://github.com/krishpranav/emailosint 9 | cd emailosint 10 | python3 -m pip install -r requirements.txt 11 | python3 emailosint.py 12 | ``` 13 | -------------------------------------------------------------------------------- /emailosint.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import json 3 | import getopt 4 | # infoga.lib 5 | from lib.check import * 6 | from lib.output import * 7 | from lib.banner import Banner 8 | # infoga.recon 9 | from recon.ask import * 10 | from recon.baidu import * 11 | from recon.bing import * 12 | from recon.pgp import * 13 | from recon.yahoo import * 14 | from recon.dogpile import * 15 | from recon.exalead import * 16 | from recon.google import * 17 | from recon.mailtester import * 18 | from lib.output import PPrint 19 | 20 | 21 | class infoga(object): 22 | """ infoga """ 23 | 24 | def __init__(self): 25 | self.verbose = 1 26 | self.domain = None 27 | self.breach = False 28 | self.source = "all" 29 | self.listEmail = [] 30 | self.report = None 31 | 32 | def search(self, module): 33 | emails = module.search() 34 | if emails != ([] or None): 35 | for email in emails: 36 | if email not in self.listEmail: 37 | self.listEmail.append(email) 38 | if self.verbose in (1, 2, 3): 39 | info('Found %s emails in %s' % (len(emails), 40 | module.__class__.__name__)) 41 | 42 | def engine(self, target, engine): 43 | engine_list = [Ask(target), Baidu(target), Bing(target), Dogpile(target), 44 | Exalead(target), Google(target), PGP(target), Yahoo(target) 45 | ] 46 | if engine == 'all': 47 | for e in engine_list: self.search(e) 48 | else: 49 | for e in engine_list: 50 | if e.__class__.__name__.lower() in engine: self.search(e) 51 | 52 | def tester(self, email): 53 | return MailTester(email).search() 54 | 55 | def main(self): 56 | if len(sys.argv) <= 2: Banner().usage(True) 57 | try: 58 | opts, args = getopt.getopt(sys.argv[1:], 'd:s:i:v:r:hb', 59 | ['domain=', 'source=', 'info=', 'breach', 'verbose=', 'help', 'report=']) 60 | except Exception as e: 61 | Banner().usage(True) 62 | Banner().banner() 63 | for o, a in opts: 64 | if o in ('-d', '--domain'): self.domain = checkTarget(a) 65 | if o in ('-v', '--verbose'): self.verbose = checkVerbose(a) 66 | if o in ('-s', '--source'): self.source = checkSource(a) 67 | if o in ('-b', '--breach'): self.breach = True 68 | if o in ('-r', '--report'): self.report = open(a, 'w') if a != '' else None 69 | if o in ('-i', '--info'): 70 | self.listEmail.append(checkEmail(a)) 71 | plus('Searching for: %s' % a) 72 | if o in ('-h', '--help'): Banner().usage(True) 73 | ### start #### 74 | if self.domain != ('' or None): 75 | if self.source == 'ask': self.engine(self.domain, 'ask') 76 | if self.source == 'all': self.engine(self.domain, 'all') 77 | if self.source == 'google': self.engine(self.domain, 'google') 78 | if self.source == 'baidu': self.engine(self.domain, 'baidu') 79 | if self.source == 'bing': self.engine(self.domain, 'bing') 80 | if self.source == 'dogpile': self.engine(self.domain, 'dogpile') 81 | if self.source == 'exalead': self.engine(self.domain, 'exalead') 82 | if self.source == 'pgp': self.engine(self.domain, 'pgp') 83 | if self.source == 'yahoo': self.engine(self.domain, 'yahoo') 84 | 85 | if self.listEmail == [] or self.listEmail == None: 86 | sys.exit(warn('Not found emails... :(')) 87 | 88 | for email in self.listEmail: 89 | ip = self.tester(email) 90 | if ip != ([] or None): 91 | ips = [] 92 | for i in ip: 93 | if i not in ips: ips.append(i) 94 | if len(ips) >= 2: 95 | info("Found multiple ip for this email...") 96 | PPrint(ips, email, self.verbose, self.breach, self.report).output() 97 | else: 98 | more('Not found any informations for %s' % (email)) 99 | if self.report != None: 100 | info('File saved in: ' + self.report.name) 101 | self.report.close() 102 | # end 103 | 104 | 105 | if __name__ == "__main__": 106 | try: 107 | infoga().main() 108 | except KeyboardInterrupt as e: 109 | sys.exit(warn('Exiting...')) 110 | -------------------------------------------------------------------------------- /lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krishpranav/emailosint/99b142d24fd50f1c265e4b5e77969c1435565740/lib/__init__.py -------------------------------------------------------------------------------- /lib/banner.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # banner file 4 | 5 | # import 6 | from lib.color import * 7 | 8 | class Banner: 9 | def banner(self): 10 | print("_"*40) 11 | print("-==[ Infoga - Email osint ") 12 | print("-==[ Krishpranav ") 13 | print("-==[ %shttps://github.com/krishpranav%s "%(Y%0,E)) 14 | print("_"*40 + "\n") 15 | 16 | def usage(self,_exit_=False): 17 | self.banner() 18 | print("Usage: emailosint.py [OPTIONS]\n") 19 | print("\t-d --domain\tTarget URL/Name") 20 | print("\t-s --source\tSource data, default \"all\":\n") 21 | print("\t\tall\tUse all search engine") 22 | print("\t\tgoogle\tUse google search engine") 23 | print("\t\tbing\tUse bing search engine") 24 | print("\t\tyahoo\tUse yahoo search engine") 25 | print("\t\task\tUse ask search engine") 26 | print("\t\tbaidu\tUse baidu search engine") 27 | print("\t\tdogpile\tUse dogpile search engine") 28 | print("\t\texalead\tUse exalead search engine") 29 | print("\t\tpgp\tUse pgp search engine\n") 30 | print("\t-b --breach\tCheck if email breached") 31 | print("\t-i --info\tGet email informations") 32 | print("\t-r --report\tSimple file text report") 33 | print("\t-v --verbose\tVerbosity level (1,2 or 3)") 34 | print("\t-H --help\tShow this help and exit\n") 35 | print("Example:") 36 | print("\temailosint.py --domain site.gov -v 3") 37 | print("\temailosint.py --info admin@site.gov -v 3") 38 | print("\temailosint.py --domain site.gov --source pgp --breach -v 1") 39 | print("\temailosint.py --domain site.gov --source google --breach --report site_gov.txt -v 3\n") 40 | if _exit_: exit(0) -------------------------------------------------------------------------------- /lib/check.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # imports 5 | 6 | from lib.output import * 7 | try: 8 | from urllib.parse import urlparse 9 | except ImportError as e: 10 | from urlparse import urlparse 11 | 12 | def checkTarget(target): 13 | o = urlparse(target) 14 | if o.netloc == "": 15 | if "www." in o.path: return o.path.split('www.')[1] 16 | return o.path 17 | elif o.netloc != "": 18 | if "www." in o.netloc: return o.netloc.split("www.")[1] 19 | return o.netloc 20 | else: return target 21 | 22 | def checkEmail(email): 23 | if '@' not in email: 24 | exit(warn('Invalid email %s'%email)) 25 | return email 26 | 27 | def checkSource(source): 28 | list_source = ['all','ask','baidu','google','bing', 29 | 'dogpile','exalead','jigsaw','pgp','yahoo' 30 | ] 31 | if source not in list_source: 32 | exit(warn('Invalid search engine: %s'%source)) 33 | return source 34 | 35 | def checkVerbose(ver): 36 | verb = int(ver) 37 | if verb == 0: return 1 38 | elif verb == 1: return 1 39 | elif verb == 2: return 2 40 | else: return 3 41 | -------------------------------------------------------------------------------- /lib/color.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | # color file this file contains all the color for the whole tool 4 | 5 | # imports 6 | import sys 7 | import colorama 8 | 9 | if sys.platform == 'win32': 10 | colorama.init() 11 | 12 | # colors 13 | R = "\033[%s;31m" 14 | B = "\033[%s;34m" 15 | G = "\033[%s;32m" 16 | W = "\033[%s;38m" 17 | Y = "\033[%s;33m" 18 | E = "\033[0m" 19 | 20 | -------------------------------------------------------------------------------- /lib/output.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # imports 5 | import sys 6 | import json 7 | from lib.color import * 8 | from recon.pwned import * 9 | from recon.shodan import * 10 | 11 | 12 | def plus(string): print("%s[+]%s %s" % (G % 0, E, string)) 13 | 14 | 15 | def warn(string): print("%s[!]%s %s" % (R % 0, E, string)) 16 | 17 | 18 | def test(string): print("%s[*]%s %s" % (B % 0, E, string)) 19 | 20 | 21 | def info(string): print("%s[i]%s %s" % (Y % 0, E, string)) 22 | 23 | 24 | def more(string): print(" %s|%s %s" % (W % 0, E, string)) 25 | 26 | 27 | class PPrint(object): 28 | '''PPrint class''' 29 | 30 | def __init__(self, ips, email, ver, pwned=False, report=None): 31 | self.ips = ips 32 | self.s_data = None 33 | self.email = email 34 | self.verbose = ver 35 | self.spaces = lambda x: ' ' * x 36 | self.separator = lambda x: '-' * x 37 | self.pwned = pwned 38 | self.file = None 39 | if report != None: 40 | self.file = report 41 | 42 | def output(self): 43 | data = None 44 | # if verbose 1 45 | if self.verbose == 1: 46 | email = 'Email: %s (%s)' % (self.email, ', '.join([x for x in self.ips])) 47 | plus(email) 48 | if self.file != None: 49 | self.file.write('[+] ' + email + '\n') 50 | if self.pwned: 51 | data = Pwned(self.email).search() 52 | if data is None: 53 | print('%s>> This email wasn\'t leaked' % self.spaces(1)) 54 | if self.file != None: 55 | self.file.write('%s>> This email wasn\'t leaked\n' % self.spaces(1)) 56 | elif data.has_key('Breaches'): 57 | if data.get('Breaches') is None and data.has_key('Breaches'): 58 | data.pop('Breaches') 59 | data['Breaches'] = data.pop('Pastes') 60 | headers = '%s>> This email was leaked... found %s results' % (self.spaces(1), len(data['Breaches'])) 61 | if self.file != None: 62 | self.file.write(headers + '\n') 63 | print(headers) 64 | if self.file != None: 65 | self.file.writelines(self.separator(30) + '\n') 66 | # if verbose 2 67 | elif self.verbose == 2: 68 | email = 'Email: %s (%s)' % (self.email, ', '.join([x for x in self.ips])) 69 | plus(email) 70 | if self.file != None: 71 | self.file.write('[+] ' + email + '\n') 72 | if self.ips != []: 73 | data = json.loads(Shodan(self.ips[0]).search()) 74 | if data == {}: 75 | data = None 76 | if data != None: 77 | headers = '' 78 | if data.has_key('hostnames'): 79 | headers += '%s- Hostname: %s\n' % (self.spaces(1), data.get('hostnames')[0]) 80 | if data.has_key('country_code') and data.has_key('country_name'): 81 | headers += '%s- Country: %s (%s)\n' % ( 82 | self.spaces(1), data.get('country_code'), data.get('country_name')) 83 | if data.has_key('city') and data.has_key('region_code'): 84 | headers += '%s- City: %s (%s)' % (self.spaces(1), data.get('city'), data.get('region_code')) 85 | if self.file != None: 86 | self.file.write(headers + '\n') 87 | print(headers) 88 | else: 89 | info('Not found information (on shodan) for this email, search this ip/ips on internet..') 90 | if self.file != None: 91 | self.file.write( 92 | '%s- Not found information (on shodan) for this email, search this ip/ips on internet..') 93 | if self.pwned: 94 | headers = '' 95 | data = Pwned(self.email).search() 96 | if data is None: 97 | print('%s>> This email wasn\'t leaked' % self.spaces(1)) 98 | if self.file != None: 99 | self.file.write('%s>> This email wasn\'t leaked\n' % (self.spaces(1))) 100 | headers += '%s\n' % self.separator(30) 101 | elif data.has_key('Breaches'): 102 | if data.get('Breaches') is None and data.has_key('Breaches'): 103 | data.pop('Breaches') 104 | data['Breaches'] = data.pop('Pastes') 105 | headers = '%s>> This email was leaked... found %s results...\n' % ( 106 | self.spaces(1), len(data['Breaches'])) 107 | for i in range(0, len(data['Breaches'])): 108 | if data['Breaches'][i].has_key('Title'): 109 | headers += '%s> Leaked in: %s\n' % (self.spaces(2), data['Breaches'][i].get('Title')) 110 | if data['Breaches'][i].has_key('BreachDate'): 111 | headers += '%s> Data Leaked: %s\n' % (self.spaces(2), data['Breaches'][i].get('BreachDate')) 112 | if data['Breaches'][i].has_key('IsVerified'): 113 | headers += '%s> Verified: %s\n' % (self.spaces(2), data['Breaches'][i].get('IsVerified')) 114 | headers += '%s%s\n' % (self.spaces(2), self.separator(30)) 115 | if self.file != None: 116 | self.file.write(headers.encode('utf-8')) 117 | print(headers.encode('utf-8')) 118 | # if verbose 3 119 | elif self.verbose == 3: 120 | email = 'Email: %s (%s)' % (self.email, ', '.join([x for x in self.ips])) 121 | plus(email) 122 | if self.file != None: 123 | self.file.write('[+] ' + email + '\n') 124 | if self.ips != []: 125 | data = json.loads(Shodan(self.ips[0]).search()) 126 | if data == {}: 127 | data = None 128 | if data != None: 129 | headers = '' 130 | print(data.has_key('hostnames')) 131 | exit() 132 | if data.has_key('hostnames'): 133 | headers += '%s- Hostname: %s\n' % (self.spaces(1), data.get('hostnames')[0]) 134 | if data.has_key('country_code') and data.has_key('country_name'): 135 | headers += '%s- Country: %s (%s)\n' % ( 136 | self.spaces(1), data.get('country_code'), data.get('country_name')) 137 | if data.has_key('city') and data.has_key('region_code'): 138 | headers += '%s- City: %s (%s)\n' % (self.spaces(1), data.get('city'), data.get('region_code')) 139 | if data.has_key('asn'): 140 | headers += '%s- ASN: %s\n' % (self.spaces(1), data.get('asn')) 141 | if data.has_key('isp'): 142 | headers += '%s- ISP: %s\n' % (self.spaces(1), data.get('isp')) 143 | if data.has_key('latitude') and data.has_key('longitude'): 144 | headers += '%s- Map: https://www.google.com/maps/@%s,%s,10z (%s,%s)\n' % ( 145 | self.spaces(1), data.get('latitude'), data.get('longitude'), 146 | data.get('latitude'), data.get('longitude') 147 | ) 148 | if data.has_key('org'): 149 | headers += '%s- Organization: %s\n' % (self.spaces(1), data.get('org')) 150 | if data.has_key('ports'): 151 | headers += '%s- Ports: %s' % (self.spaces(1), ', '.join([str(x) for x in data.get('ports')])) 152 | 153 | if headers != '': 154 | if self.file != None: 155 | self.file.write(headers) 156 | print(headers) 157 | else: 158 | info('Not found information (on shodan) for this email, search this ip/ips on internet..') 159 | if self.file != None: 160 | self.file.write( 161 | '%s- Not found information (on shodan) for this email, search this ip/ips on internet..') 162 | if self.pwned: 163 | headers = '' 164 | data = Pwned(self.email).search() 165 | if data is None: 166 | print('%s>> This email wasn\'t leaked' % self.spaces(1)) 167 | if self.file != None: 168 | self.file.write('%s>> This email wasn\'t leaked\n' % (self.spaces(1))) 169 | elif data.has_key('Breaches'): 170 | if data.get('Breaches') is None and data.has_key('Breaches'): 171 | data.pop('Breaches') 172 | data['Breaches'] = data.pop('Pastes') 173 | headers = '%s>> This email was leaked... found %s results...\n' % ( 174 | self.spaces(1), len(data['Breaches'])) 175 | for i in range(0, len(data['Breaches'])): 176 | if data['Breaches'][i].has_key('Title'): 177 | headers += '%s> Leaked in: %s\n' % (self.spaces(2), data['Breaches'][i].get('Title')) 178 | if data['Breaches'][i].has_key('BreachDate'): 179 | headers += '%s> Data Leaked: %s\n' % (self.spaces(2), data['Breaches'][i].get('BreachDate')) 180 | if data['Breaches'][i].has_key('IsVerified'): 181 | headers += '%s> Verified: %s\n' % (self.spaces(2), data['Breaches'][i].get('IsVerified')) 182 | if data['Breaches'][i].has_key('Description'): 183 | headers += '%s> Description: %s\n' % ( 184 | self.spaces(2), data['Breaches'][i].get('Description')) 185 | headers += '%s%s\n' % (self.spaces(2), self.separator(30)) 186 | 187 | if self.file != None: 188 | self.file.write('\n' + headers.encode('utf-8')) 189 | print(headers.encode('utf-8')) -------------------------------------------------------------------------------- /lib/parser.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # import 5 | import re 6 | 7 | class parser: 8 | def __init__(self,content,target): 9 | self.target = target 10 | self.content = str(content) 11 | 12 | def email(self): 13 | tmp_email = re.findall(r'[a-zA-Z0-9.\-_+#~!$&\',;=:]+' 14 | +'@'+r'[a-zA-Z0-9.-]*'+self.target,self.clean) 15 | email_list = [] 16 | for _ in tmp_email: 17 | if _ not in email_list and _.split('@')[0] not in ('"',"'"): 18 | email_list.append(_) 19 | return email_list 20 | 21 | @property 22 | def clean(self): 23 | self.content = re.sub('','',self.content) 24 | self.content = re.sub('','',self.content) 25 | self.content = re.sub('','',self.content) 26 | self.content = re.sub('','',self.content) 27 | self.content = re.sub('','',self.content) 28 | self.content = re.sub('','',self.content) 29 | self.content = re.sub('','',self.content) 30 | self.content = re.sub('','',self.content) 31 | for x in ('>', ':', '=', '<', '/', '\\', ';', '&', '%3A', '%3D', '%3C'): 32 | self.content = self.content.replace(x,' ') 33 | return self.content 34 | -------------------------------------------------------------------------------- /lib/request.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # imports 5 | import urllib3 6 | import requests 7 | from lib.output import * 8 | 9 | class Request(object): 10 | agent = '' 11 | def send(self,method,url,params=None,data=None,headers=None): 12 | if headers is None: headers={} 13 | headers['User-Agent'] = Request.agent 14 | try: 15 | session = requests.Session() 16 | req = urllib3.disable_warnings( 17 | urllib3.exceptions.InsecureRequestWarning 18 | ) 19 | req = requests.request( 20 | method = method.upper(), 21 | url = url, 22 | params = params, 23 | data = data, 24 | allow_redirects = True, 25 | verify = False ) 26 | return req 27 | except Exception as e: 28 | exit(warn('Failed to establish a new connection')) -------------------------------------------------------------------------------- /recon/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krishpranav/emailosint/99b142d24fd50f1c265e4b5e77969c1435565740/recon/__init__.py -------------------------------------------------------------------------------- /recon/ask.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # imports 5 | 6 | from lib.output import * 7 | from lib.request import * 8 | from lib.parser import * 9 | 10 | class Ask(Request): 11 | def __init__(self, target): 12 | Request.__init__(self) 13 | self.target = target 14 | 15 | def search(self): 16 | test('Searching %s in Ask...'%(self.target)) 17 | url = "http://www.ask.com/web?q=%40{target}&pu=100&page=0".format( 18 | target=self.target) 19 | try: 20 | resp = self.send( 21 | method = 'GET', 22 | url = url 23 | ) 24 | return self.getemail(resp.content, self.target) 25 | except Exception as e: 26 | print(e) 27 | 28 | def getemail(self, content, target): 29 | return parser(content, target).email() -------------------------------------------------------------------------------- /recon/baidu.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # -*- coding: utf-8 -*- 3 | 4 | # imports 5 | from lib.output import * 6 | from lib.request import * 7 | from lib.parser import * 8 | 9 | class Baidu(Request): 10 | def __init__(self,target): 11 | Request.__init__(self) 12 | self.target = target 13 | 14 | def search(self): 15 | test('Searching "%s" in Baidu...'%(self.target)) 16 | url = "http://www.baidu.com/s?wd=%40{target}&pn=0".format( 17 | target=self.target) 18 | try: 19 | resp = self.send( 20 | method = 'GET', 21 | url = url, 22 | headers = { 23 | 'Host':'www.baidu.com' 24 | } 25 | ) 26 | return self.getemail(resp.content,self.target) 27 | except Exception as e: 28 | pass 29 | 30 | def getemail(self,content,target): 31 | return parser(content,target).email() -------------------------------------------------------------------------------- /recon/bing.py: -------------------------------------------------------------------------------- 1 | from lib.output import * 2 | from lib.request import * 3 | from lib.parser import * 4 | 5 | class Bing(Request): 6 | def __init__(self,target): 7 | Request.__init__(self) 8 | self.target = target 9 | 10 | def search(self): 11 | test('Searching "%s" in Bing...'%(self.target)) 12 | url = "http://bing.com/search?q=%40{target}".format( 13 | target=self.target) 14 | try: 15 | resp = self.send( 16 | method = 'GET', 17 | url = url, 18 | headers = { 19 | 'Cookie':'SRCHHPGUSR=ADLT=DEMOTE&NRSLT=100' 20 | } 21 | ) 22 | return self.getemail(resp.content,self.target) 23 | except Exception as e: 24 | pass 25 | 26 | def getemail(self,content,target): 27 | return parser(content,target).email() -------------------------------------------------------------------------------- /recon/dogpile.py: -------------------------------------------------------------------------------- 1 | from lib.output import * 2 | from lib.request import * 3 | from lib.parser import * 4 | 5 | class Dogpile(Request): 6 | def __init__(self,target): 7 | Request.__init__(self) 8 | self.target = target 9 | 10 | def search(self): 11 | test('Searching "%s" in DogPile...'%(self.target)) 12 | url = "http://www.dogpile.com/search/web?qsi=0&q=%40{target}".format( 13 | target=self.target) 14 | try: 15 | resp = self.send( 16 | method = 'GET', 17 | url = url, 18 | headers = { 19 | 'Host':'www.dogpile.com' 20 | } 21 | ) 22 | return self.getemail(resp.content,self.target) 23 | except Exception as e: 24 | pass 25 | 26 | def getemail(self,content,target): 27 | return parser(content,target).email() -------------------------------------------------------------------------------- /recon/exalead.py: -------------------------------------------------------------------------------- 1 | from lib.output import * 2 | from lib.request import * 3 | from lib.parser import * 4 | 5 | class Exalead(Request): 6 | def __init__(self,target): 7 | Request.__init__(self) 8 | self.target = target 9 | 10 | def search(self): 11 | test('Searching "%s" in Exalead...'%(self.target)) 12 | url = "http://www.exalead.com/search/web/results/?q=%40{target}&elements_per_page=50&start_index=0".format( 13 | target=self.target) 14 | try: 15 | resp = self.send( 16 | method = 'GET', 17 | url = url, 18 | headers = { 19 | 'Host':'www.exalead.com', 20 | 'Referer':'http://exalead.com/search/web/results/?q=%40{target}'.format( 21 | target=self.target) 22 | } 23 | ) 24 | return self.getemail(resp.content,self.target) 25 | except Exception as e: 26 | pass 27 | 28 | def getemail(self,content,target): 29 | return parser(content,target).email() -------------------------------------------------------------------------------- /recon/google.py: -------------------------------------------------------------------------------- 1 | from lib.output import * 2 | from lib.request import * 3 | from lib.parser import * 4 | 5 | class Google(Request): 6 | def __init__(self,target): 7 | Request.__init__(self) 8 | self.target = target 9 | 10 | def search(self): 11 | test('Searching "%s" in Google...'%(self.target)) 12 | base_url = 'https://www.google.com/search?q=intext:%22%40{target}%22&num=50'.format( 13 | target=self.target) 14 | mails = [] 15 | # First 350 results (page 0 to 6) 16 | for page in range(0, 7): 17 | url = base_url + "&start=" + str(page) 18 | try: 19 | resp = self.send( 20 | method = 'GET', 21 | url = url 22 | ) 23 | if "detected unusual traffic" in resp.text: 24 | break 25 | for email in self.getemail(resp.content,self.target): 26 | if email not in mails: 27 | mails.append(email) 28 | except: 29 | pass 30 | return mails 31 | 32 | def getemail(self,content,target): 33 | return parser(content,target).email() 34 | -------------------------------------------------------------------------------- /recon/mailtester.py: -------------------------------------------------------------------------------- 1 | from lib.output import * 2 | from lib.request import * 3 | from lib.parser import * 4 | 5 | class MailTester(Request): 6 | def __init__(self,email): 7 | Request.__init__(self) 8 | self.email = email 9 | 10 | def search(self): 11 | post_data = {'lang':'en'} 12 | post_data['email'] = self.email 13 | url = "http://mailtester.com/testmail.php" 14 | try: 15 | resp = self.send( 16 | method = 'POST', 17 | url = url, 18 | data = post_data 19 | ) 20 | return self.getip(resp.content) 21 | except Exception as e: 22 | print(e) 23 | 24 | def getip(self,content): 25 | tmp_ip = re.findall(r'[0-9]+(?:\.[0-9]+){3}',str(content),re.I) 26 | list_ip = [] 27 | for ip in tmp_ip: 28 | if ip not in list_ip: 29 | list_ip.append(ip) 30 | return list_ip -------------------------------------------------------------------------------- /recon/pgp.py: -------------------------------------------------------------------------------- 1 | from lib.output import * 2 | from lib.request import * 3 | from lib.parser import * 4 | 5 | class PGP(Request): 6 | def __init__(self,target): 7 | Request.__init__(self) 8 | self.target = target 9 | 10 | def search(self): 11 | test('Searching "%s" in PGP...'%(self.target)) 12 | url = "http://pgp.mit.edu/pks/lookup?search={target}&op=index".format( 13 | target=self.target) 14 | try: 15 | resp = self.send( 16 | method = 'GET', 17 | url = url, 18 | headers = { 19 | 'Host':'pgp.mit.edu' 20 | } 21 | ) 22 | return self.getemail(resp.content,self.target) 23 | except Exception as e: 24 | pass 25 | 26 | def getemail(self,content,target): 27 | return parser(content,target).email() -------------------------------------------------------------------------------- /recon/pwned.py: -------------------------------------------------------------------------------- 1 | from json import loads 2 | from lib.output import * 3 | from lib.request import * 4 | from lib.parser import * 5 | 6 | class Pwned(Request): 7 | def __init__(self,email): 8 | Request.__init__(self) 9 | self.email = email 10 | 11 | def search(self): 12 | url = "https://api.haveibeenpwned.com/unifiedsearch/{email}".format( 13 | email=self.email.replace('@','%40')) 14 | try: 15 | resp = self.send( 16 | method = 'GET', 17 | url = url 18 | ) 19 | if resp.status_code == 200: 20 | return loads(resp.content) 21 | return None 22 | except Exception as e: 23 | pass -------------------------------------------------------------------------------- /recon/shodan.py: -------------------------------------------------------------------------------- 1 | from lib.output import * 2 | from lib.request import * 3 | from lib.parser import * 4 | 5 | class Shodan(Request): 6 | def __init__(self,ip): 7 | Request.__init__(self) 8 | self.ip = ip 9 | 10 | def search(self): 11 | url = "https://api.shodan.io/shodan/host/{target}?key=UNmOjxeFS2mPA3kmzm1sZwC0XjaTTksy".format( 12 | target=self.ip) 13 | try: 14 | resp = self.send( 15 | method = 'GET', 16 | url = url 17 | ) 18 | if resp.status_code != 200: return b'{}' 19 | return resp.content 20 | except Exception as e: 21 | pass 22 | -------------------------------------------------------------------------------- /recon/yahoo.py: -------------------------------------------------------------------------------- 1 | from lib.output import * 2 | from lib.request import * 3 | from lib.parser import * 4 | 5 | class Yahoo(Request): 6 | def __init__(self,target): 7 | Request.__init__(self) 8 | self.target = target 9 | 10 | def search(self): 11 | test('Searching "%s" in Yahoo...'%(self.target)) 12 | url = "http://search.yahoo.com/search?p=%40{target}&b=0&pz=10".format( 13 | target=self.target) 14 | try: 15 | resp = self.send( 16 | method = 'GET', 17 | url = url, 18 | headers = { 19 | 'Host':'search.yahoo.com' 20 | } 21 | ) 22 | return self.getemail(resp.content,self.target) 23 | except Exception as e: 24 | pass 25 | 26 | def getemail(self,content,target): 27 | return parser(content,target).email() -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | colorama 2 | requests 3 | urllib3 4 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup( 4 | name='emailosint', 5 | 6 | version='1.0.0', 7 | description='Email OSINT', 8 | url='https://github.com/krishpranav', 9 | 10 | author = 'krishpranav', 11 | author_email='', 12 | license='GPLv3', 13 | 14 | install_requires = ['colorama','requests','urllib3'], 15 | console =['emailosint.py'], 16 | ) 17 | --------------------------------------------------------------------------------