PageRenderTime 34ms CodeModel.GetById 9ms RepoModel.GetById 0ms app.codeStats 0ms

/hosts/filefactory_com.php

https://github.com/gartz/RapidLeetch
PHP | 101 lines | 83 code | 12 blank | 6 comment | 20 complexity | de70b04ca5bbf9b103a63ced6784c9de MD5 | raw file
  1. <?php
  2. if (!defined('RAPIDLEECH'))
  3. {
  4. require_once("index.html");
  5. exit;
  6. }
  7. //Use PREMIUM?
  8. if (($_GET["premium_acc"] == "on" && $_GET["premium_user"] && $_GET["premium_pass"]) || ($_GET["premium_acc"] == "on" && $premium_acc["filefactory"]["user"] && $premium_acc["filefactory"]["pass"]))
  9. {
  10. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
  11. is_page($page);
  12. is_present($page, 'File Not Found', 'Error - File was not found!');
  13. $post = array();
  14. $post['email'] = $_GET["premium_user"] ? trim($_GET["premium_user"]) : $premium_acc["filefactory"]["user"] ;
  15. $post['password'] = $_GET["premium_pass"] ? trim($_GET["premium_pass"]) : $premium_acc["filefactory"]["pass"];
  16. $post['redirect'] = $LINK;
  17. $page = geturl("www.filefactory.com", 80, "/", 0, 0, $post, 0, $_GET["proxy"], $pauth);
  18. is_page($page);
  19. if (!preg_match('%(ff_membership=.+); expires%', $page, $lcook)) html_error('Error getting login-cookie', 0);
  20. if (!preg_match('%ocation: (.+)\r\n%', $page, $redir)) html_error('Error getting redirect', 0);
  21. $Url = parse_url($redir[1]);
  22. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $lcook[1], 0, 0, $_GET["proxy"],$pauth);
  23. if (!preg_match('%ocation: (.+)\r\n%', $page, $redir2)) html_error('Error getting redirect 2', 0);
  24. $Url = parse_url($redir2[1]);
  25. $FileName = basename($Url['path']);
  26. insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&path=".urlencode($Url["path"].($Url["query"] ? "?".$Url["query"] : ""))."&referer=".urlencode($Referer)."&cookie=".urlencode($lcook[1])."&email=".($_GET["domail"] ? $_GET["email"] : "")."&partSize=".($_GET["split"] ? $_GET["partSize"] : "")."&method=".$_GET["method"]."&proxy=".($_GET["useproxy"] ? $_GET["proxy"] : "")."&saveto=".$_GET["path"]."&link=".$redir2[1].($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "").($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
  27. }
  28. else
  29. //Use FREE instead?
  30. {
  31. if ($_GET["step"] == "1")
  32. {
  33. $cook = $_POST['cookie'];
  34. $post["captchaText"] = $_POST["captcha"];
  35. $post['captchaID'] = $_POST['captchaID'];
  36. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cook, $post, 0, $_GET["proxy"],$pauth);
  37. is_page($page);
  38. //var_dump(nl2br(htmlentities($page)));exit;
  39. preg_match('/<a href="(.+?)" class="download">/', $page, $dllink);
  40. $Href = trim($dllink[1]);
  41. $Url = parse_url($Href);
  42. if (!is_array($Url))
  43. {
  44. html_error("Download link not found", 0);
  45. }
  46. $FileName = "attachment";
  47. insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&path=".urlencode($Url["path"].($Url["query"] ? "?".$Url["query"] : ""))."&referer=".urlencode($Referer)."&cookie=".urlencode($premium_cookie)."&email=".($_GET["domail"] ? $_GET["email"] : "")."&partSize=".($_GET["split"] ? $_GET["partSize"] : "")."&method=".$_GET["method"]."&proxy=".($_GET["useproxy"] ? $_GET["proxy"] : "")."&saveto=".$_GET["path"]."&link=".$_POST["link2"].($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "").($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
  48. }
  49. else
  50. {
  51. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
  52. is_page($page);
  53. if (stristr($page,'ocation:')) {
  54. preg_match('/ocation: (.*)/',$page,$loc);
  55. $loc = "http://".$Url['host'].$loc[1];
  56. $Url = parse_url(trim($loc));
  57. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, 0, 0, 0, $_GET["proxy"],$pauth);
  58. is_page($page);
  59. $LINK = trim($loc);
  60. }
  61. is_present($page, "This file is no longer available");
  62. is_notpresent($page, "Download for free", "Download link not found");
  63. // Get first download link (download with free)
  64. preg_match('/<a class="download" href="(.*)">Download for free/',$page,$href);
  65. $Href = "http://".$Url['host'].$href[1];
  66. $Url = parse_url(trim($Href));
  67. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, 0, 0, 0, $_GET["proxy"],$pauth);
  68. is_page($page);
  69. preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
  70. $cookie = $temp[1];
  71. $cook = implode(';',$cookie);
  72. // Find captcha image
  73. preg_match('/<img class="captchaImage" src="(.*)"/',$page,$capimg);
  74. if (!$capimg) html_error("Cannot find captcha image",0);
  75. $access_image_url = "http://".$Url['host'].$capimg[1];
  76. // Captcha ID
  77. preg_match('/<input id="captchaID" name="captchaID" type="hidden" value="(.*)"/',$page,$cID);
  78. $cID = $cID[1];
  79. print "<form name=\"dl\" action=\"".$PHP_SELF.(isset($_GET["audl"]) ? "?audl=doum" : "")."\" method=\"post\">\n";
  80. print "<input type=\"hidden\" name=\"link\" value=\"".urlencode($Href)."\">\n<input type=\"hidden\" name=\"link2\" value=\"".urlencode($LINK)."\">\n<input type=\"hidden\" name=\"referer\" value=\"".urlencode($Href)."\">\n<input type=\"hidden\" name=\"f\" value=\"$f\">\n<input type=\"hidden\" name=\"h\" value=\"$h\">\n<input type=\"hidden\" name=\"b\" value=\"$b\">\n<input type=\"hidden\" name=\"step\" value=\"1\">\n";
  81. print "<input type=\"hidden\" name=\"comment\" id=\"comment\" value=\"".$_GET["comment"]."\">\n<input type=\"hidden\" name=\"email\" id=\"email\" value=\"".$_GET["email"]."\">\n<input type=\"hidden\" name=\"partSize\" id=\"partSize\" value=\"".$_GET["partSize"]."\">\n<input type=\"hidden\" name=\"method\" id=\"method\" value=\"".$_GET["method"]."\">\n";
  82. print "<input type=\"hidden\" name=\"proxy\" id=\"proxy\" value=\"".$_GET["proxy"]."\">\n<input type=\"hidden\" name=\"proxyuser\" id=\"proxyuser\" value=\"".$_GET["proxyuser"]."\">\n<input type=\"hidden\" name=\"proxypass\" id=\"proxypass\" value=\"".$_GET["proxypass"]."\">\n<input type=\"hidden\" name=\"path\" id=\"path\" value=\"".$_GET["path"]."\">\n";
  83. print "<input type='hidden' name='cookie' value='$cook' /><input type='hidden' name='captchaID' value='$cID' />";
  84. print "<h4>Enter <img src=\"$access_image_url\"> here: <input type=\"text\" name=\"captcha\" size=\"4\">&nbsp;&nbsp;<input type=\"submit\" onclick=\"return check()\" value=\"Download File\"></h4>\n";
  85. print "<script language=\"JavaScript\">".$nn."function check() {".$nn."var imagecode=document.dl.captcha.value;".$nn.'if (imagecode == "") { window.alert("You didn\'t enter the image verification code"); return false; }'.$nn.'else { return true; }'.$nn.'}'.$nn.'</script>'.$nn;
  86. print "</form>\n</body>\n</html>";
  87. }
  88. }
  89. ?>