Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 45 lines (41 sloc) 1.83 KB
# -*- coding: utf-8 -*-
from lib import logger
import requests,random,string
from requests.packages.urllib3.exceptions import InsecureRequestWarning
user_agent = 'Microsoft Office/16.0 (Windows NT 10.0; Microsoft Outlook 16.0.12026; Pro)'
headers = {'User-Agent': user_agent, 'Accept': 'application/json'}
def validate(email):
r = requests.get('{}?Protocol=Autodiscoverv1'.format(email), headers=headers, verify=False, allow_redirects=False)
if r.status_code == 200:'Verified: %s' % logger.GREEN(email))
return True
elif r.status_code == 302:
if '' not in r.text:'Verified: %s' % logger.GREEN(email))
return True
logger.verbose('Failed: %s' % logger.RED(email))
return False
except KeyboardInterrupt:
logger.yellow('Keyboard interrupt detected!')
def verify_o365(domain):
logger.yellow('Attempting to verify if %s is using Office365' % logger.YELLOW(domain))
domain_is_o365 = {}
junk_user = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(20))
r = requests.get('{}@{}?Protocol=Autodiscoverv1'.format(junk_user, domain), headers=headers, verify=False, allow_redirects=False)
if '' in r.text:'It looks like %s is using %s!' % (logger.GREEN(domain),logger.GREEN('Office365')))
domain_is_o365[domain] = True
else:'It doesnt look like %s is using %s' % (logger.RED(domain),logger.RED('Office365')))
domain_is_o365[domain] = False
return domain_is_o365
except Exception as e:
domain_is_o365[domain] = False
return domain_is_o365
You can’t perform that action at this time.