Advertisement
Guest User

Untitled

a guest
Oct 18th, 2014
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.61 KB | None | 0 0
  1. import re
  2. from grab import Grab
  3.  
  4. config = {'start': 1, 'end': 100}
  5. 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']
  6.  
  7. def check_mail(email):
  8.     g = Grab()
  9.     g.setup(post={'email': email, 'send': 'val'})
  10.     g.go('http://waplog.net/ru/html/forgot.shtml')
  11.  
  12.     res_email = g.doc.select('/html/body/table[3]/tr/td/table/tr/td/table/tr[2]/td/span')
  13.  
  14.     return res_email.text() == email if res_email.exists() else False
  15.  
  16. def get_urls(start, end):
  17.     g = Grab()
  18.  
  19.     urls = []
  20.     for i in range(start, end+1, 3):
  21.         g.go('http://waplog.net/ru/xhtml/stat/{}/'.format(i))
  22.         doc = g.doc.select('/html/body/div[2]/a')
  23.  
  24.         if doc.exists():
  25.             url = doc.text()
  26.             test = re.findall(r'([A-z0-9_-]+\.[A-z]{2,5})', url)
  27.             if url and not url in urls and test.count(url):
  28.                 urls.append(url)
  29.     return urls
  30.  
  31. def check_domain(url):
  32.     try:
  33.         g = Grab()
  34.         g.go('http://www.1whois.ru/?url={}'.format(url))
  35.  
  36.         expires = g.doc.select('/html/body/table/tr/td[2]/ul/table[1]/tr/td/font/b[3]')
  37.         if not expires.exists():
  38.             for name in email_names:
  39.                 email = '{}@{}'.format(name, url)
  40.                 if check_mail(email):
  41.                     print '{};{}'.format(url, email)
  42.     except BaseException:
  43.         pass
  44.  
  45. if __name__ == '__main__':
  46.     for url in get_urls(config['start'], config['end']):
  47.         check_domain(url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement