1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56:
| <?php
function login( $data, $useragent = 'Mozilla 4.01', $proxy = false ) { $ch = curl_init(); $hash = crc32( $data['email'].$data['pass'] ); $hash = sprintf( "%u", $hash ); $randnum = $hash.rand( 0, 9999999 ); if( $proxy ) curl_setopt( $ch, CURLOPT_PROXY, $proxy ); curl_setopt( $ch, CURLOPT_COOKIEJAR, '/tmp/cookiejar-'.$randnum ); curl_setopt( $ch, CURLOPT_COOKIEFILE, '/tmp/cookiejar-'.$randnum ); curl_setopt( $ch, CURLOPT_USERAGENT, $useragent ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_POST, 0); curl_setopt( $ch, CURLOPT_URL, 'http://www.myspace.com' ); $page = curl_exec( $ch ); preg_match( '/MyToken=(.+?)"/i', $page, $token ); if( $token[1] ) { curl_setopt( $ch, CURLOPT_URL, 'http://login.myspace.com/index.cfm?fuseaction=login.process&MyToken='.$token[1] ); curl_setopt( $ch, CURLOPT_REFERER, 'http://www.myspace.com' ); curl_setopt( $ch, CURLOPT_HTTPHEADER, Array( 'Content-Type: application/x-www-form-urlencoded' ) ); curl_setopt( $ch, CURLOPT_POST, 1 ); $postfields = 'NextPage=&email='.urlencode( $data['mail'] ).'&password='.urlencode( $data['pass'] ).'&loginbutton.x=&loginbutton.y='; curl_setopt( $ch, CURLOPT_POSTFIELDS, $postfields ); $page = curl_exec( $ch ); if( strpos( $page, 'SignOut' ) !== false ) { return $randnum; } else { preg_match( '/MyToken=(.+?)"/i', $page, $token ); preg_match( '/replace\("([^\"]+)"/', $page, $redirpage ); if( $token[1] ) { curl_setopt( $ch, CURLOPT_POST, 0 ); curl_setopt( $ch, CURLOPT_URL, 'http://home.myspace.com/index.cfm?&fuseaction=user&Mytoken='.$token[1] ); $page = curl_exec( $ch ); curl_close( $ch ); if( strpos( $page, 'SignOut' ) !== false ) { return $randnum; } } elseif( $redirpage[1] ) { curl_setopt( $ch, CURLOPT_REFERER, 'http://login.myspace.com/index.cfm?fuseaction=login.process&MyToken='.$token[1] ); curl_setopt( $ch, CURLOPT_URL, $redirpage[1] ); curl_setopt( $ch, CURLOPT_POST, 0 ); $page = curl_exec( $ch ); curl_close( $ch ); if( strpos( $page, 'SignOut' ) !== false ) { return $randnum; } } } } return false; }
?>
|