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

/hosts/download/sharingmatrix_com.php

https://github.com/gartz/RapidLeetch
PHP | 173 lines | 152 code | 17 blank | 4 comment | 18 complexity | c71df059531f07e090c3b6941af41fdf MD5 | raw file
  1. <?php
  2. if (!defined('RAPIDLEECH'))
  3. {
  4. require_once("index.html");
  5. exit;
  6. }
  7. if (($_GET["premium_acc"] == "on" && $_GET["premium_user"] && $_GET["premium_pass"]) || ($_GET["premium_acc"] == "on" && $premium_acc["sharingmatrix"]["user"] && $premium_acc["sharingmatrix"]["pass"]))
  8. {
  9. $lg='http://sharingmatrix.com/ajax_scripts/login.php?email='.$premium_acc["sharingmatrix"]["user"].'&password='.$premium_acc["sharingmatrix"]["pass"].'&remember_me=false';
  10. $Url=parse_url($lg);
  11. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://sharingmatrix.com/login", 0, 0, 0, $_GET["proxy"],$pauth);
  12. is_page($page);
  13. $cookie = "PHPSESSID=".cut_str ( $page ,'Set-Cookie: PHPSESSID=' ,';' );
  14. $snap = cut_str ( $page ,"\r\n\r\n" ,"\r\n\r\n" );
  15. $st=explode("\r\n",$snap);
  16. $st= join("",$st);
  17. if( $st !== "110" ){
  18. html_error( "Bad username/password combination" , 0 );
  19. }
  20. $Url=parse_url($LINK);
  21. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  22. is_page($page);
  23. $snap = cut_str ( $page ,"sUrl='http://" ,"'" );
  24. is_present($page,"File has been deleted", "File has been deleted", 0);
  25. if($snap) html_error("download link not foun , please verify the link in your browser" , 0 );
  26. $FileName = cut_str ( $page ,'link_name=' ,'&' );
  27. $Url=parse_url("http://".$snap);
  28. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  29. is_page($page);
  30. $sv = cut_str ( $page ,'serv:"' ,'"' );
  31. $hs = cut_str ( $page ,'hash:"' ,'"' );
  32. $dwn=$sv."/download/".$hs."/0/";
  33. $Url=parse_url($dwn);
  34. $loc = "$PHP_SELF?filename=" . urlencode ( $FileName ) .
  35. "&force_name=".urlencode($FileName) .
  36. "&host=" . $Url ["host"] .
  37. "&port=" . $Url ["port"] .
  38. "&path=" . urlencode ( $Url ["path"] . ($Url ["query"] ? "?" . $Url ["query"] : "") ) .
  39. "&referer=" . urlencode ( $Referer ) .
  40. "&email=" . ($_GET ["domail"] ? $_GET ["email"] : "") .
  41. "&partSize=" . ($_GET ["split"] ? $_GET ["partSize"] : "") .
  42. "&method=" . $_GET ["method"] .
  43. "&proxy=" . ($_GET ["useproxy"] ? $_GET ["proxy"] : "") .
  44. "&saveto=" . $_GET ["path"] .
  45. "&link=" . urlencode ( $LINK ) .
  46. ($_GET ["add_comment"] == "on" ? "&comment=" . urlencode ( $_GET ["comment"] ) : "") .
  47. $auth .
  48. ($pauth ? "&pauth=$pauth" : "") .
  49. "&cookie=" . urlencode($cookie) ;
  50. insert_location ( $loc );
  51. }
  52. else
  53. {
  54. if( $_POST['step'] == "1")
  55. {
  56. @unlink(urldecode($_POST["delete"]));
  57. $Url=parse_url("http://sharingmatrix.com/ajax_scripts/verifier.php");
  58. $post=array();
  59. $post["?&code"]= $_POST["captcha"];
  60. $cookie=urldecode($_POST["cookie"]);
  61. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, $post, 0, $_GET["proxy"],$pauth);
  62. is_page($page);
  63. $snap = substr ( stristr ( $page, "\r\n\r\n" ), strlen ( "\r\n\r\n" ) );
  64. $st=explode("\r\n",$snap);
  65. $st= join("",$st);
  66. if( $st !== "710" ){
  67. html_error( "Captcha incorrect! Return to main and reattempt" , 0 );
  68. }
  69. $Url=parse_url("http://sharingmatrix.com/ajax_scripts/dl.php");
  70. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  71. is_page($page);
  72. preg_match('/(\d{5})\r/i', $page, $mh);
  73. $did=$mh[1];
  74. $id=$_POST["id"];
  75. $FileName = urldecode($_POST["filename"]);
  76. $Url=parse_url("http://sharingmatrix.com/ajax_scripts/_get.php?link_id=".$id."&link_name=".$FileName."&dl_id=".$did."&password=");
  77. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  78. is_page($page);
  79. $sv = cut_str ( $page ,'serv:"' ,'"' );
  80. $hs = cut_str ( $page ,'hash:"' ,'"' );
  81. $dwn=$sv."/download/".$hs."/".$did."/";
  82. $Url=parse_url($dwn);
  83. insert_timer ( 60, "The file is being prepared.", "", true );
  84. $loc = "$PHP_SELF?filename=" . urlencode ( $FileName ) .
  85. "&force_name=".urlencode($FileName) .
  86. "&host=" . $Url ["host"] .
  87. "&port=" . $Url ["port"] .
  88. "&path=" . urlencode ( $Url ["path"] . ($Url ["query"] ? "?" . $Url ["query"] : "") ) .
  89. "&referer=" . urlencode ( $Referer ) .
  90. "&email=" . ($_GET ["domail"] ? $_GET ["email"] : "") .
  91. "&partSize=" . ($_GET ["split"] ? $_GET ["partSize"] : "") .
  92. "&method=" . $_GET ["method"] .
  93. "&proxy=" . ($_GET ["useproxy"] ? $_GET ["proxy"] : "") .
  94. "&saveto=" . $_GET ["path"] .
  95. "&link=" . urlencode ( $LINK ) .
  96. ($_GET ["add_comment"] == "on" ? "&comment=" . urlencode ( $_GET ["comment"] ) : "") .
  97. $auth .
  98. ($pauth ? "&pauth=$pauth" : "") .
  99. "&cookie=" . urlencode($cookie) ;
  100. insert_location ( $loc );
  101. }else{
  102. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, 0, 0, $_GET["proxy"],$pauth);
  103. is_page($page);
  104. is_present($page,"File has been deleted", "File has been deleted", 0);
  105. if($snap) html_error("download link not foun , please verify the link in your browser" , 0 );
  106. $cookie = GetCk($page);
  107. preg_match('/\/file\/(\d+)/i', $LINK, $mh);
  108. $id = $mh[1];
  109. $req="http://sharingmatrix.com/ajax_scripts/download.php?type_membership=free&link_id=".$id ;
  110. $Url=parse_url($req);
  111. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  112. is_page($page);
  113. $tmp=rand(1000,9000);
  114. $link_name = cut_str ( $page ,"link_name = '" ,"'" );
  115. $Url=parse_url("http://sharingmatrix.com/ajax_scripts/check_timer.php?tmp=".$tmp);
  116. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  117. is_page($page);
  118. $imgcod=cut_str($page,"img:","\r");
  119. $img_url="http://sharingmatrix.com/images/captcha/".$imgcod.".jpg";
  120. $Url=parse_url($img_url);
  121. $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
  122. is_page($page);
  123. $headerend = strpos($page,"JFIF");
  124. $pass_img = substr($page,$headerend-6);
  125. if($options["download_dir"]){
  126. $imgfile=$options["download_dir"]."sharingmatrix_captcha.jpg";
  127. }else{
  128. $imgfile=download_dir."sharingmatrix_captcha.jpg";
  129. }
  130. write_file($imgfile, $pass_img);
  131. $code = '<form method="post" action="'.$PHP_SELF.(isset($_GET["audl"]) ? "?audl=doum" : "").'">'.$nn;
  132. $code .= '<input type="hidden" name="step" value="1">'.$nn;
  133. $code .= '<input type="hidden" name="link" value="'.urlencode($LINK).'">'.$nn;
  134. $code .= '<input type="hidden" name="id" value="'.$id.'">'.$nn;
  135. $code .= '<input type="hidden" name="filename" value="'.urlencode($link_name).'">'.$nn;
  136. $code .= '<input type="hidden" name="cookie" value="'.urlencode($cookie).'">'.$nn;
  137. $code .= 'Please enter : <img src="'.$imgfile.'?'.rand(1,10000).'"><br><br>'.$nn;
  138. $code .= '<input type="text" name="captcha">'.$nn;
  139. $code .= '<input type="hidden" name="delete" value="'.urlencode($imgfile).'"> <input type="submit" value="Download">'.$nn;
  140. $code .= '</form>';
  141. echo ($code);
  142. }
  143. }
  144. function GetCk($content)
  145. {
  146. $parthead = preg_replace('/Set-Cookie: .+deleted.+|Set-Cookie: .+=;.+/i', '', $content);
  147. preg_match_all('/Set-Cookie: (.*);/U',$parthead,$temp);
  148. $cookie = $temp[1];
  149. $cook = implode('; ',$cookie);
  150. return $cook;
  151. }
  152. /*************************\
  153. WRITTEN by kaox 08-oct-2009
  154. FIXED by kaox 22-mar-2010
  155. \*************************/
  156. ?>