Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- echo " -- James' Account Creator v1.0 -- ".PHP_EOL.PHP_EOL;
- function generateRandomString($length = 10) {
- $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
- $charactersLength = strlen($characters);
- $randomString = '';
- for ($i = 0; $i < $length; $i++) {
- $randomString .= $characters[rand(0, $charactersLength - 1)];
- }
- return $randomString;
- }
- function get_contents($url, $ua = 'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', $referer = 'http://www.google.com/') {
- if (function_exists('curl_exec')) {
- $header[0] = "Accept-Language: en-us,en;q=0.5";
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_USERAGENT, $ua);
- curl_setopt($curl, CURLOPT_REFERER, $referer);
- curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_TIMEOUT, 10);
- $content = curl_exec($curl);
- curl_close($curl);
- }
- else {
- $content = file_get_contents($url);
- }
- return $content;
- }
- function post_contents($url, $postfields, $ua = 'Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', $referer = 'http://www.google.com/') {
- if (function_exists('curl_exec')) {
- $header[0] = "Accept-Language: en-us,en;q=0.5";
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_URL, $url);
- curl_setopt($curl, CURLOPT_USERAGENT, $ua);
- curl_setopt($curl, CURLOPT_REFERER, $referer);
- curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_TIMEOUT, 10);
- curl_setopt($curl, CURLOPT_POST, 1);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $postfields);
- $content = curl_exec($curl);
- curl_close($curl);
- }
- else {
- $content = file_get_contents($url);
- }
- return $content;
- }
- function createAccount($username, $password, $email)
- {
- $timeout = 5;
- $mtimeout = 120;
- echo "Making account username = ".$username.", password = ".$password.", email = ".$email."...".PHP_EOL;
- $site = get_contents('https://signup.euw.leagueoflegends.com/en/signup/index?realm_key=euw');
- echo "Fetched LoL sign-up page!".PHP_EOL;
- $one = explode("name=\"data[_Token][key]\" value=\"", $site);
- $two = explode("value=\"", $one[1]);
- $three = explode("\"", $two[0]);
- $finaltoken = $three[0];
- echo "Found CSRF token = ".$finaltoken.PHP_EOL;
- $retrieve = file_get_contents("http://2captcha.com/in.php?key=018fe3d437fca66ab314338ce52304b5&method=userrecaptcha&googlekey=6Lf65wkTAAAAAMrRX6NYCmeiOUEVWk_0dtN7yA5l");
- $first = array($retrieve);
- $result = explode('OK|', $first[0]);
- $hello = $result[1];
- echo "Got reCAPTCHA ID = ".$hello." and queued for solving...".PHP_EOL;
- $con = "http://2captcha.com/res.php?key=018fe3d437fca66ab314338ce52304b5&action=get&id=" . $hello;
- $slept = 0;
- while(true)
- {
- echo "Checking if captcha is solved...".PHP_EOL;
- $getting = file_get_contents($con);
- if ($getting == "CAPCHA_NOT_READY") {
- echo "Not yet.",PHP_EOL;
- $solvedcaptcha = "Couldn't be found!";
- } elseif ($getting == "ERROR") {
- echo "Error".PHP_EOL;
- $solvedcaptcha = "Error occured";
- return true;
- } else {
- $ex = explode('|', $getting);
- if (trim($ex[0])=='OK') {
- $solvedcaptcha = trim($ex[1]);
- return true;
- }
- return true;
- }
- $slept += $timeout;
- if ($slept != $mtimeout) {
- echo "Sleeping ".$timeout." seconds, then trying again...".PHP_EOL;
- sleep($timeout);
- } else {
- echo "Solve failed.".PHP_EOL;
- }
- }
- echo "Solve time waited and g-recaptcha-response found as: ".$solvedcaptcha.PHP_EOL;
- $postfields = array(
- 'data[PvpnetAccount][name]' => 'tvremote22',
- 'data[PvpnetAccount][password]' => 'Password123!',
- 'data[PvpnetAccount][confirm_password]' => 'Password123!',
- 'data[PvpnetAccount][date_of_birth_day]' => '01',
- 'data[PvpnetAccount][date_of_birth_month]' => '01',
- 'data[PvpnetAccount][date_of_birth_year]' => '2000',
- 'data[PvpnetAccount][tou_agree]' => 1,
- 'data[PvpnetAccount][realm]' => 'euw',
- 'g-recaptcha-response' => $solvedcaptcha[1],
- 'data[_Token][fields]' => '3cb6ba967c8cb5040ba201c219c4b2d7bad276b7%3An%3A0%3A%7B%7D',
- 'data[_Token][key]' => $finaltoken,
- '_method' => 'POST',
- 'data[PvpnetAccount][newsletter]' => 0
- );
- echo "Posting as humanized form...".PHP_EOL.PHP_EOL;
- return post_contents('https://signup.euw.leagueoflegends.com/en/signup/index?realm_key=euw', $postfields);
- }
- $usernamePrefix = "testAccounts";
- $password = "Password123!";
- $emailName = "jameslolaccs";
- $emailDomain = "gmail.com";
- $accountsToMake = 2;
- $accounts = "";
- for ($i=1; $i<$accountsToMake; $i++) {
- $username = $usernamePrefix.$i;
- $email = $emailName."+".generateRandomString(3).$i."@".$emailDomain;
- $account_response = createAccount($username, $password, $email);
- if ($account_response == 1) {
- echo "Account created, username = ".$username.PHP_EOL.PHP_EOL;
- $accounts .= $username . "|" . $password . "|" . $email;
- if ($i != $accountsToMake) {
- $accounts .= "\n";
- } else {
- $accounts .= "\n\nCreated using James' account creator.";
- }
- } else {
- if ($i == $accountsToMake) {
- $accounts .= "\n\nCreated using James' account creator.";
- }
- }
- }
- $file = fopen(time()."-JamesAccounts.txt","w");
- fwrite($file,$accounts);
- fclose($file);
- echo "Accounts exported to file: ".time()."-JamesAccounts.txt".PHP_EOL;
Advertisement
Add Comment
Please, Sign In to add comment