Advertisement
Guest User

Untitled

a guest
Apr 1st, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.20 KB | None | 0 0
  1. <?php
  2. $login_user = 'username=BOTNAME&password=BOTPASSWORD';
  3. $file_path_rs = 'rs.txt';
  4. $file_path_token = 'token.txt';
  5. $current_rs = file_get_contents($file_path_rs);
  6. $current_token = file_get_contents($file_path_token);
  7. $groupid = $_GET['groupId'];
  8. $newRoleSetId = $_GET['newRoleSetId'];
  9. $targetUserId = $_GET['targetUserId'];
  10.  
  11.  
  12.  
  13. // [Function] Get ROBLOSECRUITY
  14. function getRS()
  15. {
  16. global $login_user, $file_path_rs;
  17. $get_cookies = curl_init('https://www.roblox.com/newlogin');
  18. curl_setopt_array($get_cookies,
  19. array(
  20. CURLOPT_RETURNTRANSFER => true,
  21. CURLOPT_HEADER => true,
  22. CURLOPT_POST => true,
  23. CURLOPT_POSTFIELDS => $login_user
  24. //CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.6 (KHTML, like Gecko) Chrome/16.0.897.0 Safari/535.6",
  25. //CURLOPT_FOLLOWLOCATION => true,
  26. //CURLOPT_REFERER => "http://www.roblox.com"
  27. )
  28. );
  29. $rs = (preg_match('/(\.ROBLOSECURITY=.*?);/', curl_exec($get_cookies), $matches) ? $matches[1] : '');
  30. file_put_contents($file_path_rs, $rs, true);
  31. curl_close($get_cookies);
  32. return $rs;
  33. }
  34.  
  35.  
  36.  
  37.  
  38.  
  39. // [Function] Change User's Group Rank
  40. function changeRank($rs, $token, $groupid, $userid, $rankid)
  41. {
  42. global $file_path_token;
  43.  
  44. $promote_user = curl_init("http://www.roblox.com/groups/api/change-member-rank?groupId=".$userid."&newRoleSetId=".$rankid."&targetUserId=".$userid);
  45. curl_setopt_array($promote_user,
  46. array(
  47. CURLOPT_RETURNTRANSFER => true,
  48. CURLOPT_POST => true,
  49. CURLOPT_HEADER => true,
  50. CURLOPT_HTTPHEADER => array("Cookie: $rs", "X-CSRF-TOKEN: $token", "Content-Type: application/x-www-form-urlencoded"),
  51. CURLOPT_POSTFIELDS => "groupId=2769318&newRoleSetId=18662283&targetUserId=109239258",
  52. CURLOPT_RETURNTRANSFER => true,
  53. CURLOPT_POST => true,
  54. CURLOPT_HEADER => true,
  55. CURLOPT_HTTPHEADER => array("Cookie: $rs", "X-CSRF-TOKEN: $token")
  56. )
  57. );
  58. $resp = curl_exec($promote_user);
  59. $resp_header_size = curl_getinfo($promote_user, CURLINFO_HEADER_SIZE);
  60. $resp_header = substr($resp, 0, $resp_header_size);
  61. $resp_body = substr($resp, $resp_header_size);
  62. if (/*preg_match('/GuestData/', $resp_header)*/false) {//this area is an issue, just call getRS() to keep it up to date
  63. // RS invalid
  64. echo("RS invalid");
  65. break;
  66. $resp_body = changeRank( getRS(), $token, $groupid, $userid, $rankid );
  67. } else if (preg_match('/Token Validation Failed/', $resp_header)) {
  68. // Token invalid
  69. $new_token = (preg_match('/X-CSRF-TOKEN: (\S+)/', $resp_header, $matches) ? $matches[1] : '');
  70. file_put_contents($file_path_token, $new_token, true);
  71. echo("Token invalid");
  72. break;
  73. $resp_body = changeRank( $rs, $new_token, $groupid, $userid, $rankid );
  74. }
  75. curl_close($promote_user);
  76. return $resp_body;
  77. }
  78. // Change user's group rank and echo results
  79. echo changeRank(getRS(), $current_token, 2769318, 109239258, 18662283);
  80. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement