Advertisement
Guest User

Bot

a guest
Feb 2nd, 2015
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.31 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. // csrf init
  5. $username = "RepublicPromotions";
  6. $password = "removed";
  7. $id = 77726656; // id of bot
  8.  
  9. $cookies = "";
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  11. curl_setopt($ch, CURLOPT_HEADER, true);
  12. curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
  13. curl_setopt($ch,CURLOPT_POST, true);
  14. curl_setopt($ch,CURLOPT_POSTFIELDS, "username=$username&password=$password");
  15. $result = curl_exec($ch);
  16. preg_match_all('/^Set-Cookie:\s*([^\r;]*)/mi', $result, $ms);
  17. foreach ($ms[1] as $m) {
  18. $cookies = $cookies . $m . "; ";
  19. }
  20. curl_close($ch);
  21. $url = "http://www.roblox.com/User.aspx?ID=$id&ForcePublicView=true";
  22. $ch = curl_init($url);
  23. curl_setopt($ch, CURLOPT_POST, false);
  24. curl_setopt($ch, CURLOPT_POSTFIELDS, " ");
  25. curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
  26. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  27. curl_setopt($ch, CURLOPT_HEADER, true);
  28. curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: $cookies"));
  29. $content = curl_exec($ch);
  30. curl_close($ch);
  31. if (strpos($content,"Roblox.XsrfToken.setToken('") != false) {
  32. $start = strpos($content,"Roblox.XsrfToken.setToken('") + 27;
  33. $length = strpos($content,"');",$start) - $start;
  34. $key = substr($content,$start,$length);
  35. echo("<br>Got key: ".$key);
  36. $xcsrf=$key;
  37. }
  38. else{
  39. echo("Did not find Token in headers");
  40. }
  41. // end of csrf init
  42. function returnArgument($key){
  43. return htmlspecialchars($_GET($key));
  44. };
  45. $base_url = 'http://www.roblox.com/messages/send';
  46. $data_array = array('subject' => 'Completion of Entrance Course!', 'body' => 'gj yolo it', 'recipientid' => returnArgument('userId'));
  47.  
  48. // now that globals are initialized, we send the POST request.
  49.  
  50. $option_array = array(
  51. 'http' => array(
  52. 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
  53. 'method' => 'POST',
  54. 'content' => http_build_query($data_array),
  55. ),
  56. );
  57. $context = stream_context_create($option_array);
  58. $result = file_get_contents($base_url, false, $context);
  59. echo true;
  60. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement