Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // csrf init
- $username = "RepublicPromotions";
- $password = "removed";
- $id = 77726656; // id of bot
- $cookies = "";
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
- curl_setopt($ch,CURLOPT_POST, true);
- curl_setopt($ch,CURLOPT_POSTFIELDS, "username=$username&password=$password");
- $result = curl_exec($ch);
- preg_match_all('/^Set-Cookie:\s*([^\r;]*)/mi', $result, $ms);
- foreach ($ms[1] as $m) {
- $cookies = $cookies . $m . "; ";
- }
- curl_close($ch);
- $url = "http://www.roblox.com/User.aspx?ID=$id&ForcePublicView=true";
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_POST, false);
- curl_setopt($ch, CURLOPT_POSTFIELDS, " ");
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array("Cookie: $cookies"));
- $content = curl_exec($ch);
- curl_close($ch);
- if (strpos($content,"Roblox.XsrfToken.setToken('") != false) {
- $start = strpos($content,"Roblox.XsrfToken.setToken('") + 27;
- $length = strpos($content,"');",$start) - $start;
- $key = substr($content,$start,$length);
- echo("<br>Got key: ".$key);
- $xcsrf=$key;
- }
- else{
- echo("Did not find Token in headers");
- }
- // end of csrf init
- function returnArgument($key){
- return htmlspecialchars($_GET($key));
- };
- $base_url = 'http://www.roblox.com/messages/send';
- $data_array = array('subject' => 'Completion of Entrance Course!', 'body' => 'gj yolo it', 'recipientid' => returnArgument('userId'));
- // now that globals are initialized, we send the POST request.
- $option_array = array(
- 'http' => array(
- 'header' => "Content-type: application/x-www-form-urlencoded\r\n",
- 'method' => 'POST',
- 'content' => http_build_query($data_array),
- ),
- );
- $context = stream_context_create($option_array);
- $result = file_get_contents($base_url, false, $context);
- echo true;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement