Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. <?php
  2. /*
  3. -READ ME-
  4. Modify `login_user`, `file_name_rs`, and 'file_name_token' to what you will use.
  5. * The script will automatically create a .txt file of `file_name_rs`, which will store the user's ROBLOSECURITY.
  6. ** This is to avoid continuously logging in, which will activate CAPTCHA protection and break the script.
  7. ** And also to increase performance by not obtaining ROBLOSECURITY again when it's still usable.
  8. * The script will automatically create a .txt file of `file_name_token`, which will store the user's TOKEN.
  9. ** To increase performance by not obtaining TOKEN again when it's still usable.
  10. */
  11. $login_user = 'username=QuantasAirlines_Rank&password=reecey27';
  12. $file_name_rs = 'rs.txt';
  13. $file_name_token = 'token.txt';
  14. $stored_rs = (file_exists($file_name_rs) ? file_get_contents($file_name_rs) : '');
  15. $stored_token = (file_exists($file_name_token) ? file_get_contents($file_name_token) : '');
  16. $group_id = $_GET['463691'];
  17. $new_role_set_id = $_GET['3729404'];
  18. $target_user_id = $_GET['2699690'];
  19. // --------------------------------------
  20. function getRS() {
  21. global $login_user, $file_name_rs;
  22. $get_cookies = curl_init('https://www.roblox.com/newlogin');
  23. curl_setopt_array($get_cookies,
  24. array(
  25. CURLOPT_RETURNTRANSFER => true,
  26. CURLOPT_HEADER => true,
  27. CURLOPT_POST => true,
  28. CURLOPT_POSTFIELDS => $login_user
  29. )
  30. );
  31. $rs = (preg_match('/(\.ROBLOSECURITY=.*?);/', curl_exec($get_cookies), $matches) ? $matches[1] : '');
  32. file_put_contents($file_name_rs, $rs, true);
  33. curl_close($get_cookies);
  34. return $rs;
  35. }
  36. function changeRank($rs, $token) {
  37. global $stored_rs, $stored_token, $group_id, $new_role_set_id, $target_user_id, $file_name_token;
  38.  
  39. $promote_user = curl_init("http://www.roblox.com/groups/api/change-member-rank?groupId=$group_id&newRoleSetId=$new_role_set_id&targetUserId=$target_user_id");
  40. curl_setopt_array($promote_user,
  41. array(
  42. CURLOPT_RETURNTRANSFER => true,
  43. CURLOPT_POST => true,
  44. CURLOPT_HEADER => true,
  45. CURLOPT_HTTPHEADER => array("Cookie: $rs", "X-CSRF-TOKEN: $token")
  46. )
  47. );
  48. $response = curl_exec($promote_user);
  49. $response_code = curl_getinfo($promote_user, CURLINFO_HTTP_CODE);
  50. $header_size = curl_getinfo($promote_user, CURLINFO_HEADER_SIZE);
  51. $header = substr($response, 0, $header_size);
  52. $body = substr($response, $header_size);
  53. if (preg_match('/GuestData/', $header)) {
  54. $body = changeRank(getRS(), '');
  55. } else if ($response_code == 403) {
  56. $new_token = (preg_match('/X-CSRF-TOKEN: (\S+)/', $header, $matches) ? $matches[1] : '');
  57. file_put_contents($file_name_token, $new_token, true);
  58. $body = changeRank($rs, $new_token);
  59. }
  60. curl_close($promote_user);
  61. return $body;
  62. }
  63. // --------------------------------------
  64. echo changeRank($stored_rs, $stored_token);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement