From a9b6ceb0dd10ebca90477a572ebb1b2c10e3ade6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87algan=20Ayg=C3=BCn?= Date: Thu, 26 Nov 2020 23:11:04 +0300 Subject: [PATCH] Update Hunter method Code cleaned, commonMail list added --- insides/commonMails.py | 1 + modules/Hunter.py | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 insides/commonMails.py diff --git a/insides/commonMails.py b/insides/commonMails.py new file mode 100644 index 0000000..2220fc9 --- /dev/null +++ b/insides/commonMails.py @@ -0,0 +1 @@ +commonMails = ["yahoo.com","qq.com","virginmedia.com","msn.com","live.com","go.com","aol.com","163.com","free.fr","about.com","alibaba.com","geocities.com","outlook.com","indiatimes.com","yandex.ru","netscape.com","yahoo.co.jp","angelfire.com","earthlink.net","sky.com","mail.ru","discovery.com","gmail.com","frontier.com","naver.com","uol.com.br","homestead.com","icloud.com","medscape.com","mac.com","zoho.com","space.com","lycos.com","icq.com","comcast.net","altavista.com","orange.fr","t-online.de","hotmail.com","me.com","sapo.pt","rambler.ru","att.net","cox.net","canada.com","yandex.com","ancestry.com","sina.cn","kansascity.com","sina.com","libero.it","law.com","care2.com","wanadoo.fr","tom.com","fortunecity.com","berlin.de","onet.pl","21cn.com","excite.com","terra.com.br","geek.com","india.com","techspot.com","compuserve.com","shaw.ca","blackplanet.com","mindspring.com","web.de","freeserve.co.uk","ntlworld.com","rr.com","ig.com.br","wp.pl","sympatico.ca","excite.co.jp","chez.com","interia.pl","kiwibox.com","virgilio.it","tiscali.it","arcor.de","iinet.net.au","blueyonder.co.uk","xoom.com","126.com","rcn.com","sfr.fr","freenet.de","gazeta.pl","online.de","yam.com","verizon.net","gmx.net","btinternet.com","hotbot.com","lycos.co.uk","ozemail.com.au","aol.co.uk","detik.com","virgin.net","ireland.com","terra.es","catholic.org","hamptonroads.com","doityourself.com","parrot.com","charter.net","www.com","lycos.de","ivillage.com","myway.com","albawaba.com","rogers.com","name.com","ya.ru","voila.fr","oath.com","freeyellow.com","mail.com","pochta.ru","centrum.cz","sify.com","tiscali.co.uk","chat.ru","telus.net","mydomain.com","o2.co.uk","alice.it","seznam.cz","freeuk.com","tpg.com.au","iespana.es","optusnet.com.au","rin.ru","lycos.es","sci.fi","metacrawler.com","walla.co.il","yahoo.co.uk","lycos.nl","sweb.cz","looksmart.com","bigpond.com","yeah.net","terra.com","prodigy.net","eircom.net","yahoo.com.cn","frontiernet.net","mail2web.com","wanadoo.es","aim.com","37.com","i.am","dailypioneer.com","sanook.com","foxmail.com","unican.es","docomo.ne.jp","hot.ee","yahoofs.com","newmail.ru","gmx.com","ukr.net","cogeco.ca","crosswinds.net","bugmenot.com","webindia123.com","pacbell.net","iol.it","10minutemail.com","netins.net","depechemode.com","incredimail.com","zip.net","dejanews.com","lycos.it","elvis.com","bangkok.com","iprimus.com.au","juno.com","onmilwaukee.com","o2.pl","supereva.it","netspace.net.au","islamonline.net","starmedia.com","mailinator.com","go.ro","swissinfo.org","saudia.com","spray.se","idirect.com","bigfoot.com","land.ru","casino.com","gmx.de","bellsouth.net","yahoo.fr","yahoo.jp","bigpond.net.au","interfree.it","adelphia.net","thirdage.com","zonnet.nl","msn.co.uk","yahoo.de","btconnect.com","hispavista.com","ny.com","cableone.net","tds.net","gportal.hu","roadrunner.com","inbox.com","hushmail.com","4mg.com","seanet.com","masrawy.com","aeiou.pt","terra.cl","yahoo.com.br","singnet.com.sg","terra.com.ar","front.ru","c3.hu","123.com","sbcglobal.net","netzero.net","yahoo.com.tw","montevideo.com.uy","scubadiving.com","everyone.net","fastmail.fm","maktoob.com","iwon.com","mchsi.com","webjump.com","bright.net","telstra.com","westnet.com.au","c2i.net","talktalk.net","talkcity.com","eyou.com","usa.com","cs.com","btopenworld.com","gocollege.com","hotmail.ru","spacewar.com","sp.nl","excite.it","bolt.com","singpost.com","zzn.com","centrum.sk","go2net.com","yahoo.es","bizhosting.com","yahoo.ca","3ammagazine.com","vnn.vn","optimum.net","fuse.net","windowslive.com","home.ro","windstream.net","korea.com","ptd.net","ados.fr","swbell.net","inbox.lv","freeuk.net","dog.com","barcelona.com","tiscali.be","dnsmadeeasy.com","abv.bg","netscape.net","freeola.com","peoplepc.com","beer.com","onlinehome.de","jokes.com","garbage.com","list.ru","epix.net","nyc.com","pisem.net","centurytel.net","live.cn","gratisweb.com","ymail.com","lavabit.com","bol.com.br","handbag.com","spymac.com","yopmail.com","laposte.net","apollo.lv","fromru.com","gmx.at","rediffmail.com","theglobe.com","qwestoffice.net","centurylink.net","wowway.com","t-online.hu","euroseek.com","ananzi.co.za"] \ No newline at end of file diff --git a/modules/Hunter.py b/modules/Hunter.py index b492368..703795f 100644 --- a/modules/Hunter.py +++ b/modules/Hunter.py @@ -1,23 +1,23 @@ from bs4 import BeautifulSoup -import json, requests +import json +import requests from insides.bcolors import bcolors +from insides.commonMails import commonMails -def Hunter(mail,hunterApi,_verbose=None): + +def Hunter(mail, hunterAPIKey, _verbose=None): if _verbose != None: try: - - dmnlist = ["gmail.com","outlook.com","hotmail.com","yahoo.com","hotmail.co.uk","icloud.com"] - at = "@" - domain = (mail[mail.index(at) + len(at):]) - if (domain in dmnlist): - print(f"{bcolors.FAIL}Unacceptable domain : {bcolors.ENDC}"+domain) + domain = mail.split("@")[1] + if (domain in commonMails): + print(f"{bcolors.FAIL}Unacceptable domain :{bcolors.ENDC} {domain}") else: - print(f"{bcolors.BOLD}Related emails:{bcolors.ENDC}") - u = "https://api.hunter.io/v2/domain-search?domain="+domain+"&api_key="+hunterApi - response = requests.get(u) - html = response.content - lp = json.loads(html) - for i in range(0,99): - print(lp['data']['emails'][i]['value']) + res = requests.get(f"https://api.hunter.io/v2/domain-search?domain={domain}&api_key={hunterAPIKey}").json() + if len(res['data']['emails']): + print(f"{bcolors.BOLD}Related emails:{bcolors.ENDC}") + for i in res['data']['emails'][:100]: + print(i["value"]) + else: + print(f"{bcolors.FAIL}No related mails found!{bcolors.ENDC}") except: - pass + print(f"{bcolors.FAIL}Hunter.io error!{bcolors.ENDC}")