Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- error_reporting(E_ALL);
- function getBetween($input, $start, $end)
- {
- $_output = explode($start, $input);
- if (isset($_output[1]))
- {
- $_output = @explode($end, $_output[1]);
- return $_output[0];
- }
- return NULL;
- }
- echo "Executing token URL... ";
- $tokenContent = @file_get_contents('http://logon.vanillagaming.org/vote/index.php');
- sleep(1);
- echo "Gathering token Id... ";
- $tokenId = getBetween($tokenContent, 'name="token" value="', '" />');
- sleep(1);
- echo "Preparing login information... ";
- $username = 'test';
- $password = 'test';
- $cURL = curl_init('http://logon.vanillagaming.org/vote/checklogin.php');
- curl_setopt($cURL, CURLOPT_POSTFIELDS, http_build_query(array('token'=>$tokenId, 'myusername'=>$username, 'mypassword'=>$password, 'Submit'=>'Login')));
- curl_setopt($cURL, CURLOPT_COOKIEJAR, './cookie.tmp');
- curl_setopt($cURL, CURLOPT_COOKIEFILE, './cookie.tmp');
- curl_setopt($cURL, CURLOPT_VERBOSE, TRUE);
- curl_setopt($cURL, CURLOPT_COOKIESESSION, TRUE);
- curl_setopt($cURL, CURLOPT_POST, TRUE);
- curl_setopt($cURL, CURLOPT_HEADER, TRUE);
- curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, TRUE); # Warning safe_mode/open_basedir
- curl_setopt($cURL, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($cURL, CURLOPT_BINARYTRANSFER, TRUE); # PHP < 5.1.3
- curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, FALSE);
- curl_setopt($cURL, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($cURL, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0');
- curl_setopt($cURL, CURLOPT_ENCODING, 'gzip, deflate');
- curl_setopt($cURL, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
- curl_setopt($cURL, CURLOPT_REFERER, 'http://logon.vanillagaming.org/vote/index.php');
- sleep(1);
- echo "nGathering session Id... ";
- $sessionContent = @file_get_contents('./cookie.tmp');
- $sessionId = getBetween($sessionContent, "PHPSESSIDt", "n");
- sleep(1);
- 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: *'*/));
- echo "Executing login URL... ";
- $output = curl_exec($cURL);
- sleep(1);
- $responseMessage = curl_error($cURL);
- if ($responseMessage) echo "Error! ({$responseMessage})n";
- else echo "Done.n";
- echo "Closing login URL... ";
- curl_close($cURL);
- sleep(1);
- echo "Done.nChecking login/output... ";
- if (stripos($output, 'Hello') || stripos($output, 'coins') || stripos($output, 'Gold') || stripos($output, 'Logout'))
- {
- echo "Logged in!n";
- }
- else
- {
- echo "Done.n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement