Guest User

Invite BruteForce

a guest
Aug 30th, 2015
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.20 KB | None | 0 0
  1. import string
  2. import random
  3. import urllib
  4. import urllib2
  5. import time
  6. import re
  7. import smtplib
  8.  
  9. index = 0
  10. server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
  11.  
  12. class bcolors:
  13.     HEADER = '\033[95m'
  14.     OKBLUE = '\033[94m'
  15.     OKGREEN = '\033[92m'
  16.     WARNING = '\033[93m'
  17.     FAIL = '\033[91m'
  18.     ENDC = '\033[0m'
  19.     BOLD = '\033[1m'
  20.     UNDERLINE = '\033[4m'
  21.  
  22. def id_generator(size, chars=string.ascii_uppercase + string.digits):
  23.         return ''.join(random.choice(chars) for _ in range(size))
  24.  
  25. def mail(Code):
  26.     server.login("<gmail1>", "<password>")
  27.     #Send the mail
  28.     msg = ("\n OnePlus Bot found a invite! https://invites.oneplus.net/claim/{}".format(Code));
  29.     server.sendmail("<gmail1>", "<gmail2>", msg)
  30.     server.quit()
  31.     print("Mail sent!")
  32.  
  33.  
  34.  
  35.  
  36. while True:
  37.     index += 1     
  38.     s = "-";
  39.     seq = (id_generator(2),id_generator(4),id_generator(4),id_generator(4));       
  40.     Raw = s.join(seq);
  41.     Code1 = ("GL" + Raw)
  42.     Code2 = ("IN" + Raw)
  43.     requestUrl1 = "https://invites.oneplus.net/claim/{0}".format(Code1)
  44.     requestUrl2 = "https://invites.oneplus.net/claim/{0}".format(Code2)
  45.     print(bcolors.OKBLUE + "Attempt {}" .format(index) + bcolors.ENDC)
  46.     print("Url1: https://invites.oneplus.net/claim/" + Code1)
  47.     req1 = urllib2.Request(requestUrl1)
  48.     res1 = urllib2.urlopen(req1)
  49.     website1 = res1.read()
  50.     pattern = ">You entered an invalid invite</p>"
  51.     m1 = re.search(pattern, website1)
  52.     if m1:
  53.         print(bcolors.FAIL + "Invalid Invite!" + bcolors.ENDC)
  54.     else:
  55.         print(bcolors.OKGREEN + "Invite found!" + bcolors.ENDC)
  56.        
  57.         with open("log.txt", "a") as text_file:
  58.             text_file.write("Invite found! | https://invites.oneplus.net/claim/{}".format(Code1))
  59.             text_file.write("\n")
  60.        
  61.         mail(Code1)
  62.    
  63.     print("Url2: https://invites.oneplus.net/claim/" + Code2)
  64.     req2 = urllib2.Request(requestUrl2)
  65.     res2 = urllib2.urlopen(req2)
  66.     website2 = res2.read()
  67.     m2 = re.search(pattern, website2)
  68.     if m2:
  69.         print(bcolors.FAIL + "Invalid Invite!" + bcolors.ENDC)
  70.     else:
  71.         print(bcolors.OKGREEN + "Invite found!" + bcolors.ENDC)
  72.        
  73.         with open("log.txt", "a") as text_file:
  74.             text_file.write("Invite found! | https://invites.oneplus.net/claim/{}".format(Code2))
  75.             text_file.write("\n")
  76.        
  77.         mail(Code2)
  78.     time.sleep(2)
Advertisement
Add Comment
Please, Sign In to add comment