PageRenderTime 24ms CodeModel.GetById 9ms app.highlight 12ms RepoModel.GetById 1ms app.codeStats 0ms

/hosts/letitbit_net.php

https://github.com/gartz/RapidLeetch
PHP | 137 lines | 94 code | 11 blank | 32 comment | 8 complexity | b882701c6ccf7d49e223c69d3b203207 MD5 | raw file
  1<?php
  2if (!defined('RAPIDLEECH'))
  3{
  4	require_once("index.html");
  5	exit;
  6}
  7
  8if ($_GET['step'] == 1) {
  9
 10$post = Array();
 11$post["uid"] = $_POST['uid'];
 12$post["frameset"] = "Download+file";
 13$nextPage = $_POST['nextpage'];
 14$post["fix"] = "1";
 15$post['cap'] = $_POST['imagestring'];
 16$post['uid2'] = $_POST['uid2'];
 17$cookie = $_POST['cookie'];
 18$Url = parse_url($nextPage);
 19$Referer = urldecode($_GET['referer']);
 20// Reorganize cookie...
 21$cookies = explode(';',$cookie);
 22foreach ($cookies as $temp) {
 23	$temp2 = explode('=',$temp);
 24	$temp3[$temp2[0]] = $temp2[1];
 25}
 26$temp3['ref_full'] = $_GET['referer'];
 27$temp3['ref_site'] = $Url['host'];
 28$cookie = "";
 29foreach ($temp3 as $k=>$v) {
 30	$cookie .= $k."=".$v.";";
 31}
 32$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, $post, 0, $_GET["proxy"],$pauth);
 33//preg_match('/Set-Cookie: ([^\r\n]+)/', $page, $cookies);
 34//file_put_contents("letitbit_2.txt", $page);
 35
 36is_page($page);
 37
 38if(preg_match('/<frame src="http:\/\/letitbit.net\/tmpl\/tmpl_frame_top\.php\?link=(.+?)" name="topFrame"/', $page, $nextPageArray))
 39{
 40	$Referer = $Referer;
 41	$nextPage = $nextPageArray[1];
 42}
 43else
 44{
 45	html_error("Could not find frame.", 0);
 46}
 47/*$Url = parse_url($nextPage);
 48//$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
 49var_dump(nl2br(htmlentities($page)));exit;
 50//file_put_contents("letitbit_3.txt", $page);
 51is_page($page);
 52
 53
 54if(preg_match('/<a .*href="(.+?)"/', $page, $nextPageArray))
 55{
 56	$Referer = $nextPage;
 57	$nextPage = $nextPageArray[1];
 58}
 59else
 60{
 61	html_error("Could not find download link.", 0);
 62}
 63$Url = parse_url($nextPage);
 64
 65$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
 66//file_put_contents("letitbit_4.txt", $page);
 67
 68preg_match('/Location: ([^\r\n]+)/i', $page, $nextPageArray);*/
 69$Url = parse_url($nextPage);
 70$FileName = basename($Url["path"]);
 71
 72insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&port=".$Url["port"]."&path=".urlencode($Url["path"].($Url["query"] ? "?".$Url["query"] : ""))."&referer=".urlencode($Referer)."&cookie=".urlencode($cookie)."&email=".($_GET["domail"] ? $_GET["email"] : "")."&partSize=".($_GET["split"] ? $_GET["partSize"] : "")."&method=".$_GET["method"]."&proxy=".($_GET["useproxy"] ? $_GET["proxy"] : "")."&saveto=".$_GET["path"]."&link=".urlencode($LINK).($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "").($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
 73} else {
 74
 75$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
 76//file_put_contents("letitbit_1.txt", $page);
 77is_page($page);
 78is_present($page, "The requested file was not found");
 79is_present($page, "Gesuchte Datei wurde nicht gefunden", "The requested file was not found");
 80is_present($page, "Запрашиваемый файл не найден", "The requested file was not found");
 81
 82preg_match_all('/Set-Cookie: ([^\r\n]+)/', $page, $cookies);
 83//one day... $cookie = Array();
 84foreach ($cookies[1] as $fullCookie)
 85{
 86	$cookieSplit = explode("; ", $fullCookie);
 87	//one day... $cookie[] = $cookieSplit[0];
 88	$cookie .= $cookieSplit[0]."; ";
 89}
 90$cookie = substr($cookie, 0, -2); //remove one day...
 91
 92if(preg_match('/<form action="(.+?)" method="post" name="Premium" id="Premium">/', $page, $nextPageArray))
 93{
 94	$Referer = $LINK;
 95	$nextPage = $nextPageArray[1];
 96}
 97else
 98{
 99	html_error("Could not find download form.", 0);
100}
101preg_match('/\n<input type="hidden" name="uid" value="(.+?)" \/>/', $page, $uidArray);
102preg_match('/<input type="hidden" name="uid2" value="(.+?)" \/>/', $page, $uid2Array);
103$post = Array();
104$post["uid"] = $uidArray[1];
105$post["frameset"] = "Download file";
106//$post["fix"] = "1";
107$post['uid2'] = $uid2Array[2];
108if (stristr($page,"cap.php?"))
109    {
110    $imagecode = cut_str($page,"<img src='http://letitbit.net/cap.php?jpg=","'");
111    //$capcode = cut_str($page,'capgen.php?','"');
112    //$megavar = cut_str($page, '<input type="hidden" name="megavar" value="', '">');
113              
114    //$access_image_url = $Url["scheme"]."://".$Url["host"]."/capgen.php?".$capcode;
115	$access_image_url = 'http://letitbit.net/cap.php?jpg='.$imagecode;
116             
117    print "<form name=\"dl\" action=\"".$PHP_SELF.(isset($_GET["audl"]) ? "?audl=doum" : "")."\" method=\"post\">\n";
118?>
119	<input type="hidden" name="uid" value="<?php echo $uidArray[1]; ?>" />
120	<input type="hidden" name="uid2" value="<?php echo $uid2Array[1]; ?>" />
121	<input type="hidden" name="nextpage" value="<?php echo $nextPage; ?>" />
122	<input type="hidden" name="cookie" value="<?php echo $cookie; ?>" />
123<?php
124    print "<input type=\"hidden\" name=\"link\" value=\"".urlencode($LINK)."\">\n<input type=\"hidden\" name=\"referer\" value=\"".urlencode($Referer)."\">\n<input type=\"hidden\" name=\"fileid\" value=\"$fid\">\n<input type=\"hidden\" name=\"imagecode\" value=\"$imagecode\">\n<input type=\"hidden\" name=\"megavar\" value=\"$megavar\">\n<input type=\"hidden\" name=\"step\" value=\"1\">\n";
125    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";
126    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";
127    print "<h4>Enter <img src=\"$access_image_url\"> here: <input type=\"text\" name=\"imagestring\" size=\"6\">&nbsp;&nbsp;<input type=\"submit\" onclick=\"return check()\" value=\"Download File\"></h4>\n";
128    print "<script language=\"JavaScript\">".$nn."function check() {".$nn."var imagecode=document.dl.imagestring.value;".$nn.'if (imagecode == "") { window.alert("You didn\'t enter the image verification code"); return false; }'.$nn.'else { return true; }'.$nn.'}'.$nn.'</script>'.$nn;
129    print "</form>\n</body>\n</html>";
130    }
131  else
132    {
133    html_error("Image code not found", 0);
134    }
135
136}
137?>