Advertisement
Guest User

Untitled

a guest
Feb 26th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. error_reporting(E_ALL);
  2.  
  3. function getBetween($input, $start, $end)
  4. {
  5. $_output = explode($start, $input);
  6.  
  7. if (isset($_output[1]))
  8. {
  9. $_output = @explode($end, $_output[1]);
  10. return $_output[0];
  11. }
  12.  
  13. return NULL;
  14. }
  15.  
  16. echo "Executing token URL... ";
  17. $tokenContent = @file_get_contents('http://logon.vanillagaming.org/vote/index.php');
  18. sleep(1);
  19.  
  20. echo "Gathering token Id... ";
  21. $tokenId = getBetween($tokenContent, 'name="token" value="', '" />');
  22. sleep(1);
  23.  
  24. echo "Preparing login information... ";
  25. $username = 'test';
  26. $password = 'test';
  27. $cURL = curl_init('http://logon.vanillagaming.org/vote/checklogin.php');
  28. curl_setopt($cURL, CURLOPT_POSTFIELDS, http_build_query(array('token'=>$tokenId, 'myusername'=>$username, 'mypassword'=>$password, 'Submit'=>'Login')));
  29. curl_setopt($cURL, CURLOPT_COOKIEJAR, './cookie.tmp');
  30. curl_setopt($cURL, CURLOPT_COOKIEFILE, './cookie.tmp');
  31. curl_setopt($cURL, CURLOPT_VERBOSE, TRUE);
  32. curl_setopt($cURL, CURLOPT_COOKIESESSION, TRUE);
  33. curl_setopt($cURL, CURLOPT_POST, TRUE);
  34. curl_setopt($cURL, CURLOPT_HEADER, TRUE);
  35. curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, TRUE); # Warning safe_mode/open_basedir
  36. curl_setopt($cURL, CURLOPT_RETURNTRANSFER, TRUE);
  37. curl_setopt($cURL, CURLOPT_BINARYTRANSFER, TRUE); # PHP < 5.1.3
  38. curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, FALSE);
  39. curl_setopt($cURL, CURLOPT_SSL_VERIFYHOST, FALSE);
  40. curl_setopt($cURL, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0');
  41. curl_setopt($cURL, CURLOPT_ENCODING, 'gzip, deflate');
  42. curl_setopt($cURL, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
  43. curl_setopt($cURL, CURLOPT_REFERER, 'http://logon.vanillagaming.org/vote/index.php');
  44. sleep(1);
  45.  
  46. echo "nGathering session Id... ";
  47. $sessionContent = @file_get_contents('./cookie.tmp');
  48. $sessionId = getBetween($sessionContent, "PHPSESSIDt", "n");
  49. sleep(1);
  50.  
  51. curl_setopt($cURL, CURLOPT_HTTPHEADER, array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language: en-US,en;q=0.5', 'Cookie: PHPSESSID=' . $sessionId, 'Connection: keep-alive', 'Content-Type: application/x-www-form-urlencoded', 'Content-Length: ' . (75 + strlen($username) + strlen($password))/*, 'If-Modified-Since: *'*/));
  52. echo "Executing login URL... ";
  53. $output = curl_exec($cURL);
  54. sleep(1);
  55.  
  56. $responseMessage = curl_error($cURL);
  57.  
  58. if ($responseMessage) echo "Error! ({$responseMessage})n";
  59. else echo "Done.n";
  60.  
  61. echo "Closing login URL... ";
  62. curl_close($cURL);
  63. sleep(1);
  64.  
  65. echo "Done.nChecking login/output... ";
  66.  
  67. if (stripos($output, 'Hello') || stripos($output, 'coins') || stripos($output, 'Gold') || stripos($output, 'Logout'))
  68. {
  69. echo "Logged in!n";
  70. }
  71. else
  72. {
  73. echo "Done.n";
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement