PageRenderTime 29ms CodeModel.GetById 10ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/hosts/download/letitbit_net.php

https://github.com/gartz/RapidLeetch
PHP | 197 lines | 164 code | 26 blank | 7 comment | 19 complexity | a668aceb022a76a723f7f4c58f04514d MD5 | raw file
  1<?php
  2
  3if (!defined('RAPIDLEECH'))
  4{
  5    require_once("index.html");
  6    exit;
  7}
  8
  9if (($_GET ["premium_acc"] == "on"  && $_GET ["premium_pass"]) || ($_GET ["premium_acc"] == "on" && $premium_acc ["letitbit"] ["pass"])) {
 10
 11 $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, 0, 0, 0, $_GET["proxy"],$pauth);
 12    is_page($page);
 13    is_present($page, "The requested file was not found");
 14    is_present($page, "Gesuchte Datei wurde nicht gefunden", "The requested file was not found");
 15    is_present($page, "Запрашиваемый файл не найден", "The requested file was not found");
 16
 17    $cookie=biscottiDiKaox($page);
 18    $PreForm = cut_str ( $page ,'password here:' ,'</form>' );
 19
 20    $uid5 = cut_str($PreForm,'uid5" value="','"');
 21    $uid = cut_str($PreForm,'uid" value="','"');
 22    $name = cut_str($PreForm,'name="name" value="','"');
 23    $pin = cut_str($PreForm,'pin" value="','"');
 24    $realuid = cut_str($PreForm,'realuid" value="','"');
 25    $realname = cut_str($PreForm,'realname" value="','"');
 26    $host = cut_str($PreForm,'host" value="','"');
 27    $ssserver = cut_str($PreForm,'ssserver" value="','"');
 28    $sssize = cut_str($PreForm,'sssize" value="','"');
 29
 30    $UrlAct="http://letitbit.net/sms/check2.php";
 31    $post['pass']=$_GET ["premium_pass"] ? $_GET ["premium_pass"] : $premium_acc ["letitbit"] ["pass"];
 32    $post['uid5']=$uid5;
 33    $post['uid']=$uid;
 34    $post['name']=$name;
 35    $post['pin']=$pin;
 36    $post['realuid']=$realuid;
 37    $post['realname']=$realname;
 38    $post['host']=$host;
 39    $post['ssserver']=$ssserver;
 40    $post['sssize']=$sssize;
 41    $post['optiondir']='';
 42    $Url=parse_url($UrlAct);
 43
 44$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, $post, 0, $_GET["proxy"],$pauth);
 45    is_page($page);
 46    $dlink=slice($page,"Download Master","</table>",3);
 47    $dwnl=slice($dlink,"<a href='","'",1);
 48    $Url = parse_url($dwnl);
 49    $FileName = basename($dwnl);
 50insert_location("index.php?filename=".urlencode($FileName)."&force_name=".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" : ""));
 51
 52
 53}else{
 54if ($_POST['step'] == 1) {
 55
 56    $UrlAct="http://letitbit.net/download3.php";
 57    $post = unserialize(urldecode($_POST["post"]));
 58	$post['uid2']=$post['uid'];
 59    $post['cap']=$_POST["captcha"];
 60    $cookie = urldecode($_POST['cookie']);
 61    $Url = parse_url($UrlAct);
 62    $Referer = "http://letitbit.net/download4.php";
 63
 64    $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, $post, 0, $_GET["proxy"],$pauth);
 65
 66    is_page($page);
 67
 68    if(preg_match('/http:\/\/\w{2}\.[^"\']+/', $page, $nextPageArray))
 69    {
 70        $nextPage = $nextPageArray[0];
 71		$Url=parse_url($nextPage);
 72		$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $UrlAct, $cookie, 0, 0, $_GET["proxy"],$pauth);
 73		 $wait = cut_str ( $page ,'y = ' ,';' );
 74        $act2 = cut_str ( $page ,'window.location.href="' ,'"' );
 75        $Url=parse_url($act2);
 76		insert_timer($wait);
 77		$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $act, $cookie, 0, 0, $_GET["proxy"],$pauth);
 78    }
 79    else
 80    {
 81        html_error("Could not find frame.", 0);
 82    }
 83    $snap = cut_str ( $page ,'id="links' ,'</div>' );
 84    $dwn= cut_str ( $snap ,'href="' ,'"' );
 85    $Url = parse_url($dwn);
 86    $FileName = basename($Url["path"]);
 87    
 88insert_location("index.php?filename=".urlencode($FileName)."&force_name=".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" : ""));
 89
 90} else {
 91    $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
 92    is_page($page);
 93
 94    $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, 0, 0, 0, $_GET["proxy"],$pauth);
 95    is_page($page);
 96    is_present($page, "The requested file was not found");
 97    is_present($page, "Gesuchte Datei wurde nicht gefunden", "The requested file was not found");
 98    is_present($page, "Запрашиваемый файл не найден", "The requested file was not found");
 99
100    $cookie=biscottiDiKaox($page);
101    $FreeForm = cut_str ( $page ,'id="dvifree">' ,'</form>' );
102
103	$act = "http://".cut_str ( $page ,'form action="http://' ,'"' );
104    $uid = slice($FreeForm,'name="uid" value="','"',2);
105    $md5crypt = cut_str($FreeForm,'="md5crypt" value="','"');
106   // $uid2 = cut_str($FreeForm,'name="uid2" value="','"');
107    $uid5 = cut_str($FreeForm,'name="uid5" value="','"');
108    $name = cut_str($FreeForm,'name="name" value="','"');
109    $pin = cut_str($FreeForm,' name="pin" value="','"');
110    $realuid = cut_str($FreeForm,'e="realuid" value="','"');
111    $realname = cut_str($FreeForm,'="realname" value="','"');
112    $host = cut_str($FreeForm,'name="host" value="','"');
113    $ssserver = cut_str($FreeForm,'="ssserver" value="','"');
114    $sssize = cut_str($FreeForm,'me="sssize" value="','"');
115
116
117    $post['uid']=$uid;
118    $post['md5crypt']=$md5crypt;
119    $post['frameset']='Download file';
120  //  $post['uid2']=$uid2;
121    $post['uid5']=$uid5;
122 //   $post['uid']=$uid2;
123    $post['name']=$name;
124    $post['pin']=$pin;
125    $post['realuid']=$realuid;
126    $post['realname']=$realname;
127    $post['host']=$host;
128    $post['ssserver']=$ssserver;
129    $post['sssize']=$sssize;
130    $post['optiondir']='';
131    $post['fix']='1';
132
133	$Url=parse_url($act);
134 $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, $cookie, $post, 0, $_GET["proxy"],$pauth);
135	$cookie.= " ".GetCookies($page);
136	
137if (stristr($page,"cap.php?"))
138    {
139    $imagecode = cut_str($page,"<img src='http://letitbit.net/cap.php?jpg=","'");
140    $img = 'http://letitbit.net/cap.php?jpg='.$imagecode;
141    $Url = parse_url($img);
142    $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $LINK, $cookie, 0, 0, $_GET["proxy"],$pauth);
143
144    $headerend = strpos($page,"\r\n\r\n");
145    $pass_img = substr($page,$headerend+9);
146    write_file($options['download_dir']."letitbit_captcha.jpg", $pass_img);
147
148    $code = '<form method="post" action="'.$PHP_SELF.(isset($_GET["audl"]) ? "?audl=doum" : "").'">'.$nn;
149    $code .= '<input type="hidden" name="link" value="'.urlencode($LINK).'">'.$nn;
150    $code .= '<input type="hidden" name="post" value="'.urlencode(serialize($post)).'">'.$nn;
151    $code .= '<input type="hidden" name="step" value="1">'.$nn;
152    $code .= '<input type="hidden" name="cookie" value="'.urlencode($cookie).'">'.$nn;
153    $code .= 'Please enter : <img src="'.$options['download_dir'].'letitbit_captcha.jpg?'.rand(1,10000).'"><br><br>'.$nn;
154    $code .= '<input type="text" name="captcha"> <input type="submit" value="Download">'.$nn;
155    $code .= '</form>';
156    echo $code;
157
158    }
159  else
160    {
161    html_error("Image code not found", 0);
162    }
163
164}
165}
166function biscottiDiKaox($content)
167 {
168     preg_match_all("/Set-Cookie: (.*)\n/",$content,$matches);
169     foreach ($matches[1] as $coll) {
170     $bis0=split(";",$coll);
171     $bis1=$bis0[0]."; ";
172     $bis2=split("=",$bis1);
173     $cek=" ".$bis2[0]."="; 
174     if(strpos($bis1,"=deleted") || strpos($bis1,$cek.";")) {
175     }else{
176    if  (substr_count($bis,$cek)>0)
177    {$patrn=" ".$bis2[0]."=[^ ]+";
178    $bis=preg_replace("/$patrn/"," ".$bis1,$bis);     
179    } else {$bis.=$bis1;}}}  
180    $bis=str_replace("  "," ",$bis);     
181    return rtrim($bis);
182 }
183 // tweaked cutstr with pluresearch functionality
184function slice($str, $left, $right,$cont=1)
185    {
186    for($iii=1;$iii<=$cont;$iii++){
187    $str = substr ( stristr ( $str, $left ), strlen ( $left ) );
188    }
189    $leftLen = strlen ( stristr ( $str, $right ) );
190    $leftLen = $leftLen ? - ($leftLen) : strlen ( $str );
191    $str = substr ( $str, 0, $leftLen );
192    return $str;
193}
194/*************************\
195 WRITTEN BY KAOX 05-dec-09
196\*************************/
197?>