Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- from grab import Grab
- config = {'start': 1, 'end': 100}
- email_names = ['admin', 'adm', 'mail', 'email', 'info', 'support', 'contact', 'pochta', 'robot', 'bot', 'abuse', 'webmail', 'webmaster', 'wap', 'waplog', 'no-reply', 'noreply', 'box', 'i', 'ya', 'iam', 'me']
- def check_mail(email):
- g = Grab()
- g.setup(post={'email': email, 'send': 'val'})
- g.go('http://waplog.net/ru/html/forgot.shtml')
- res_email = g.doc.select('/html/body/table[3]/tr/td/table/tr/td/table/tr[2]/td/span')
- return res_email.text() == email if res_email.exists() else False
- def get_urls(start, end):
- g = Grab()
- urls = []
- for i in range(start, end+1, 3):
- g.go('http://waplog.net/ru/xhtml/stat/{}/'.format(i))
- doc = g.doc.select('/html/body/div[2]/a')
- if doc.exists():
- url = doc.text()
- test = re.findall(r'([A-z0-9_-]+\.[A-z]{2,5})', url)
- if url and not url in urls and test.count(url):
- urls.append(url)
- return urls
- def check_domain(url):
- try:
- g = Grab()
- g.go('http://www.1whois.ru/?url={}'.format(url))
- expires = g.doc.select('/html/body/table/tr/td[2]/ul/table[1]/tr/td/font/b[3]')
- if not expires.exists():
- for name in email_names:
- email = '{}@{}'.format(name, url)
- if check_mail(email):
- print '{};{}'.format(url, email)
- except BaseException:
- pass
- if __name__ == '__main__':
- for url in get_urls(config['start'], config['end']):
- check_domain(url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement