ArenaHosts
New Member
Hello guys,
I built this out of pure boredom and thought i would share it with you all - Its a total PoC. But it works!
I built this out of pure boredom and thought i would share it with you all - Its a total PoC. But it works!
Code:
<?php
if(isset($_POST['submit']))
{
function get_cookie()
{
$ch = curl_init('https://www.spotify.com/fr/signup/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$result = curl_exec($ch);
preg_match('/^Set-Cookie:\s*([^;]*)/mi', $result, $m);
parse_str($m[1], $cookies);
return $cookies["sp_csrf"];
}
function randomPassword() {
$alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789";
$pass = array(); //remember to declare $pass as an array
$alphaLength = strlen($alphabet) - 1; //put the length -1 in cache
for ($i = 0; $i < 8; $i++) {
$n = rand(0, $alphaLength);
$pass[] = $alphabet[$n];
}
return implode($pass); //turn the array into a string
}
//name generation
$ext = array('.gov','.be', '.biz', '.ch', '.com', '.co', '.co.uk', '.de', '.es', '.eu', '.fr', '.gr', '.im', '.info', '.io', '.it', '.lu', '.lt', '.me', '.mobi', '.mx', '.net', '.nl', '.org', '.pro', '.pt', '.re', '.ru', '.se', '.tel', '.tv', '.aero', '.biz', '.com', '.coop', '.info', '.mobi', '.name', '.net', '.org', '.pro', '.tel', '.travel', '.xxx', '.ag', '.ar.com', '.br.com', '.bz', '.ca', '.cc', '.co', '.gd', '.gs', '.gy', '.hn', '.ht', '.la', '.lc', '.ms', '.mx', '.pe', '.pm', '.qc.com', '.sx', '.tc', '.us', '.us.com', '.us.org', '.uy.com', '.vc', '.vg', '.at', '.be', '.cat', '.ch', '.co.uk', '.com.de', '.de', '.de.com', '.dk', '.es', '.eu', '.eu.com', '.fi', '.fr', '.gb.com', '.gb.net', '.gg', '.gr', '.gr.com', '.hu.com', '.hu.net', '.im', '.it', '.je', '.li', '.lt', '.lu', '.lv', '.me', '.me.uk', '.nl', '.no', '.no.com', '.nu', '.org.uk', '.pl', '.pt', '.ro', '.ru', '.ru.com', '.se', '.se.com', '.se.net', '.uk.com', '.uk.net', '.ru', '.ae.org', '.af', '.am', '.asia', '.cn', '.cn.com', '.cx', '.fm', '.hk', '.in', '.in.net', '.io', '.jp', '.jp.net', '.jpn.com', '.ki', '.kr.com', '.mn', '.nf', '.nz', '.ph', '.pw', '.sa.com', '.sb', '.tl', '.tv', '.tw', '.wf', '.ws', '.cm', '.mg', '.mu', '.re', '.sc', '.so', '.tf', '.yt', '.za', '.za.com' );
$names = array ('tony','lea','mary','bruce','Annabel', 'Asher', 'Atticus', 'August', 'Butch', 'Clementine', 'Daisy', 'Dashiell', 'Delilah', 'Dexter', 'Dixie', 'Duke', 'Edie', 'Elvis', 'Flora', 'Frances', 'Frank', 'Georgia', 'Gus', 'Hazel', 'Homer', 'Hopper', 'Hudson', 'Hugo', 'Ike', 'India', 'Ione', 'Iris', 'Isla', 'Ivy', 'June', 'Kai', 'Kingston', 'Lennon', 'Leonora', 'Leopold', 'Levi', 'Lila', 'Lionel', 'Lola', 'Luca', 'Lulu', 'Magnus', 'Mamie', 'Matilda', 'Millie', 'Milo', 'Minnie', 'Moses', 'Olive', 'Orson', 'Oscar', 'Otis', 'Pearl', 'Piper', 'Poppy', 'Ray', 'Roman', 'Romy', 'Roscoe', 'Ruby', 'Rufus', 'Sadie', 'Scarlett', 'Sebastian', 'Stella', 'Stellan', 'Sullivan', 'Talullah', 'Theo', 'Violet');
$names2 = array('gordon','wayne','gates','clinton','washington','carlson','wolowitz','stark','simpson','Jacka','Hackett','Buzzigoli','Mossmann','Hamm','Solano','Huntington','Fath','Goncalves','Decristoforo','Ellsworth','Alonsogarcia','Bullough','Bankhead','Swank','Rickels','Book','Dicks','Guo','Margolin','Mcdermott','Ciannavei','Buccianti','Lamb','Rzepka','Lovegreen');
$domain1 = array('Babble', 'Buzz', 'Blog', 'Blue', 'Brain', 'Bright', 'Browse', 'Bubble', 'Chat', 'Chatter', 'Dab', 'Dazzle', 'Dev', 'Digi', 'Edge', 'Feed', 'Five', 'Flash', 'Flip', 'Gab', 'Giga', 'Inno', 'Jabber', 'Jax', 'Jet', 'Jump', 'Link', 'Live', 'My', 'N', 'Photo', 'Pod', 'Real', 'Riff', 'Shuffle', 'Snap', 'Skip', 'Tag', 'Tek', 'Thought', 'Top', 'Topic', 'Twitter', 'Word', 'You', 'Zoom');
$domain2 = array('bean', 'beat', 'bird', 'blab', 'box', 'bridge', 'bug', 'buzz', 'cast', 'cat', 'chat', 'club', 'cube', 'dog', 'drive', 'feed', 'fire', 'fish', 'fly', 'ify', 'jam', 'links', 'list', 'lounge', 'mix', 'nation', 'opia', 'pad', 'path', 'pedia', 'point', 'pulse', 'set', 'space', 'span', 'share', 'shots', 'sphere', 'spot', 'storm', 'ster', 'tag', 'tags', 'tube', 'tune', 'type', 'verse', 'vine', 'ware', 'wire', 'works', 'XS', 'Z', 'zone', 'zoom');
$separators = array('-','_','.','');
shuffle($ext);
shuffle($names);
shuffle($names2);
shuffle($separators);
shuffle($domain1);
shuffle($domain2);
$randomExt = $ext[0];
$randomName = $names[0];
$randomName2 = $names2[0];
$randomSeparator = $separators[0];
$randomDomain1 = $domain1[0];
$randomDomain2 = $domain2[0];
$mail = $randomName.$randomSeparator.$randomName2.'@'.$randomDomain1.$randomDomain2.$randomExt;
$username = $_POST['username'];
$day = mt_rand(1, 28);
$month = mt_rand(1, 12);
$year = mt_rand(1940, 1999);
$ch = curl_init();
$password = randomPassword();
curl_setopt($ch, CURLOPT_URL,"https://www.spotify.com/fr/xhr/json/sign-up-for-spotify.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"sp_csrf=".get_cookie()."&form_token=850042dc3631b8f7288e6441fa2def5e&forward_url=%2Ffr%2Fdownload%2F&signup_pre_tick_eula=true&username=".$username."&password=".$password."&email=".$mail."&confirm_email=".$mail."&dob_day=".$day."&dob_month=".$month."&dob_year=".$year."&gender=male");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
$result = json_decode($server_output);
curl_close ($ch);
// further processing ....
if ($result->status == "1")
{
echo '<b>Account created !</b><br /><p>Username: '.$username.'<br />E-Mail: '.$mail.'<br />Password: '.$password.'<br /></p>';
}
else
{
echo 'I don\'t know, error or whatever...';
}
}else{
?>
<form method="post">
<label>Username:</label>
<input type="text" name="username">
<input type="submit" name="submit" value="Submit Username" >
</form>
<?php
}
?>