diff --git a/.htaccess b/.htaccess index 194fbbc..a951e3a 100644 --- a/.htaccess +++ b/.htaccess @@ -1,6 +1,6 @@ order deny,allow - + deny from all @@ -29,10 +29,6 @@ allow from all allow from all - -allow from all - - allow from all @@ -43,4 +39,12 @@ allow from all deny from all - \ No newline at end of file + + +#CGI Auth Fix + + Options +SymLinksIfOwnerMatch + RewriteEngine on + RewriteCond %{HTTP:Authorization} !^$ + RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + diff --git a/audl.php b/audl.php index 138e7a3..7d3f598 100644 --- a/audl.php +++ b/audl.php @@ -1,33 +1,13 @@   - + + + diff --git a/auul.php b/auul.php index bf6ec6f..a3065a2 100644 --- a/auul.php +++ b/auul.php @@ -1,37 +1,19 @@
diff --git a/classes/.htaccess b/classes/.htaccess index 6c073da..d8cdd32 100644 --- a/classes/.htaccess +++ b/classes/.htaccess @@ -1,13 +1,10 @@ order deny,allow - - deny from all - - -deny from all + +allow from all allow from all - \ No newline at end of file + diff --git a/classes/ftp.php b/classes/ftp.php index 20462d4..4b0c332 100644 --- a/classes/ftp.php +++ b/classes/ftp.php @@ -20,17 +20,17 @@ function getftpurl($host, $port, $url, $saveToFile = 0) { $server = "$host:$port"; if (empty($host) || empty($port) || !$ftp->SetServer($host, (int) $port)) { $ftp->quit(); - $lastError = sprintf(lang(79), $server) . '
' . lang(78) . '

'; + $lastError = sprintf(lang(79), $server); return FALSE; } else { if (!$ftp->connect()) { $ftp->quit(); - $lastError = sprintf(lang(79), $server) . '
' . lang(78) . '

'; + $lastError = sprintf(lang(79), $server); return FALSE; } else { if (!$ftp->login()) { $ftp->quit(); - $lastError = lang(80) . '
' . lang(78) . '

'; + $lastError = lang(80); return FALSE; } else { echo('

'); @@ -74,7 +74,11 @@ function getftpurl($host, $port, $url, $saveToFile = 0) { $saveToFile = str_replace($filetype, $options['rename_these_filetypes_to'], $saveToFile); } - if (file_exists($saveToFile)) $saveToFile = dirname($saveToFile) . PATH_SPLITTER . time() . '_' . basename($saveToFile); + if (@file_exists($saveToFile) && $options['bw_save']) { + // Skip in audl. + if (isset($_GET['audl'])) echo ''; + html_error(lang(99) . ': ' . link_for_file($saveToFile), 0); + } elseif (@file_exists($saveToFile)) $saveToFile = dirname($saveToFile) . PATH_SPLITTER . time() . '_' . basename($saveToFile); printf(lang(83), basename($saveToFile), bytesToKbOrMbOrGb($fileSize)); echo "
"; require_once(TEMPLATE_DIR . '/transloadui.php'); diff --git a/classes/http.php b/classes/http.php index ebf470b..9667600 100644 --- a/classes/http.php +++ b/classes/http.php @@ -83,25 +83,20 @@ function is_page($lpage) { function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveToFile = 0, $proxy = 0, $pauth = 0, $auth = 0, $scheme = 'http', $resume_from = 0, $XMLRequest = 0) { global $nn, $lastError, $Resume, $bytesReceived, $fp, $fs, $force_name, $options; - $scheme .= '://'; + $scheme = strtolower($scheme) . '://'; if (($post !== 0) && ($scheme == 'http://' || $scheme == 'https://')) { $method = 'POST'; $postdata = is_array($post) ? formpostdata($post) : $post; - $length = strlen($postdata); - $content_tl = "Content-Type: application/x-www-form-urlencoded$nn" . "Content-Length: $length$nn"; } else { $method = 'GET'; - $content_tl = $postdata = ''; + $postdata = ''; } - $cookies = ''; if (!empty($cookie)) { - if (is_array ($cookie)) { - if (count($cookie) > 0) $cookies = 'Cookie: ' . CookiesToStr($cookie) . $nn; - } else $cookies = 'Cookie: ' . trim($cookie) . $nn; + if (is_array($cookie)) $cookies = (count($cookie) > 0) ? CookiesToStr($cookie) : 0; + else $cookies = trim($cookie); } - $referer = $referer ? "Referer: $referer$nn" : ''; if ($scheme == 'https://') { $scheme = 'ssl://'; @@ -111,27 +106,33 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT if ($proxy) { list($proxyHost, $proxyPort) = explode(':', $proxy, 2); $host = $host . ($port != 80 && ($scheme != 'ssl://' || $port != 443) ? ':' . $port : ''); - $url = $scheme . $host . $url; + $url = "$scheme$host$url"; } if ($scheme != 'ssl://') $scheme = ''; - $http_auth = (!empty($auth)) ? "Authorization: Basic $auth$nn" : ''; - $proxyauth = (!empty($pauth)) ? "Proxy-Authorization: Basic $pauth$nn" : ''; - $request = array(); $request[] = $method . ' ' . str_replace(' ', '%20', $url) . ' HTTP/1.1'; $request[] = "Host: $host"; - $request[] = 'User-Agent: Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.12'; + $request[] = 'User-Agent: Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16'; $request[] = 'Accept: */*'; + if (!empty($referer)) $request[] = "Referer: $referer"; + if (!empty($cookies)) $request[] = "Cookie: $cookies"; $request[] = 'Accept-Language: en-US;q=0.7,en;q=0.3'; $request[] = 'Accept-Charset: utf-8,windows-1251;q=0.7,*;q=0.7'; $request[] = 'Pragma: no-cache'; $request[] = 'Cache-Control: no-cache'; - if ($Resume ['use'] === TRUE) $request[] = 'Range: bytes=' . $Resume ['from'] . '-'; + if ($Resume['use'] === TRUE) $request[] = 'Range: bytes=' . $Resume['from'] . '-'; + if (!empty($auth)) $request[] = "Authorization: Basic $auth"; + if (!empty($pauth)) $request[] = "Proxy-Authorization: Basic $pauth"; + if ($method == 'POST') { + if (!empty($referer) && stripos($referer, "\nContent-Type: ") === false) $request[] = 'Content-Type: application/x-www-form-urlencoded'; + $request[] = 'Content-Length: ' . strlen($postdata); + } if ($XMLRequest) $request[] = 'X-Requested-With: XMLHttpRequest'; + $request[] = 'Connection: Close'; - $request = implode($nn, $request) . $nn . $http_auth . $proxyauth . $referer . $cookies . $content_tl . 'Connection: Close' . $nn . $nn . $postdata; + $request = implode($nn, $request). $nn . $nn . $postdata; $errno = 0; $errstr = ''; @@ -141,6 +142,7 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT if (!$fp) { + if (!function_exists('stream_socket_client')) html_error('[ERROR] stream_socket_client() is disabled.'); $dis_host = !empty($proxyHost) ? $proxyHost : $host; $dis_port = !empty($proxyPort) ? $proxyPort : $port; html_error(sprintf(lang(88), $dis_host, $dis_port)); @@ -174,6 +176,8 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT $len = strlen($header); if (!$header || $len == $llen) { $lastError = lang(91); + stream_socket_shutdown($fp, STREAM_SHUT_RDWR); + fclose($fp); return false; } $llen = $len; @@ -192,18 +196,23 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT } else $chkref = false; $found = false; if ($chkhost || $chkref) foreach ($GLOBALS['host'] as $site => $file) { - if ($chkhost && host_matches($site, $cbhost)) $found = true; - elseif ($chkref && host_matches($site, $cbrefhost)) $found = true; + if ($chkhost && host_matches($site, $cbhost)) { + $found = true; + break; + } elseif ($chkref && host_matches($site, $cbrefhost)) { + $found = true; + break; + } + } if ($found) { require_once(HOST_DIR . 'DownloadClass.php'); require_once(HOST_DIR . "download/$file"); $class = substr($file, 0, -4); $firstchar = substr($file, 0, 1); if ($firstchar > 0) $class = "d$class"; - if (!class_exists($class) || !method_exists($class, 'CheckBack')) break; // is_callable(array($class , 'CheckBack')) + if (class_exists($class) && method_exists($class, 'CheckBack')) { // is_callable(array($class , 'CheckBack')) $hostClass = new $class(false); $hostClass->CheckBack($header); - break; } } unset($cbhost, $cbrefhost, $chkhost, $chkref, $found); @@ -243,17 +252,15 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT return FALSE; } - if ($force_name) { - $FileName = $force_name; - $saveToFile = dirname($saveToFile) . PATH_SPLITTER . $FileName; - } else { + if ($force_name) $FileName = $force_name; + else { $ContentDisposition = trim(cut_str($header, "\nContent-Disposition: ", "\n")) . "\n"; if ($ContentDisposition && stripos($ContentDisposition, 'filename=') !== false) { $FileName = trim(trim(trim(trim(trim(cut_str($ContentDisposition, 'filename=', "\n")), '='), '?'), ';'), '"'); - if (strpos($FileName, '/') !== false) $FileName = basename($FileName); - $saveToFile = dirname($saveToFile) . PATH_SPLITTER . $FileName; - } + } else $FileName = $saveToFile; } + $FileName = str_replace(array_merge(range(chr(0), chr(31)), str_split("<>:\"/|?*\x5C\x7F")), '', basename(trim($FileName))); + $saveToFile = dirname($saveToFile) . PATH_SPLITTER . $FileName; if (!empty($options['rename_prefix'])) { $File_Name = $options['rename_prefix'] . '_' . basename($saveToFile); @@ -308,14 +315,14 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT $fileSize = bytesToKbOrMbOrGb($fileSize); } else $fileSize = bytesToKbOrMbOrGb($bytesTotal); $chunkSize = GetChunkSize($bytesTotal); - echo(lang(104) . ' ' . basename($saveToFile) . ', ' . lang(56) . ' ' . $fileSize . '...
'); + echo(lang(104) . ' ' . basename($saveToFile) . ', ' . lang(56) . " $fileSize...
"); //$scriptStarted = false; require_once(TEMPLATE_DIR . '/transloadui.php'); if ($Resume['use'] === TRUE) { $received = bytesToKbOrMbOrGb(filesize($saveToFile)); $percent = round($Resume['from'] / ($bytesTotal + $Resume['from']) * 100, 2); - echo '"; + echo ""; //$scriptStarted = true; flush(); } @@ -331,7 +338,7 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT $bytesReceived += $bytesSaved; } else { $lastError = sprintf(lang(105), basename($saveToFile)); - unlink($saveToFile); + // unlink($saveToFile); return false; } if ($bytesReceived >= $bytesTotal) $percent = 100; @@ -340,29 +347,27 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT $received = bytesToKbOrMbOrGb($bytesReceived + $Resume['from']); $time = getmicrotime() - $timeStart; $chunkTime = $time - $lastChunkTime; - $chunkTime = $chunkTime ? $chunkTime : 1; + $chunkTime = (!($chunkTime < 0) && $chunkTime > 0) ? $chunkTime : 1; $lastChunkTime = $time; - $speed = @round($chunkSize / 1024 / $chunkTime, 2); - /*if (!$scriptStarted) { - echo('"; + $speed = @round(($bytesReceived - $last) /*$chunkSize*/ / 1024 / $chunkTime, 2); + echo ""; $last = $bytesReceived; } + if (!empty($bytesTotal) && ($bytesReceived + $chunkSize) > $bytesTotal) $chunkSize = $bytesTotal - $bytesReceived; } else $page .= $data; - } while (strlen($data) > 0); - //echo(''); + } while (!feof($fp) && strlen($data) > 0); if ($saveToFile) { flock($fs, LOCK_UN); fclose($fs); if ($bytesReceived <= 0) { $lastError = lang(106); + stream_socket_shutdown($fp, STREAM_SHUT_RDWR); fclose($fp); return FALSE; } } + stream_socket_shutdown($fp, STREAM_SHUT_RDWR); fclose($fp); if ($saveToFile) { return array('time' => sec2time(round($time)), 'speed' => @round($bytesTotal / 1024 / (getmicrotime() - $timeStart), 2), 'received' => true, 'size' => $fileSize, 'bytesReceived' => ($bytesReceived + $Resume['from']), 'bytesTotal' => ($bytesTotal + $Resume ['from']), 'file' => $saveToFile); @@ -379,6 +384,7 @@ function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveT function cURL($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $opts = 0) { global $pauth; + static $ch; if (empty($link) || !is_string($link)) html_error(lang(24)); if (!extension_loaded('curl') || !function_exists('curl_init') || !function_exists('curl_exec')) html_error('cURL isn\'t enabled or cURL\'s functions are disabled'); $arr = explode("\r\n", $referer); @@ -388,16 +394,18 @@ function cURL($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $opts = 0) unset($arr[0]); $header = array_filter(array_map('trim', $arr)); } + $link = str_replace(array(' ', "\r", "\n"), array('%20'), $link); $opt = array(CURLOPT_HEADER => 1, CURLOPT_SSL_VERIFYPEER => 0, CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FOLLOWLOCATION => 0, CURLOPT_FAILONERROR => 0, - CURLOPT_FORBID_REUSE => 1, CURLOPT_FRESH_CONNECT => 1, - CURLINFO_HEADER_OUT => 1, CURLOPT_USERAGENT => 'Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.12'); + CURLOPT_FORBID_REUSE => 0, CURLOPT_FRESH_CONNECT => 0, + CURLINFO_HEADER_OUT => 1, CURLOPT_URL => $link, + CURLOPT_USERAGENT => 'Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16'); if (!empty($referer)) $opt[CURLOPT_REFERER] = $referer; if (!empty($cookie)) $opt[CURLOPT_COOKIE] = (is_array($cookie) ? CookiesToStr($cookie) : trim($cookie)); // Send more headers... - $headers = array('Accept-Language: en-US;q=0.7,en;q=0.3', 'Accept-Charset: utf-8,windows-1251;q=0.7,*;q=0.7', 'Pragma: no-cache', 'Cache-Control: no-cache', 'Connection: Close'); + $headers = array('Accept-Language: en-US;q=0.7,en;q=0.3', 'Accept-Charset: utf-8,windows-1251;q=0.7,*;q=0.7', 'Pragma: no-cache', 'Cache-Control: no-cache', 'Connection: Keep-Alive'); if (count($header) > 0) $headers = array_merge($headers, $header); $opt[CURLOPT_HTTPHEADER] = $headers; @@ -409,7 +417,6 @@ function cURL($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $opts = 0) $opt[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC; $opt[CURLOPT_USERPWD] = base64_decode($auth); } - if (isset($_GET['useproxy']) && !empty($_GET['proxy'])) { $opt[CURLOPT_HTTPPROXYTUNNEL] = false; $opt[CURLOPT_PROXY] = $_GET['proxy']; @@ -418,16 +425,16 @@ function cURL($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $opts = 0) $opt[CURLOPT_CONNECTTIMEOUT] = $opt[CURLOPT_TIMEOUT] = 120; if (is_array($opts) && count($opts) > 0) foreach ($opts as $O => $V) $opt[$O] = $V; - $link = str_replace(array(' ', "\r", "\n"), array('%20'), $link); - $ch = curl_init($link); + if (!isset($ch)) $ch = curl_init(); + foreach ($opt as $O => $V) curl_setopt($ch, $O, $V); // Using this instead of 'curl_setopt_array' $page = curl_exec($ch); $info = curl_getinfo($ch); $errz = curl_errno($ch); $errz2 = curl_error($ch); - curl_close($ch); + // curl_close($ch); - if (substr($page, 9, 3) == '100') $page = preg_replace("@^HTTP/1\.1 100 Continue\r\n\r\n(HTTP/1\.1 \d+ [^\r|\n]+)@i", "$1", $page, 1); // The "100 Continue" can break some functions in plugins, lets remove it... + if (substr($page, 9, 3) == '100' || !empty($opt[CURLOPT_HTTPPROXYTUNNEL])) $page = preg_replace("@^HTTP/1\.[01] \d{3}(?:\s[^\r\n]+)?\r\n\r\n(HTTP/1\.[01] \d+ [^\r\n]+)@i", "$1", $page, 1); // The "100 Continue" or "200 Connection established" can break some functions in plugins, lets remove it... if ($errz != 0) html_error("[cURL:$errz] $errz2"); return $page; @@ -470,19 +477,25 @@ function GetCookies($content) { * Function to get cookies & converted into array * @param string The content you want to get the cookie from * @param array Array of cookies to be updated [optional] - * @param bool Options to remove temporary cookie (usually it named as 'deleted') [optional] + * @param bool Options to remove "deleted" or expired cookies (usually it named as 'deleted') [optional] * @param mixed The default name for temporary cookie, values are accepted in an array [optional] */ function GetCookiesArr($content, $cookie=array(), $del=true, $dval=array('','deleted')) { if (!is_array($cookie)) $cookie = array(); if (($hpos = strpos($content, "\r\n\r\n")) > 0) $content = substr($content, 0, $hpos); // We need only the headers - if (empty($content) || stripos($content, "\nSet-Cookie: ") === false || !preg_match_all ('/\nSet-Cookie: (.*)(;|\r\n)/U', $content, $temp)) return $cookie; + if (empty($content) || stripos($content, "\nSet-Cookie: ") === false || !preg_match_all ('/\nSet-Cookie: ([^\r\n]+)/', $content, $temp)) return $cookie; foreach ($temp[1] as $v) { + if (strpos($v, ';') !== false) list($v, $p) = explode(';', $v, 2); + else $p = false; $v = explode('=', $v, 2); $cookie[$v[0]] = $v[1]; if ($del) { if (!is_array($dval)) $dval = array($dval); if (in_array($v[1], $dval)) unset($cookie[$v[0]]); + elseif (!empty($p)) { + if (stripos($p, 'Max-Age=') !== false && preg_match('/[ \;]?Max-Age=(-?\d+)/i', $p, $P) && (int)$P[1] < 1) unset($cookie[$v[0]]); + elseif (stripos($p, 'expires=') !== false && preg_match('/[ \;]?expires=([a-zA-Z]{3}, \d{1,2} [a-zA-Z]{3} \d{4} \d{1,2}:\d{1,2}:\d{1,2} GMT)/i', $p, $P) && ($P = strtotime($P[1])) !== false && $P <= time()) unset($cookie[$v[0]]); + } } } return $cookie; @@ -511,6 +524,8 @@ function StrToCookies($cookies, $cookie=array(), $del=true, $dval=array('','dele } function GetChunkSize($fsize) { + if ($fsize <= 0) return 4096; + if ($fsize < 4096) return (int)$fsize; if ($fsize <= 1024 * 1024) return 4096; if ($fsize <= 1024 * 1024 * 10) return 4096 * 10; if ($fsize <= 1024 * 1024 * 40) return 4096 * 30; @@ -527,9 +542,9 @@ function GetChunkSize($fsize) { } function upfile($host, $port, $url, $referer, $cookie, $post, $file, $filename, $fieldname, $field2name = '', $proxy = 0, $pauth = 0, $upagent = 0, $scheme = 'http') { - global $nn, $lastError, $sleep_time, $sleep_count; + global $nn, $lastError, $sleep_time, $sleep_count, $fp, $fs; - if (empty($upagent)) $upagent = 'Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.12'; + if (empty($upagent)) $upagent = 'Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16'; $scheme .= '://'; $bound = '--------' . md5(microtime()); @@ -577,7 +592,7 @@ function upfile($host, $port, $url, $referer, $cookie, $post, $file, $filename, if ($proxy) { list($proxyHost, $proxyPort) = explode(':', $proxy, 2); $host = $host . ($port != 80 && ($scheme != 'ssl://' || $port != 443) ? ':' . $port : ''); - $url = $scheme . $host . $url; + $url = "$scheme$host$url"; } if ($scheme != 'ssl://') $scheme = ''; @@ -661,10 +676,11 @@ function upfile($host, $port, $url, $referer, $cookie, $post, $file, $filename, $time = getmicrotime() - $timeStart; $chunkTime = $time - $lastChunkTime; $chunkTime = $chunkTime ? $chunkTime : 1; + $chunkTime = (!($chunkTime < 0) && $chunkTime > 0) ? $chunkTime : 1; $lastChunkTime = $time; $speed = round($sendbyte / 1024 / $chunkTime, 2); $percent = round($totalsend / $fileSize * 100, 2); - echo '\n"; + echo "\n"; flush(); } //echo(''); diff --git a/classes/js.js b/classes/js.js index 0c852d4..dbac167 100644 --- a/classes/js.js +++ b/classes/js.js @@ -9,10 +9,10 @@ if (top != self) { function new_transload_window() { var tmp = (new Date()).getTime(); - $('form[name="transload"]').attr('target', 'rapidleech_' + tmp); + $('form[name=transload]').attr('target', 'rapidleech_' + tmp); var options = 'width=700,height=320,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no'; window.open('', 'rapidleech_' + tmp, options); - window.setTimeout('$(\'form[name="transload"]\').submit();', 200); + window.setTimeout('$(\'form[name=transload]\').submit();', 200); } function table_filelist_refresh_headers() { @@ -70,7 +70,7 @@ function deleteCookie(name, path, domain) { } function clearSettings() { - clear('domail', 'email', 'split', 'method', 'partSize', 'useproxy', 'proxy', 'saveto', 'path', 'savesettings'); + clear('domail', 'email', 'saveto', 'path', 'useproxy', 'proxy', 'proxyuser', 'proxypass', 'split', 'partSize', 'savesettings', 'clearsettings', 'premium_acc', 'premium_user', 'premium_pass'); $('#domail, #splitchkbox, #useproxy, #premium_acc, #saveto, #savesettings').prop('checked', false); $('#email, #proxyproxy, #proxyuser, #proxypass, #premium_user, #premium_pass').val(''); $('#emailtd, #splittd, #methodtd, #proxy, #premiumblock, #path, #clearsettings').hide(); @@ -78,7 +78,7 @@ function clearSettings() { } function clear() { - for (var i = 0; i < arguments.length; i++) document.cookie = arguments[i] + ' = ' + '; expires=Thu, 01-Jan-70 00:00:01 GMT'; + for (var i = 0; i < arguments.length; i++) document.cookie = arguments[i] + ' = ; expires=Thu, 01-Jan-70 00:00:01 GMT'; } //Match text @@ -172,11 +172,8 @@ function changeStatus(file, size) { } function checkFile(id) { - if (document.getElementById('files' + id).checked == true) { - document.getElementById('files' + id).checked = false; - } else { - document.getElementById('files' + id).checked = true; - } + if (document.getElementById('files' + id).checked == true) document.getElementById('files' + id).checked = false; + else document.getElementById('files' + id).checked = true; return false; } @@ -199,8 +196,8 @@ function startLinkCheck() { data: ({ submit: 'Check Links', links: $('#links').val(), - k: ($('#chk_k').is(':checked')) ? 1 : 0, - d: ($('#chk_d').is(':checked')) ? 1 : 0 + k: ($('#chk_k').prop('checked')) ? 1 : 0, + d: ($('#chk_d').prop('checked')) ? 1 : 0 }), beforeSend: function () { $('#linkchecker-results').hide(); diff --git a/classes/main.php b/classes/main.php index 501ffb4..1df0634 100644 --- a/classes/main.php +++ b/classes/main.php @@ -3,6 +3,10 @@ require('../deny.php'); exit; } + +// Load template functions +require_once(TEMPLATE_DIR . 'functions.php'); + // Render the main screen include(TEMPLATE_DIR.'header.php'); include(TEMPLATE_DIR.'main.php'); diff --git a/classes/options.php b/classes/options.php index da19a78..e42840e 100644 --- a/classes/options.php +++ b/classes/options.php @@ -69,11 +69,23 @@ break; case 'md5' : - if (!empty($options['disable_md5'])) break; + if (!empty($options['disable_hashing'])) break; require(CLASS_DIR . 'options/md5.php'); rl_md5(); break; + case 'crc32' : + if (!empty($options['disable_hashing'])) break; + require(CLASS_DIR . 'options/crc32.php'); + rl_crc32(); + break; + + case 'sha1' : + if (!empty($options['disable_hashing'])) break; + require(CLASS_DIR . 'options/sha1.php'); + rl_sha1(); + break; + case 'md5_change' : if (!empty($options['disable_md5_change'])) break; require(CLASS_DIR . 'options/md5change.php'); diff --git a/classes/options/.htaccess b/classes/options/.htaccess index e30ae10..c468487 100644 --- a/classes/options/.htaccess +++ b/classes/options/.htaccess @@ -1,9 +1,2 @@ order deny,allow - - deny from all - - - -deny from all - \ No newline at end of file diff --git a/classes/options/crc32.php b/classes/options/crc32.php new file mode 100644 index 0000000..05b3958 --- /dev/null +++ b/classes/options/crc32.php @@ -0,0 +1,32 @@ + +

+ + + + + +'; + elseif (preg_match('@\[([a-fA-F0-9]{8})\]@', $name, $fcrc) || preg_match('@_([a-fA-F0-9]{8})_@', $name, $fcrc) || preg_match('@\(([a-fA-F0-9]{8})\)@', $name, $fcrc) || preg_match('@\{([a-fA-F0-9]{8})\}@', $name, $fcrc)) { + $tstyle = ((!empty($fcrc[2]) || strtoupper($fcrc[1]) == $crc) ? ' style="color: green" title="'.lang(391).'">' : ' style="color: red" title="'.sprintf(lang(392),$fcrc[1]).'">'); + } else $tstyle = '>'; +?> + + + + + +\n
"; +} +?> \ No newline at end of file diff --git a/classes/options/md5.php b/classes/options/md5.php index 7d6e5b8..c1ae979 100644 --- a/classes/options/md5.php +++ b/classes/options/md5.php @@ -1,29 +1,26 @@
CRC32
      
- - - - - + + + + + $v) { - $file = $list[$v]; - if (file_exists($file["name"])) { + foreach ($_GET['files'] as $v) { + $file = $list[$v]; + if (file_exists($file['name'])) { ?> - - - - - - -
MD5
MD5
     
-
+ +   +    +    + \n
"; } ?> \ No newline at end of file diff --git a/classes/options/merge.php b/classes/options/merge.php index e3fbcb7..3b7a025 100644 --- a/classes/options/merge.php +++ b/classes/options/merge.php @@ -79,7 +79,7 @@ function merge_go() { } fclose ( $fs ); } - $path = realpath ( DOWNLOAD_DIR ) . '/'; + $path = realpath ( DOWNLOAD_DIR ) . PATH_SPLITTER; $filename = basename ( $data ['filename'] ); $partfiles = array (); $partsSize = 0; diff --git a/classes/options/sha1.php b/classes/options/sha1.php new file mode 100644 index 0000000..035ee5f --- /dev/null +++ b/classes/options/sha1.php @@ -0,0 +1,26 @@ + + + + + + + + + + + + + +\n
"; +} +?> \ No newline at end of file diff --git a/classes/options/split.php b/classes/options/split.php index be94f83..69569af 100644 --- a/classes/options/split.php +++ b/classes/options/split.php @@ -9,12 +9,12 @@ function rl_split() {
SHA1
     
@@ -28,7 +28,7 @@ function rl_split() { ?> + value="" /> @@ -77,91 +70,83 @@ function rl_split() { function split_go() { global $list, $options; - for($i = 0; $i < count ( $_POST ["files"] ); $i ++) { + for ($i = 0; $i < count($_POST['files']); $i++) { $split_ok = true; - $file = $list [$_POST ["files"] [$i]]; - $partSize = round ( ($_POST ["partSize"] [$i]) * 1024 * 1024 ); - $saveTo = ($options['download_dir_is_changeable'] ? stripslashes ( $_POST ["saveTo"] [$i] ) : realpath ( $options['download_dir'] )) . '/'; - $dest_name = basename ( $file ["name"] ); - $fileSize = filesize ( $file ["name"] ); - $totalParts = ceil ( $fileSize / $partSize ); - $crc = ($_POST ['crc_mode'] [$i] == 'file_read') ? dechex ( crc32 ( read_file ( $file ["name"] ) ) ) : (($_POST ['crc_mode'] [$i] == 'hash_file' && function_exists ( 'hash_file' )) ? hash_file ( 'crc32b', $file ["name"] ) : '111111'); - $crc = str_repeat ( "0", 8 - strlen ( $crc ) ) . strtoupper ( $crc ); - echo "Started to split file " . basename ( $file ["name"] ) . " parts of " . bytesToKbOrMbOrGb ( $partSize ) . ", Using Method - Total Commander...
"; - echo "Total Parts: " . $totalParts . "

"; - for($j = 1; $j <= $totalParts; $j ++) { - if (file_exists ( $saveTo . $dest_name . '.' . sprintf ( "%03d", $j ) )) { - echo "It is not possible to split the file. A piece already exists" . $dest_name . '.' . sprintf ( "%03d", $j ) . " !

"; + $file = $list[$_POST['files'][$i]]; + $partSize = round(($_POST['partSize'][$i]) * 1024 * 1024); + $saveTo = ($options['download_dir_is_changeable'] ? stripslashes($_POST['saveTo'][$i]) : realpath(DOWNLOAD_DIR) . '/'); + if (substr($saveTo, -1) != '/') $saveTo .= '/'; + $dest_name = basename($file['name']); + $fileSize = filesize($file['name']); + $totalParts = ceil($fileSize / $partSize); + $crc = ($_POST['crc_mode'][$i] == 'file_read') ? dechex(crc32(read_file($file['name']))) : (($_POST['crc_mode'][$i] == 'hash_file' && function_exists('hash_file')) ? hash_file('crc32b', $file['name']) : '111111'); + $crc = str_repeat('0', 8 - strlen($crc)) . strtoupper($crc); + echo "Started to split file $dest_name parts of " . bytesToKbOrMbOrGb($partSize) . ", Using Method - Total Commander...
"; + echo "Total Parts: $totalParts

"; + for($j = 1; $j <= $totalParts; $j++) { + if (file_exists("$saveTo$dest_name." . sprintf('%03d', $j))) { + echo "It is not possible to split the file. A piece already exists $dest_name." . sprintf('%03d', $j) . ' !

'; continue 2; } } - if (file_exists ( $saveTo . $dest_name . '.crc' )) { - echo "It is not possible to split the file. CRC file already exists" . $dest_name . '.crc' . " !

"; - } elseif (! is_file ( $file ["name"] )) { - echo "It is not possible to split the file. Source file not found" . $file ["name"] . " !

"; - } elseif (! is_dir ( $saveTo )) { - echo "It is not possible to split the file. Directory doesn't exist" . $saveTo . " !

"; - } elseif (! @write_file ( $saveTo . $dest_name . ".crc", "filename=" . $dest_name . "\r\n" . "size=" . $fileSize . "\r\n" . "crc32=" . $crc . "\r\n" )) { - echo "It is not possible to split the file. CRC Error" . $dest_name . ".crc" . " !

"; - } else { - $time = filemtime ( $saveTo . $dest_name . '.crc' ); - while ( isset ( $list [$time] ) ) { - $time ++; - } - $list [$time] = array ("name" => $saveTo . $dest_name . '.crc', "size" => bytesToKbOrMbOrGb ( filesize ( $saveTo . $dest_name . '.crc' ) ), "date" => $time ); + if (file_exists("$saveTo$dest_name.crc")) echo "It is not possible to split the file. CRC file already exists $dest_name.crc !

"; + elseif (!is_file($file['name'])) echo "It is not possible to split the file. Source file not found {$file['name']} !

"; + elseif (!is_dir($saveTo)) echo "It is not possible to split the file. Directory doesn't exist$saveTo !

"; + elseif (!@write_file("$saveTo$dest_name.crc", "filename=$dest_name\r\nsize=$fileSize\r\ncrc32=$crc\r\n")) echo "It is not possible to split the file. CRC Error$dest_name.crc" . " !

"; + else { + $time = filemtime("$saveTo$dest_name.crc"); + while (isset($list[$time])) $time++; + $list[$time] = array('name' => realpath("$saveTo$dest_name.crc"), 'size' => bytesToKbOrMbOrGb(filesize("$saveTo$dest_name.crc")), 'date' => $time); $split_buffer_size = 2 * 1024 * 1024; - $split_source = @fopen ( $file ["name"], "rb" ); - if (! $split_source) { - echo "It is not possible to open source file " . $file ["name"] . " !

"; + $split_source = @fopen($file['name'], 'rb'); + if (!$split_source) { + echo "It is not possible to open source file {$file['name']} !

"; continue; } - for($j = 1; $j <= $totalParts; $j ++) { - $split_dest = @fopen ( $saveTo . $dest_name . '.' . sprintf ( "%03d", $j ), "wb" ); - if (! $split_dest) { - echo "Error openning file " . $dest_name . '.' . sprintf ( "%03d", $j ) . " !

"; + for($j = 1; $j <= $totalParts; $j++) { + $part = sprintf('%03d', $j); + $part_name = "$dest_name.$part"; + $dest_file = $saveTo . $part_name; + $split_dest = @fopen($dest_file, 'wb'); + if (!$split_dest) { + echo "Error openning file $part_name !

"; $split_ok = false; break; } - $split_write_times = floor ( $partSize / $split_buffer_size ); - for($k = 0; $k < $split_write_times; $k ++) { - $split_buffer = fread ( $split_source, $split_buffer_size ); - if (fwrite ( $split_dest, $split_buffer ) === false) { - echo "Error writing the file " . $dest_name . '.' . sprintf ( "%03d", $j ) . " !

"; + $split_write_times = floor($partSize / $split_buffer_size); + for($k = 0; $k < $split_write_times; $k++) { + $split_buffer = fread($split_source, $split_buffer_size); + $split_written = fwrite($split_dest, $split_buffer); + if ($split_written === false || $split_written != strlen($split_buffer)) { + echo "Error writing the file $part_name !

"; $split_ok = false; break; } } $split_rest = $partSize - ($split_write_times * $split_buffer_size); if ($split_ok && $split_rest > 0) { - $split_buffer = fread ( $split_source, $split_rest ); - if (fwrite ( $split_dest, $split_buffer ) === false) { - echo "Error writing the file " . $dest_name . '.' . sprintf ( "%03d", $j ) . " !

"; + $split_buffer = fread($split_source, $split_rest); + $split_written = fwrite($split_dest, $split_buffer); + if ($split_written === false || $split_written != strlen($split_buffer)) { + echo "Error writing the file $part_name !

"; $split_ok = false; } } - fclose ( $split_dest ); + fclose($split_dest); if ($split_ok) { - $time = filemtime ( $saveTo . $dest_name . '.' . sprintf ( "%03d", $j ) ); - while ( isset ( $list [$time] ) ) { - $time ++; - } - $list [$time] = array ("name" => $saveTo . $dest_name . '.' . sprintf ( "%03d", $j ), "size" => bytesToKbOrMbOrGb ( filesize ( $saveTo . $dest_name . '.' . sprintf ( "%03d", $j ) ) ), "date" => $time ); - } - } - fclose ( $split_source ); - if ($split_ok) { - if ($_POST["del_ok"] && !$options['disable_deleting']) { - if (@unlink ( $file ["name"] )) { - unset ( $list [$_POST ["files"] [$i]] ); - echo "Source file deleted.

"; - } else { - echo "Source file isnot deleted!

"; - } + $time = filemtime($dest_file); + while (isset($list[$time])) $time++; + $list[$time] = array('name' => realpath($dest_file), 'size' => bytesToKbOrMbOrGb(filesize($dest_file)), 'date' => $time); } } - if (! updateListInFile ( $list )) { - echo "Couldn't update file list. Problem writing to file!

"; + fclose($split_source); + if ($split_ok && $_POST['del_ok'] && !$options['disable_deleting']) { + if (@unlink($file['name'])) { + unset($list[$_POST['files'][$i]]); + echo 'Source file deleted.

'; + } else echo 'Source file isnot deleted!

'; } + if (!updateListInFile($list)) echo "Couldn't update file list. Problem writing to file!

"; } } } diff --git a/classes/other.php b/classes/other.php index a7b7404..b939fd5 100644 --- a/classes/other.php +++ b/classes/other.php @@ -32,12 +32,14 @@ function login_check() { if ($options['login']) { function logged_user($ul) { foreach ($ul as $user => $pass) { - if ($_SERVER['PHP_AUTH_USER'] == $user && $_SERVER['PHP_AUTH_PW'] == $pass) return true; + if ($_SERVER['PHP_AUTH_USER'] == $user && isset($_SERVER['PHP_AUTH_PW']) && $_SERVER['PHP_AUTH_PW'] == $pass) return true; } return false; } - if ($options['login_cgi']) { - list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = @explode(':', base64_decode(substr((isset($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : $_SERVER['REDIRECT_HTTP_AUTHORIZATION']), 6)), 2); + if (empty($_SERVER['PHP_AUTH_USER']) && (!empty($_SERVER['HTTP_AUTHORIZATION']) || !empty($_SERVER['REDIRECT_HTTP_AUTHORIZATION']))) { + $auth = !empty($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; + if (stripos($auth, 'Basic ') === 0 && strpos(($auth = base64_decode(substr($auth, 6))), ':') > 0) list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', $auth, 2); + unset($auth); } if (empty($_SERVER['PHP_AUTH_USER']) || !logged_user($options['users'])) { header('WWW-Authenticate: Basic realm="RAPIDLEECH PLUGMOD"'); @@ -79,12 +81,16 @@ function insert_location($inputs, $action = 0) { } } -function pause_download() { - global $pathWithName, $PHP_SELF, $_GET, $nn, $bytesReceived, $fs, $fp; - $status = connection_status(); - if (($status == 2 || $status == 3) && $pathWithName && $bytesReceived > -1) { +function pause_download() { // To make sure that the files pointers and streams are closed and unlocked. + global $PHP_SELF, $fs, $fp, $file, $pathWithName; + if (!empty($fs) && is_resource($fs)) { flock($fs, LOCK_UN); + if (get_resource_type($fs) == 'stream') stream_socket_shutdown($fs, STREAM_SHUT_RDWR); fclose($fs); + } + if (!empty($fp) && is_resource($fp)) { + flock($fp, LOCK_UN); + if (get_resource_type($fp) == 'stream') stream_socket_shutdown($fp, STREAM_SHUT_RDWR); fclose($fp); } } @@ -149,6 +155,7 @@ function html_error($msg, $head = 1) { else echo ''.lang(13).''; echo ''; } + pause_download(); include(TEMPLATE_DIR.'footer.php'); exit(); } @@ -274,7 +281,7 @@ function getfilesize($f) { global $max_4gb; if ($max_4gb === false) { - $tmp_ = trim(@shell_exec(' ls -Ll ' . @escapeshellarg($f))); + $tmp_ = trim(@shell_exec('ls -Ll ' . @escapeshellarg($f))); while(strstr($tmp_, ' ')) $tmp_ = @str_replace(' ', ' ', $tmp_); $r = @explode(' ', $tmp_); $size_ = $r[4]; @@ -304,7 +311,7 @@ function getSize($file) { $size = filesize($file); if ($size < 0) { if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { - $size = @escapeshellarg($file); + $file = @escapeshellarg($file); $size = trim(`stat -c%s $file`); } else { $fsobj = new COM('Scripting.FileSystemObject'); @@ -371,10 +378,10 @@ function link_for_file($filename, $only_link = FALSE, $style = '') { $Path = FALSE; if ($only_link) return ''; } - $basename = htmlentities(basename($filename)); - $Path = htmlentities($Path).'/'.rawurlencode(basename($filename)); + $basename = htmlspecialchars(basename($filename)); + $Path = htmlspecialchars($Path).'/'.rawurlencode(basename($filename)); if ($only_link) return 'http://'.urldecode($_SERVER['HTTP_HOST']).$Path; - elseif ($Path === FALSE) return ''.$basename.''; + elseif ($Path === FALSE) return "$basename"; else return ''.$basename.''; } @@ -389,7 +396,7 @@ function lang($id) { #need to keep premium account cookies safe! function encrypt($string) { global $secretkey; - if (!$secretkey) return html_error('Value for $secretkey is empty, please create a random one (56 chars max) in accounts.php!'); + if (!$secretkey) return html_error('Value for $secretkey is empty, please create a random one (56 chars max) in config.php!'); require_once 'class.pcrypt.php'; /* @@ -407,7 +414,7 @@ function encrypt($string) { function decrypt($string) { global $secretkey; - if (!$secretkey) return html_error('Value for $secretkey is empty, please create a random one (56 chars max) in accounts.php!'); + if (!$secretkey) return html_error('Value for $secretkey is empty, please create a random one (56 chars max) in config.php!'); require_once 'class.pcrypt.php'; /* @@ -429,19 +436,19 @@ function decrypt($string) { * @param int Column for variable display * @param int Rows for variable display * @param bool Options to continue or not process - * @param string Charset encoding for htmlentities + * @param string Charset encoding for htmlspecialchars */ function textarea($var, $cols = 100, $rows = 30, $stop = false, $char = 'UTF-8') { $cols = ($cols == 0) ? 100 : $cols; $rows = ($rows == 0) ? 30 : $rows; if ($char === false) $char = 'ISO-8859-1'; echo "\n

\n"; if ($stop) exit; @@ -515,9 +522,7 @@ function is_hex($hex) { function host_matches($site, $host) { if (empty($site) || empty($host)) return false; if (strtolower($site) == strtolower($host)) return true; - $slen = strlen($site); - $hlen = strlen($host); - if (($pos = strripos($host, $site)) !== false && ($pos + $slen == $hlen) && $pos > 1 && substr($host, $pos - 1, 1) == '.') return true; + if (($pos = strripos($host, $site)) !== false && ($pos + strlen($site) == strlen($host)) && $pos > 1 && substr($host, $pos - 1, 1) == '.') return true; return false; } @@ -534,7 +539,7 @@ function GetDefaultParams() { if (isset($_GET['audl'])) $DParam['audl'] = 'doum'; if ($options['download_dir_is_changeable'] && !empty($_GET['path'])) $DParam['saveto'] = urlencode($_GET['path']); $params = array('add_comment', 'domail', 'comment', 'email', 'split', 'partSize', 'method', 'uploadlater', 'uploadtohost'); - foreach ($params as $key) if (!empty($_GET[$key])) $DParam[$key] = $_GET [$key]; + foreach ($params as $key) if (!empty($_GET[$key])) $DParam[$key] = $_GET[$key]; return $DParam; } diff --git a/classes/sinfo.php b/classes/sinfo.php index dc84da7..3e52fb1 100644 --- a/classes/sinfo.php +++ b/classes/sinfo.php @@ -41,8 +41,9 @@ function checkos() { } function winosname() { $wUnameB = php_uname ( "v" ); - $wUnameBM = php_uname ( "r" ); - $wUnameB = preg_replace ( "@build @i", "", $wUnameB ); + $wUnameBM = trim( php_uname ( "r" ) ); + if (preg_match ("@build (\d+)@i", $wUnameB, $build)) $wUnameB = $build[1]; + if ($wUnameBM == "5.0" && ($wUnameB == "2195")) { $wVer = "Windows 2000"; } @@ -52,10 +53,10 @@ function winosname() { if ($wUnameBM == "5.2" && ($wUnameB == "3790")) { $wVer = "Windows Server 2003"; } - if ($wUnameBM == "6.0" && (php_uname ( "v" ) == "build 6000")) { + if ($wUnameBM == "6.0" && ($wUnameB == "6000")) { $wVer = "Windows Vista"; } - if ($wUnameBM == "6.0" && (php_uname ( "v" ) == "build 6001")) { + if ($wUnameBM == "6.0" && ($wUnameB == "6001")) { $wVer = "Windows Vista SP1"; } return $wVer; @@ -93,10 +94,13 @@ function ZahlenFormatieren($Wert) { $wmi = new COM ( "Winmgmts://" ); $cpus = $wmi->execquery ( "SELECT * FROM Win32_Processor" ); $cpu_string = lang(136).':'; + $cpu_load = 0; foreach ( $cpus as $cpu ) { + $cpu_load += $cpu->loadpercentage; $cpu_string .= "" . $cpu->loadpercentage; } - $cpu_string .= '%

'; + $cpu_load /= count($cpus); + $cpu_string .= '%

'; } elseif ($os == "linux") { function getStat($_statPath) { if (trim ( $_statPath ) == '') { diff --git a/classes/sorttable.js b/classes/sorttable.js index f5c64ad..40a922f 100644 --- a/classes/sorttable.js +++ b/classes/sorttable.js @@ -27,6 +27,7 @@ sorttable = { }, makeSortable: function(table) { + if (!table) { return; } if (table.getElementsByTagName('thead').length === 0) { // table doesn't have a tHead. Since it should have, create one and // put the first table row in it. diff --git a/configs/.htaccess b/configs/.htaccess index e30ae10..48bcf38 100644 --- a/configs/.htaccess +++ b/configs/.htaccess @@ -1,9 +1,6 @@ order deny,allow - - deny from all - - -deny from all - \ No newline at end of file + +allow from all + diff --git a/configs/accounts.php b/configs/accounts.php index 7c4f0bf..c1f06c9 100644 --- a/configs/accounts.php +++ b/configs/accounts.php @@ -77,9 +77,4 @@ ###Auto Download Premium Account### //$premium_acc["au_dl"] = array('user' => 'your username', 'pass' => 'your password'); # Remove '//' from the beginning and enter your username and password for rapidshare.de premium account -#Secret key for cookie encryption -#Make up a random one to protect your premium cookies (max length: 56). Example: 'secretkey' = 'UijSY5wjP1Ii'; - DO NOT use this example 'secretkey', or your premium accounts/cookies could be stolen!! -#IF THIS IS NOT SET BEFORE YOU USE PREMIUM SERVICES, YOU WILL BE WARNED BY THE RAPIDLEECH SCRIPT. OTHERWISE YOUR PREMIUM ACCOUNTS AND/OR COOKIES COULD BE COMPROMISED! -$secretkey = ''; - ?> \ No newline at end of file diff --git a/configs/default.php b/configs/default.php index e5d7b8d..9474a54 100644 --- a/configs/default.php +++ b/configs/default.php @@ -22,7 +22,6 @@ //Authorization 'login' => false, # false - Authorization mode is off, true - on 'users' => array('test' => 'test'), # false - Authorization mode is off, enter the username and password in the given way -'login_cgi' => false, # true - Will try to workaround CGI authorization //Presentation 'template_used' => 'plugmod', 'default_language' => 'en', @@ -51,19 +50,19 @@ 'disable_unzip' => false, 'disable_rar' => false, 'disable_unrar' => false, -'disable_md5' => false, +'disable_hashing' => false, 'disable_md5_change' => false, 'disable_list' => false, //Advanced +'use_curl' => true, # true - Will use curl instead stream socket client(especially in ssl connection), disable this if filehost refuse data sended by curl. Need curl exec/extension enable in your server +'redir' => true, # true - Redirect passive method +'no_cache' => true, # true - Prohibition by Browser; otherwise allowed +'ref_check' => true, # true - Disallow downloads from external referers. In some hosts this check may give false positives, disable if it doesn't let you download. '2gb_fix' => true, # true - Try to list files bigger than 2gb on 32 bit o.s. 'forbidden_filetypes' => array('.htaccess', '.htpasswd', '.php', '.php3', '.php4', '.php5', '.phtml', '.asp', '.aspx', '.cgi'), # Enter the forbidden filetypes in the given way 'forbidden_filetypes_block' => false, # false - rename forbidden_filetypes, true - completely block them 'rename_these_filetypes_to' => '.xxx', # If forbidden_filetypes_block = false then rename those filetypes to this 'check_these_before_unzipping' => true, # true - Don't allow extraction/creation of these filetypes from file actions -'no_cache' => true, # true - Prohibition by Browser; otherwise allowed -'images_via_php' => false, # true - RapidShare images are downloaded through the script, but it requires ssl support; turn it off if you can't see the image. -'use_curl' => false, # true - Will use curl instead stream socket client(especially in ssl connection), disable this if filehost refuse data sended by curl. Need curl exec/extension enable in your server -'redir' => true, # true - Redirect passive method 'fgc' => 0 ); /*Default Options End*/ diff --git a/configs/setup.php b/configs/setup.php index f759b70..708fc3d 100644 --- a/configs/setup.php +++ b/configs/setup.php @@ -21,6 +21,12 @@ if (count($options) == count($default_options)) return; } +// Avoid setup page to be cached +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: ' . gmdate ("D, d M Y H:i:s") . 'GMT'); +header('Cache-Control: no-cache, must-revalidate'); +header('Pragma: no-cache'); + define('TEMPLATE_DIR', 'templates/plugmod/'); //$options['default_language'] = "en"; require_once('classes/other.php'); @@ -29,27 +35,30 @@ Rapidleech Setup - + - + @@ -156,42 +160,42 @@ function save_config() { #opt_login_table thead td { padding-bottom: 5px; } #opt_login_table td { text-align: center; } .div_error { - font-weight: bold; font-size: large; text-align: center; color:#FF0000; + font-weight: bold; font-size: large; text-align: center; color:#FF0000; } .div_opt { - text-align: left; - padding-bottom: 5px; + text-align: left; + padding-bottom: 5px; } .table_cat { - min-width: 300px; + min-width: 300px; } .table_opt { - width: 100%; + width: 100%; } .div_main { - text-align: center; - border: 1px white ridge; - padding: 5px; - margin-top:5px; + text-align: center; + border: 1px white ridge; + padding: 5px; + margin-top:5px; } .div_message { - color: #FFB000; - font-weight: bold; - font-size: larger; - text-align: center; - margin: 10px; + color: #FFB000; + font-weight: bold; + font-size: larger; + text-align: center; + margin: 10px; } .div_setup { - color: #FF7700; - font-weight: bold; - font-size: large; - text-align: center; + color: #FF7700; + font-weight: bold; + font-size: large; + text-align: center; } .div_title { - color: #FFB000; - font-size: larger; - font-weight: bold; - margin-bottom: 5px; + color: #FFB000; + font-size: larger; + font-weight: bold; + margin-bottom: 5px; } --> @@ -201,72 +205,66 @@ function save_config() {
$v) { if (!array_key_exists($k, $options)) { $options[$k] = $v; } } - - foreach($default_options as $k => $v) { - if (is_array($default_options[$k])) { continue; } - if (is_bool($default_options[$k])) { - $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? true : false); - } - elseif (is_numeric($default_options[$k])) { - $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? floor($_POST['opt_'.$k]) : 0); - } - else { - $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? stripslashes($_POST['opt_'.$k]) : ''); - } - } - - function array_trim(&$v) { $v = trim($v); } - $tmp = (isset($_POST['opt_forbidden_filetypes']) ? stripslashes($_POST['opt_forbidden_filetypes']) : ''); - $tmp = explode(',', $tmp); - array_walk($tmp, 'array_trim'); - $tmp = (count($tmp) > 0 && strlen(trim($tmp[0])) > 0 ? $tmp : array()); - $options['forbidden_filetypes'] = $tmp; - - $tmp = "\r\n\r\n\r\nRewriteEngine on\r\nRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]\r\n"; - $htacess = @file_get_contents('.htaccess'); - if (empty($htacess)) { echo 'It was not possible to read .htacess file

'; } - elseif (isset($_POST['opt_login_cgi']) && $_POST['opt_login_cgi']) { - if (strpos($htacess, $tmp) === false) { if (!@write_file(".htaccess", $htacess.$tmp, 1)) { - echo 'It was not possible to edit .htacess file to enable CGI authorization fix

'; - $options['login_cgi'] = false; - } - } - } - else { - if (strpos($htacess, $tmp) !== false) { if (!@write_file(".htaccess", str_replace($tmp, '', $htacess))) { - echo 'It was not possible to write .htacess file to completely disable CGI authorization fix

'; - } } - } - - $options['users'] = array(); - if (isset($_POST['users']) && isset($_POST['passwords']) && - count($_POST['users']) > 0 && count($_POST['users']) == count($_POST['passwords'])) { - foreach ($_POST['users'] as $k => $u) { - $u = stripslashes($u); $p = stripslashes($_POST['passwords'][$k]); - if ($u == '' && $p == '') { continue; } - $options['users'][$u] = $p; - } - } - else { echo 'There was a problem with users and passwords

'; } - - $opt = var_export($options, true); - $opt = (strpos($opt, "\r\n") === false ? str_replace(array("\r", "\n"), "\r\n", $opt) : $opt); - $opt = ""; - if (!@write_file(CONFIG_DIR."config.php", $opt, 1)) { echo '
It was not possible to write the configuration
Set permissions of "configs" folder to 0777 and try again
'; } - else { - if (is_file(CONFIG_DIR.'config_old.php')) { if (@!unlink(CONFIG_DIR.'config_old.php') && is_file(CONFIG_DIR.'config_old.php')) { '
It was not possible to delete the old configuration.
Manually delete "configs/config_old.php"

'; } } - echo '
Configuration saved! Click here to continue to rapidleech
'; - } -?> - $v) if (!array_key_exists($k, $options)) $options[$k] = $v; + + foreach($default_options as $k => $v) { + if (is_array($default_options[$k])) continue; + if (is_bool($default_options[$k])) $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? true : false); + elseif (is_numeric($default_options[$k])) $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? floor($_POST['opt_'.$k]) : 0); + else $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? stripslashes($_POST['opt_'.$k]) : ''); + } + + $tmp = (isset($_POST['opt_forbidden_filetypes']) ? stripslashes($_POST['opt_forbidden_filetypes']) : ''); + $tmp = array_filter(array_map('trim', explode(',', $tmp)), 'strlen'); + $options['forbidden_filetypes'] = $tmp; + + $options['users'] = array(); + if (isset($_POST['users']) && isset($_POST['passwords']) && is_array($_POST['users']) && is_array($_POST['passwords']) && count($_POST['users']) > 0 && count($_POST['users']) == count($_POST['passwords'])) { + foreach (array_intersect_key($_POST['users'], $_POST['passwords']) as $k => $u) { + if (($u = stripslashes($u)) == '') continue; + $p = stripslashes($_POST['passwords'][$k]); + $options['users'][$u] = $p; + } + } else echo 'There was a problem with users and passwords

'; + + // Secretkey checks + if (empty($options['secretkey'])) { + // secure_rand() function from: http://www.zimuel.it/en/strong-cryptography-in-php/ + function secure_rand($length) { + if (function_exists('openssl_random_pseudo_bytes')) { + $rnd = openssl_random_pseudo_bytes($length, $strong); + if ($strong === TRUE) return $rnd; + } + $sha = $rnd = ''; + if (file_exists('/dev/urandom')) { + $fp = fopen('/dev/urandom', 'rb'); + if ($fp) { + if (function_exists('stream_set_read_buffer')) stream_set_read_buffer($fp, 0); + $sha = fread($fp, $length); + fclose($fp); + } + } + for ($i = 0; $i < $length; $i++) { + $sha = hash('sha256', $sha.mt_rand(), true); + $rnd .= $sha[mt_rand(0, 31)]; + } + return $rnd; + } + $options['secretkey'] = base64_encode(secure_rand(42)); + } elseif (strlen($options['secretkey']) > 56) $options['secretkey'] = base64_encode(sha1($options['secretkey'])); + + $opt = var_export($options, true); + $opt = (strpos($opt, "\r\n") === false ? str_replace(array("\r", "\n"), "\r\n", $opt) : $opt); + $opt = ""; + if (!@write_file(CONFIG_DIR."config.php", $opt, 1)) echo '
It was not possible to write the configuration
Set permissions of "configs" folder to 0777 and try again
'; + else { + if (is_file(CONFIG_DIR.'config_old.php')) { if (@!unlink(CONFIG_DIR.'config_old.php') && is_file(CONFIG_DIR.'config_old.php')) { '
It was not possible to delete the old configuration.
Manually delete "configs/config_old.php"

'; } } + echo '
Configuration saved! Click here to continue to rapidleech
'; + } +} else { ?>
Rapidleech Setup
@@ -274,216 +272,211 @@ function array_trim(&$v) { $v = trim($v); }
-" /> +
CRC32 generation mode:
 Use hash_file (Recommended)
+ if (function_exists('hash_file')) { +?> Use hash_file (Recommended)
 Read file to memory
- /> Fake + /> Fake crc
- +
- -
-
General Options
-
- - - - - - - - - - - - - - - -
Secret key for cookie encryption
Make up a random one to protect your premium cookies (max length: 56)
Download Directory
Allow users to change
download directory
Auto Delete in minutes
File name prefix
File name suffix
Replace spaces for
underscore in file names
Bandwidth saving
File size limit in MiB
Disable auto download feature
Disable auto upload feature
Disable notes feature
Disable *.upload.html creation
Disable myuploads.txt creation
-
-
- -
+ +
+
General Options
+
+ + + + + + + + + + + + + + + + + + + +
Secret key for cookie encryption
Make up a random one to protect your premium cookies (max length: 56)
Download Directory
Allow users to change
download directory
Auto Delete in minutes
File name prefix
File name suffix
Replace spaces for
underscore in file names
Bandwidth saving
File size limit in MiB
Disable auto download feature
Disable auto upload feature
Disable notes feature
Disable *.upload.html creation
Disable myuploads.txt creation
+
+
+ +
- +
- -
-
Authorization mode
-
- Enable Authorization mode -
- Enable CGI authorization fix
- - - - - -
UserPassword
 
-
-
-
- -
+ +
+
Authorization mode
+
+ Enable Authorization mode +
+ + + + + +
UserPassword
 
+
+
+
+ +
-
- -
-
Presentation Options
-
- - + + + + + + + +
- - + + +
Template -
+ +
+
Presentation Options
+
+ + - - - - - - - -
+ + + - + + + -
Template -
Language -
Language -
-
- - - - -
Show all files, not
only downloaded
Auto Refresh Server Info
CPU, Memory & Time Info
-
-   -
- - - -
Make file list sortable
Fixed file list header
(May not work in all browsers)
-
- - - -
Transload files in a new window
Use javascript window
-
-   -
-
-
- -
+
+ + + + +
Show all files, not
only downloaded
Auto Refresh Server Info
CPU, Memory & Time Info
+
 
+ + + +
Make file list sortable
Fixed file list header
(May not work in all browsers)
+
+ + + +
Transload files in a new window
Use javascript window
+
 
+
+
+ +
- +
- -
-
File Actions Restrictions
-
- - - - - - - - - - -
Disable all actions
Disable deleting on all actions(except delete)
  
- - - - - - - -
Disable delete action
Disable rename action
Disable massive rename
Disable massive email
Disable email
Disable FTP
Disable upload
- - - - - -
Disable merge
Disable split
Disable md5 change
Disable md5
Disable list
- - - - - - -
Disable compression
(tar, zip, rar)
Disable tar
Disable zip
Disable unzip
Disable rar
Disable unrar
-
-
- -
+ +
+
File Actions Restrictions
+
+ + + + + + + + + +
Disable all actions
Disable deleting on all actions(except delete)
  
+ + + + + + + +
Disable delete action
Disable rename action
Disable massive rename
Disable massive email
Disable email
Disable FTP
Disable upload
+ + + + + +
Disable merge
Disable split
Disable md5 change
Disable hashing
Disable list
+ + + + + + +
Disable compression
(tar, zip, rar)
Disable tar
Disable zip
Disable unzip
Disable rar
Disable unrar
+
+
+
- +
- -
-
Advanced Options
-
-
(You don't need to change these unless you know what you are doing)
- - - - - - - - - - - - -
Try to list files bigger than 2gb
(32 bit o.s.)
Forbidden file types
Block download of forbidden file types
Rename forbidden file types to
Block forbidden file types for file actions
Images via php
Use curl as an alternatif for stream socket client
Redirect passive method
No cache
fgc
-
-
- -
+
+
Advanced Options
+
+
(You don't need to change these unless you know what you are doing)
+ + + + + + + + + + + + +
Prefer use of cURL on plugins
Redirect passive method
No cache
Disallow downloads from external referers
Try to list files bigger than 2gb
(32 bit o.s.)
Forbidden file types
Block download of forbidden file types
Rename forbidden file types to
Block forbidden file types for file actions
fgc
+
+
+ +
- - - + + +
-
- - - -
-
+
+ + + +
+
- - \ No newline at end of file + +exit("\r\n"); ?> \ No newline at end of file diff --git a/files/.htaccess b/files/.htaccess index 87c0e07..0468a46 100644 --- a/files/.htaccess +++ b/files/.htaccess @@ -1,6 +1,6 @@ order deny,allow - + deny from all @@ -10,4 +10,4 @@ allow from all deny from all - \ No newline at end of file + diff --git a/hosts/.htaccess b/hosts/.htaccess index e30ae10..c468487 100644 --- a/hosts/.htaccess +++ b/hosts/.htaccess @@ -1,9 +1,2 @@ order deny,allow - - deny from all - - - -deny from all - \ No newline at end of file diff --git a/hosts/DownloadClass.php b/hosts/DownloadClass.php index 59f33d3..88c27d7 100644 --- a/hosts/DownloadClass.php +++ b/hosts/DownloadClass.php @@ -81,7 +81,7 @@ public function RedirectDownload($link, $FileName, $cookie = 0, $post = 0, $refe if (!empty($url['port'])) $params['port'] = urlencode($url['port']); $params['path'] = urlencode($url['path'] . (!empty($url['query']) ? '?' . $url['query'] : '')); if (!empty($post)) $params['post'] = urlencode(encrypt(serialize($post))); - if (!empty($auth)) $params['auth'] = urlencode($auth); + if (!empty($auth)) $params['auth'] = ($auth == '1' ? '1' : urlencode(encrypt(base64_encode($auth)))); if (!empty($addon)) { if (!is_array($addon)) html_error('Plugin problem! Please report, error: "The parameter passed must be an array"'); // Some problems with the plugin, quit it foreach ($addon as $name => $value) $params[$name] = (is_array($value) ? urlencode(serialize($value)) : urlencode($value)); @@ -126,7 +126,9 @@ public function CountDown($countDown) { public function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5') { echo "\n
\n"; foreach ($inputs as $name => $input) echo "\t\n"; - echo "\t

" . lang(301) . " CAPTCHA Image " . lang(302) . ":   \n\t\t\n\t

\n\t\n
\n\n"; + echo "\t

" . lang(301) . " CAPTCHA Image " . lang(302) . ":   \n\t\t\n\t

\n\t\n\n"; + include(TEMPLATE_DIR.'footer.php'); + exit(); } /* @@ -136,12 +138,13 @@ public function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5') { * @param string $referer -> Adds the referer value to the array url encoded if you need it. If isn't set, it will load $Referer value. (Set as 0 or false for not add it in the array.) */ - public function DefaultParamArr($link = 0, $cookie = 0, $referer = 1) { - if ($referer == 1) { + public function DefaultParamArr($link = 0, $cookie = 0, $referer = 1, $encrypt = 0) { + if ($referer === 1 || $referer === true) { global $Referer; $referer = $Referer; } if (is_array($cookie)) $cookie = CookiesToStr($cookie); + if ($encrypt) $cookie = encrypt($cookie); $DParam = GetDefaultParams(); if ($link) $DParam['link'] = urlencode($link); @@ -161,7 +164,7 @@ public function JSCountdown($secs, $post = 0, $text='Waiting link timelock', $st echo "

ERROR: Please enable JavaScript. (Countdown)
Please wait

\n"; echo "
\n"; if (!empty($post) && is_array($post)) foreach ($post as $name => $input) echo "\n"; - ?>

"; - if ($stop) exit(""); + if ($stop) { + include(TEMPLATE_DIR.'footer.php'); + exit(); + } } - public function changeMesg($mesg) { - echo(''); + public function changeMesg($mesg, $add=false) { + echo("\n"); } } diff --git a/hosts/download/.htaccess b/hosts/download/.htaccess index e30ae10..c468487 100644 --- a/hosts/download/.htaccess +++ b/hosts/download/.htaccess @@ -1,9 +1,2 @@ order deny,allow - - deny from all - - - -deny from all - \ No newline at end of file diff --git a/hosts/download/4shared_com.php b/hosts/download/4shared_com.php index a51008e..ba87953 100644 --- a/hosts/download/4shared_com.php +++ b/hosts/download/4shared_com.php @@ -1,21 +1,20 @@ long_regexp = '@http://dc\d+\.4shared\.com/download/[^/|\"|\'|\r|\n|<|>|\s|\t]+/(?:tsid[^/|\"|\'|\r|\n|<|>|\s|\t]+/)?[^/|\"|\'|\r|\n|<|>|\s|\t]+@i'; + $this->long_regexp = '@https?://dc\d+\.4shared\.com/download/[^/\"\'\r\n<>\s\t]+/(?:tsid[^/\"\'\r\n<>\s\t]+/)?[^/\"\'\r\n<>\s\t]+@i'; $this->cookie = array('4langcookie' => 'en'); + $this->noTrafficFreeDl = true; // Set to true to switch to free download when premium traffic used is over the limit. - if (stristr($link, '.com/get/')) { - $link = str_replace('.com/get/', '.com/file/', $link); - } + if (stristr($link, '.com/get/')) $link = str_ireplace('.com/get/', '.com/file/', $link); $this->link = $link; $this->page = $this->GetPage($this->link, $this->cookie); $this->cookie = GetCookiesArr($this->page, $this->cookie); @@ -26,31 +25,29 @@ public function Download($link) { if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['4shared_com']['user']) && !empty($premium_acc['4shared_com']['pass'])))) { $this->pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false); return $this->login(); - } else { - return $this->FreeDownload(); - } + } else return $this->FreeDownload(); } private function FreeDownload() { $this->CheckForPass(); - if (preg_match('@window.location = "(http://dc\d+\.4shared\.com/download/[^/|\"|\'|;]+/[^/|\"|\'|\?|;]+)"@i', $this->page, $DL)) { // Direct link downloadable without login and countdown... - if (preg_match('/(?:\?|&)dirPwdVerified=(\w+)/i', $this->link, $pwd)) $DL[1] .= '&dirPwdVerified='.$pwd[1]; - $FileName = urldecode(basename(parse_url($DL[1], PHP_URL_PATH))); - return $this->RedirectDownload($DL[1], $FileName, $this->cookie); + // Direct link downloadable without login or countdown... + if (preg_match('@window\.location[\s\t]*=[\s\t]*"(https?://dc\d+\.4shared\.com/download/[^/\"\';]+/[^/\"\'\?;]+)"@i', $this->page, $DL)) { + if (preg_match('/[\?&]dirPwdVerified=(\w+)/i', $this->link, $pwd)) $DL[1] .= '&dirPwdVerified='.$pwd[1]; + return $this->RedirectDownload($DL[1], urldecode(basename(parse_url($DL[1], PHP_URL_PATH))), $this->cookie); } - if (preg_match('@if[\s|\t]?\(true\)[\r|\n|\s|\t]*return[\s|\t]\w*download\w*\(\)[\s|\t]?&&[\s|\t]?authenticate[\s|\t]*\(@i', $this->page)) html_error('You need to be logged in for download this file.'); + is_present($this->page, "You should log in to download this file. Sign up for free if you don\'t have an account yet.", 'You need to be logged in for download this file.'); - if (!preg_match('/.com\/[^\/]+\/([^\/]+)\/?(.*)/i', $this->link, $L)) html_error('Invalid link?'); + if (!preg_match('@\.com/[^/]+/([^/]+)/?(.*)@i', $this->link, $L)) html_error('Invalid link?'); $page = $this->GetPage("http://www.4shared.com/get/{$L[1]}/{$L[2]}", $this->cookie); if (!preg_match($this->long_regexp, $page, $DL)) html_error('Download-link not found.'); $this->cookie = GetCookiesArr($page, $this->cookie); $dllink = $DL[0]; - if (preg_match('/(?:\?|&)dirPwdVerified=(\w+)/i', $this->link, $pwd)) $dllink .= '&dirPwdVerified='.$pwd[1]; + if (preg_match('/[\?&]dirPwdVerified=(\w+)/i', $this->link, $pwd)) $dllink .= '&dirPwdVerified='.$pwd[1]; - if (!preg_match('@id="secondsLeft"[\s|\t]+value="(\d+)"@i', $page, $count) && !preg_match('@id="downloadDelayTimeSec"[^<|>|/]*>(\d+)<@i', $page, $count)) html_error('Timer not found.'); + if (!preg_match('@id="secondsLeft"[\s\t]+value="(\d+)"@i', $page, $count) && !preg_match('@id="downloadDelayTimeSec"[^<>/]*>(\d+)<@i', $page, $count)) html_error('Timer not found.'); $FileName = urldecode(basename(parse_url($dllink, PHP_URL_PATH))); if ($count[1] <= 120) $this->CountDown($count[1]); @@ -92,12 +89,13 @@ private function CheckForPass($predl=false) { private function PremiumDownload() { $page = $this->GetPage($this->link, $this->cookie); + $this->GetPage('http://www.4shared.com/get/gebpvkQ6/doberman_plays_hide_and_seek.html', $this->cookie); $this->CheckForPass(true); - if (stripos($page, "\r\nContent-Length: 0\r\n") !== false) is_notpresent($page, "\r\nLocation:", 'Error: Direct link not found.'); + if (stripos($page, "\nContent-Length: 0\n") !== false) is_notpresent($page, "\nLocation: ", 'Error: Direct link not found.'); if (!preg_match($this->long_regexp, $page, $DL)) html_error('Error: Download link not found.'); $dllink = $DL[0]; - if (preg_match('/(?:\?|&)dirPwdVerified=(\w+)/i', $this->link, $pwd)) $dllink .= '&dirPwdVerified='.$pwd[1]; + if (preg_match('/[\?&]dirPwdVerified=(\w+)/i', $this->link, $pwd)) $dllink .= '&dirPwdVerified='.$pwd[1]; $FileName = urldecode(basename(parse_url($dllink, PHP_URL_PATH))); $this->RedirectDownload($dllink, $FileName, $this->cookie); @@ -128,9 +126,11 @@ private function login() { $this->cookie = GetCookiesArr($page, $this->cookie, true, array('','deleted','""')); $quota = cut_str($page, 'Premium Traffic:', ''); + $Mesg = lang(300); if (empty($quota) || !preg_match('@>([\d|\.]+)\s?(%|(?:\wB)) of ([\d|\.]+)\s?(\wB)@i', $quota, $qm)) { - $this->changeMesg(lang(300)."
Account isn\\\'t premium?
Using it as member."); + $Mesg .= "
Account isn\\\'t premium?
Using it as member."; + $this->changeMesg($Mesg); $this->page = $this->GetPage($this->link, $this->cookie); return $this->FreeDownload(); @@ -140,9 +140,18 @@ private function login() { $total = floatval($qm[3]); // I have to check the BW... I will show it too :) - $this->changeMesg(lang(300)."
4S Premium Download
Bandwidth: $used {$qm[2]} of $total {$qm[4]}."); + $Mesg .= "
4S Premium Download
Bandwidth: $used {$qm[2]} of $total {$qm[4]}."; + $this->changeMesg($Mesg); if ($qm[2] != '%' && $total != 100) $used = ($used * 100)/$total; - if ($used >= 95) html_error("Bandwidth limit trigered: Bandwidth: $used% - Limit: 95%"); + if ($used >= 95) { + if ($this->noTrafficFreeDl) { + $Mesg .= "
Bandwidth limit trigered: $used% - Limit: 95%
Switching to FreeDL."; + $this->changeMesg($Mesg); + $this->page = $this->GetPage($this->link, $this->cookie); + return $this->FreeDownload(); + } + html_error("Bandwidth limit trigered: Bandwidth: $used% - Limit: 95%"); + } return $this->PremiumDownload(); } diff --git a/hosts/download/bayfiles_com.php b/hosts/download/bayfiles_net.php similarity index 90% rename from hosts/download/bayfiles_com.php rename to hosts/download/bayfiles_net.php index 2fe02da..ef93deb 100644 --- a/hosts/download/bayfiles_com.php +++ b/hosts/download/bayfiles_net.php @@ -5,11 +5,11 @@ exit; } -class bayfiles_com extends DownloadClass { +class bayfiles_net extends DownloadClass { private $link, $page, $cookie, $fid, $token; public function Download($link) { global $premium_acc; - $this->link = $link; + $this->link = str_ireplace('bayfiles.com', 'bayfiles.net', $link); $this->cookie = array(); if (empty($_REQUEST['step']) || $_REQUEST['step'] != 1) { // Check link @@ -24,7 +24,7 @@ public function Download($link) { } } - if ($_REQUEST["premium_acc"] == "on" && ((!empty($_REQUEST["premium_user"]) && !empty($_REQUEST["premium_pass"])) || (!empty($premium_acc["bayfiles_com"]["user"]) && !empty($premium_acc["bayfiles_com"]["pass"])))) { + if ($_REQUEST["premium_acc"] == "on" && ((!empty($_REQUEST["premium_user"]) && !empty($_REQUEST["premium_pass"])) || (!empty($premium_acc["bayfiles_net"]["user"]) && !empty($premium_acc["bayfiles_net"]["pass"])))) { $this->Login(); } elseif (isset($_REQUEST['step']) && $_REQUEST['step'] == 1) { $this->Captcha(); @@ -38,7 +38,7 @@ private function Prepare() { if (!preg_match('@var vfid = (\d+);@i', $this->page, $fid)) html_error("Error: Fileid not found"); $this->fid = $fid[1]; - $page = $this->GetPage('http://bayfiles.com/ajax_download?action=startTimer&vfid='.$this->fid); + $page = $this->GetPage('http://bayfiles.net/ajax_download?action=startTimer&vfid='.$this->fid); if (!preg_match('@"token":"([^\"]+)"@i', $page, $token)) html_error("Error: Countdown token not found"); $this->token = $token[1]; @@ -66,7 +66,7 @@ private function Captcha() { $post['token'] = $this->token = $_POST['token']; $this->fid = $_POST['fid']; - $page = $this->GetPage('http://bayfiles.com/ajax_captcha', $this->cookie, $post); + $page = $this->GetPage('http://bayfiles.net/ajax_captcha', $this->cookie, $post); is_present($page, 'Invalid captcha', 'Error: Wrong Captcha Entered.'); if (!preg_match('@"token":"([^\"]+)"@i', $page, $token)) html_error("Error: Captcha token not found"); @@ -74,7 +74,7 @@ private function Captcha() { return $this->FreeDL(); } else { - $page = $this->GetPage('http://bayfiles.com/ajax_captcha', $this->cookie, array('action' => 'getCaptcha')); + $page = $this->GetPage('http://bayfiles.net/ajax_captcha', $this->cookie, array('action' => 'getCaptcha')); if (!preg_match('@Recaptcha\.create\s*\(\s*[\"|\']([^\"|\'|\)]+)[\"|\']@i', $page, $pid)) html_error("Error: reCaptcha not found"); $page = $this->GetPage("http://www.google.com/recaptcha/api/challenge?k=" . $pid[1]); @@ -101,7 +101,7 @@ private function Captcha() { private function FreeDL($act='getLink') { $post = array('action' => $act, 'vfid' => $this->fid, 'token' => $this->token); - $page = $this->GetPage('http://bayfiles.com/ajax_download', $this->cookie, $post); + $page = $this->GetPage('http://bayfiles.net/ajax_download', $this->cookie, $post); if (!preg_match('@https?://([^/\'\"<>\r\n\s\t]+\.)?baycdn\.com/dl/[^\'\"<>\r\n\s\t]+@i', $page, $dlink)) html_error('Error: Download link not found'); @@ -122,21 +122,21 @@ private function Login() { global $premium_acc; if (!empty($_REQUEST["premium_user"]) && !empty($_REQUEST["premium_pass"])) $pA = true; else $pA = false; - $user = ($pA ? $_REQUEST["premium_user"] : $premium_acc["bayfiles_com"]["user"]); - $pass = ($pA ? $_REQUEST["premium_pass"] : $premium_acc["bayfiles_com"]["pass"]); + $user = ($pA ? $_REQUEST["premium_user"] : $premium_acc["bayfiles_net"]["user"]); + $pass = ($pA ? $_REQUEST["premium_pass"] : $premium_acc["bayfiles_net"]["pass"]); if (empty($user) || empty($pass)) html_error("Login Failed: Username or Password are empty. Please check login data."); $post = array('action'=>'login','next'=>'%252F'); $post["username"] = urlencode($user); $post["password"] = urlencode($pass); - $page = $this->GetPage('http://bayfiles.com/ajax_login', $this->cookie, $post, 'http://bayfiles.com/'); + $page = $this->GetPage('http://bayfiles.net/ajax_login', $this->cookie, $post, 'http://bayfiles.net/'); is_present($page, 'Login failed. Please try again', 'Login Failed: Invalid username and/or password.'); if ($err = cut_str($page, '"error":"', '"')) html_error("Login Failed: $err."); is_notpresent($page, 'Set-Cookie: SESSID=', 'Login Failed: Cannot get cookie.'); $this->cookie = array_merge($this->cookie, GetCookiesArr($page)); - $page = $this->GetPage('http://bayfiles.com/account', $this->cookie, 0, 'http://bayfiles.com/'); + $page = $this->GetPage('http://bayfiles.net/account', $this->cookie, 0, 'http://bayfiles.net/'); if (preg_match('@
This file is either removed due", "Error: This file is either removed due to copyright claim or is deleted by the uploader."); - is_present($page, "File is removed", "Error: File is removed due to copyright claim."); - if (stristr($page, "\r\nContent-Length: 0\r\n")) { - is_notpresent($page, "\r\nLocation:", "Error: Invalid link. Please check the download link."); - // Check if file has enabled Hot/Direct linking. - if (!preg_match("/(s\d+)\.hotfile\.com\/get\/(\w+\/\w+\/\w+\/\w+\/\w+)\/([^\r|\n]+)/i", $page, $l)) { - html_error("Error: Invalid link?. Please check the download link."); - } - $dllink = "http://{$l[1]}.hotfile.com/get/{$l[2]}/{$l[3]}"; - - $filename = parse_url($dllink); - $filename = urldecode(basename($filename["path"])); - return $this->RedirectDownload($dllink, $filename, GetCookies($page)); - } - unset($page); - } - - if (($_REQUEST["cookieuse"] == "on" && preg_match("/auth\s?=\s?(\w{64})/i", $_REQUEST["cookie"], $c)) || ($_REQUEST["premium_acc"] == "on" && $premium_acc["hotfile_com"]["cookie"])) { - $cookie = (empty($c[1]) ? $premium_acc["hotfile_com"]["cookie"] : $c[1]); - $this->DownloadPremium($link, $cookie); - } elseif (($_REQUEST["premium_acc"] == "on" && $_REQUEST["premium_user"] && $_REQUEST["premium_pass"]) || - ($_REQUEST["premium_acc"] == "on" && $premium_acc["hotfile_com"]["user"] && $premium_acc["hotfile_com"]["pass"])) { - $this->DownloadPremium($link); - } else { - $this->DownloadFree($link); - } - } - private function DownloadFree($link) { - $page = $this->GetPage($link); - if ($_GET["step"] != "1") { - if (!preg_match_all('/timerend=d\.getTime\(\)\+(\d+)/i', $page, $t)) { - html_error("Error getting timer."); - } - $t = $t[1]; - $hl = ($t[1] > 0 ? $t[1]/1000 : 0); - - if ($hl > 0) { - $data = $this->DefaultParamArr($link); - $data['step'] = '2'; - $this->JSCountdown($hl, $data, 'You reached your hourly traffic limit'); - } else { - insert_timer(($t[0]/1000)+1, "Waiting captcha/link timelock:"); - } - $post['action'] = cut_str($page, "action value=", ">"); - $post['tm'] = cut_str($page, "tm value=", ">"); - $post['tmhash'] = cut_str($page, "tmhash value=", ">"); - $post['wait'] = cut_str($page, "wait value=", ">"); - $post['waithash'] = cut_str($page, "waithash value=", ">"); - $post['upidhash'] = cut_str($page, "upidhash value=", ">"); - - $page = $this->GetPage($link, 0, $post); - } - - $lfound = (stristr($page, "hotfile.com/get/") ? true : false); - $cfound = (stristr($page, "api.recaptcha.net/challenge?k=") ? true : false); - if (!$lfound && !$cfound) { - /* No captcha or link found?. Let's try resending the post */ - $post['action'] = cut_str($page, "action value=", ">"); - $post['tm'] = cut_str($page, "tm value=", ">"); - $post['tmhash'] = cut_str($page, "tmhash value=", ">"); - $post['wait'] = cut_str($page, "wait value=", ">"); - $post['waithash'] = cut_str($page, "waithash value=", ">"); - $post['upidhash'] = cut_str($page, "upidhash value=", ">"); - - $page = $this->GetPage($link, 0, $post); - - $lfound = (stristr($page, "hotfile.com/get/") ? true : false); - $cfound = (stristr($page, "api.recaptcha.net/challenge?k=") ? true : false); - } - - if($_GET["step"] == "1" && !$lfound) { - //Send captcha - $post['action'] = $_POST['action']; - $post['recaptcha_challenge_field'] = $_POST['challenge']; - $post['recaptcha_response_field'] = $_POST['captcha']; - $post['recaptcha_shortencode_field'] = $_POST['shortencode']; - - $page = $this->GetPage($link, 0, $post); - is_present($page, "Wrong Code. Please try again.", "Error: Entered CAPTCHA was incorrect."); - is_notpresent($page, 'hotfile.com/get/', 'Error: Download-link not found [2].'); - } elseif (!$lfound && $cfound) { - //Get captcha - $pid = cut_str($page, 'recaptcha.net/challenge?k=', '"'); - $page = $this->GetPage("http://www.google.com/recaptcha/api/challenge?k=" . $pid); - if (preg_match('/challenge \: \'([^\']+)/i', $page, $ch)) { - $challenge = $ch[1]; - } else { - html_error("Error getting CAPTCHA data."); - } - - $data = $this->DefaultParamArr($link); - $data['challenge'] = $challenge; - $data['shortencode'] = 'undefined'; - $data['action'] = 'checkcaptcha'; - $data['step'] = '1'; - - //Download captcha img. - $page = $this->GetPage("http://www.google.com/recaptcha/api/image?c=" . $challenge); - $capt_img = substr($page, strpos($page, "\r\n\r\n") + 4); - $imgfile = DOWNLOAD_DIR . "hotfile_captcha.jpg"; - - if (file_exists($imgfile)) { - unlink($imgfile); - } - if (! write_file($imgfile, $capt_img)) { - html_error("Error getting CAPTCHA image.", 0); - } - - $this->EnterCaptcha($imgfile, $data, 20); - exit; - } elseif (!$lfound) { - html_error("Error getting CAPTCHA"); - } - - if (preg_match('/\/get\/(\d+\/\w+\/\w+)\/([^\'|\"]+)/i', $page, $dl)) { - $cookie = GetCookies($page); - $page = $this->GetPage("http://hotfile.com/get/{$dl[1]}/{$dl[2]}", $cookie); - } else { - html_error("Error: Download-link not found."); - } - - is_notpresent($page, "\r\nLocation:", "Error: Direct link not found."); - - if (!preg_match("/(s\d+)\.hotfile\.com\/get\/(\w+\/\w+\/\w+\/\w+\/\w+)\/([^\r|\n]+)/i", $page, $l)) { - is_present(cut_str($page, "\r\nLocation: ", "\r\n"), "?expire=1", "Error: Your download expired, try again."); - html_error("Error: Direct link not found [2]."); - } - $dllink = "http://{$l[1]}.hotfile.com/get/{$l[2]}/{$l[3]}"; - - $filename = parse_url($dllink); - $filename = urldecode(basename($filename["path"])); - $this->RedirectDownload($dllink, $filename, $cookie); - } - - private function DownloadPremium($link, $cookie = false) { - $cookie = $this->login($cookie); - $page = $this->GetPage($link, $cookie); - - if (stristr($page, "\r\nContent-Length: 0\r\n")) { - is_notpresent($page, "\r\nLocation:", "Error: Direct link not found."); - } elseif (preg_match('/\/get\/(\d+\/\w+\/\w+)\/([^\'|\"]+)/i', $page, $dl)) { - $page = $this->GetPage("http://hotfile.com/get/{$dl[1]}/{$dl[2]}", $cookie); - } else { - is_notpresent($page, 'Premium', "Error: The account isn't premium?."); - html_error("Error: Download-link not found."); - } - $cookie = $cookie . "; " . GetCookies($page); - - if (!preg_match("/(s\d+)\.hotfile\.com\/get\/(\w+\/\w+\/\w+\/\w+\/\w+)\/([^\r|\n]+)/i", $page, $l)) { - html_error("Error: Direct link not found [2]."); - } - $dllink = "http://{$l[1]}.hotfile.com/get/{$l[2]}/{$l[3]}"; - - $filename = parse_url($dllink); - $filename = urldecode(basename($filename["path"])); - $this->RedirectDownload($dllink, $filename, $cookie); - } - - private function login($authc = false) { - global $premium_acc; - - if (!$authc) { - $user = ($_REQUEST["premium_user"] ? $_REQUEST["premium_user"] : $premium_acc["hotfile_com"]["user"]); - $pass = ($_REQUEST["premium_pass"] ? $_REQUEST["premium_pass"] : $premium_acc["hotfile_com"]["pass"]); - if (empty($user) || empty($pass)) { - html_error("Login Failed: Username or Password is empty. Please check login data."); - } - - $postURL = "http://hotfile.com/login.php"; - $post["returnto"] = "/"; - $post["user"] = $user; - $post["pass"] = $pass; - $page = $this->GetPage($postURL, 0, $post, 'http://hotfile.com/'); - $cookie = GetCookies($page); - - is_present($page, '/suspended.html', "Login failed: Your account has been suspended."); - is_notpresent($page, "Location: /?cookiecheck=1", "Login failed: Username or Password is incorrect."); - is_notpresent($cookie, "auth=", "Login Failed: Cannot get cookie."); - } elseif (strlen($authc) == 64) { - $cookie = "auth=" . $authc; - } else { - html_error("[Cookie] Invalid cookie (" . strlen($authc) . " != 64)."); - } - - $page = $this->GetPage("http://hotfile.com/?cookiecheck=1", $cookie); - is_present($page, 'Free', "Login Failed: The account isn't premium."); - is_present($page, '/howtocookies.html', "Error: Login Failed."); - is_present($page, '/login.php', "[Cookie] Invalid cookie."); - - return $cookie; - } -} - -//[06-Feb-2011] Plugin rewritten & added cookie support by Th3-822. -//[13-Feb-2011] Removed old code & Fixed captcha in free download. - Th3-822 -//[15-May-2011] Added 3 error msg; 1 edited & Fixed error in 'hfwait' form & Added 1 seg to free dl Timelock & Added code to try again if captcha isn't found. - Th3-822 -//[11-Jul-2011] Using a function for the countdown & Added code for use DefaultParamArr(). -Th3-822 -?> \ No newline at end of file diff --git a/hosts/download/hugefiles_net.php b/hosts/download/hugefiles_net.php index cb85d88..231a6c2 100644 --- a/hosts/download/hugefiles_net.php +++ b/hosts/download/hugefiles_net.php @@ -1,4 +1,4 @@ -GetPage($link, $Cookies, array("downloadp" => $_POST['mfpassword']), $link); - } else { - $link = preg_replace('@https?://([^/]+\.)?mediafire\.com/((download\.php)|(file/))?\??@i', 'http://www.mediafire.com/?', $link); - $page = $this->GetPage($link); - if (preg_match('@/error\.php\?errno=\d+@i', $page, $redir)) { - $page = $this->GetPage('http://www.mediafire.com'.$redir[0]); - if (preg_match('@error_msg_title">\s*([^\r\n<>]+)\s*<@i', $page, $err)) html_error($err[1]); - html_error('Link is not available'); - } - $Cookies = GetCookiesArr($page); + $Cookies = StrToCookies(urldecode($_POST['cookie'])); + $page = $this->GetPage($link, $Cookies, array('downloadp' => urlencode($_POST['mfpassword'])), $link); + } + + $link = preg_replace('@https?://([^/]+\.)?mediafire\.com/(?!download/)((download\.php)|(file/)|(view/))?\??@i', 'http://www.mediafire.com/download/', $link); + $page = $this->GetPage($link, $Cookies); + if (preg_match('@/error\.php\?errno=\d+@i', $page, $redir)) { + $page = $this->GetPage('http://www.mediafire.com'.$redir[0]); + if (preg_match('@error_msg_title">\s*([^\r\n<>]+)\s*<@i', $page, $err)) html_error($err[1]); + html_error('Link is not available'); } + $Cookies = GetCookiesArr($page); + $this->MF_Captcha($link, $page); if (strpos($page, 'name="downloadp" id="downloadp"')) { - $DefaultParam = $this->DefaultParamArr($link, $Cookies); + $DefaultParam = $this->DefaultParamArr(preg_replace('@/download/([^/]+)/?.*@i', '/?$1', $link), $Cookies); $html = '
'; foreach ($DefaultParam as $key => $value) $html.=''; $html.='Enter your password here
'; @@ -60,8 +61,9 @@ private function MF_Captcha($link, &$page) { $post = array('adcopy_challenge' => urlencode($gibberish[1]), 'adcopy_response' => 'manual_challenge'); } - $page = $this->GetPage($link, 0, $post); + $page = $this->GetPage(str_ireplace('mediafire.com/download/', 'mediafire.com/?', $link), 0, $post); is_present($page, 'Your entry was incorrect, please try again!'); + $page = $this->GetPage($link, 0, $post); } else { if (!preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $page, $pid) && !preg_match('@http://api\.solvemedia\.com/papi/challenge\.noscript\?k=[\w\.-]+@i', $page, $spid)) html_error('Error: CAPTCHA not found.'); $data = $this->DefaultParamArr($link); @@ -117,6 +119,8 @@ private function Show_reCaptcha($pid, $inputs, $sname = 'Download File') { * freedl regexp fixed again by Th3-822 10-05-2012 * incomplete fix for getting dllink by Th3-822 14-05-2012 * added solvemedia captcha support && fixed dead link msgs by Th3-822 06-10-2012 + * quick fix for new format/redirect for share links && fixed capcha submit url by Th3-822 24-05-2013 + * fixed password post url by Th3-822 27-07-2013 */ ?> \ No newline at end of file diff --git a/hosts/download/mega_co_nz.php b/hosts/download/mega_co_nz.php new file mode 100644 index 0000000..667c91d --- /dev/null +++ b/hosts/download/mega_co_nz.php @@ -0,0 +1,225 @@ +RLCheck(); + $this->seqno = mt_rand(); + $this->changeMesg(lang(300).'
Mega.co.nz plugin by Th3-822'); // Please, do not remove or change this line contents. - Th3-822 + + $fragment = parse_url($link, PHP_URL_FRAGMENT); + if (preg_match('@^F!([^!]{8})!([\w\-\,]{22})@i', $fragment, $fid)) return $this->Folder($fid[1], $fid[2]); + if (!preg_match('@^(T8)?!([^!]{8})!([\w\-\,]{43})@i', $fragment, $fid)) html_error('FileID or Key not found at link.'); + + $reply = $this->apiReq(array('a' => 'g', 'g' => '1', (empty($fid[1]) ? 'p' : 'n') => $fid[2], 'ssl'=> '0')); + $this->CheckErr($reply[0]); + if (!empty($reply[0]['e'])) $this->CheckErr($reply[0]['e']); + + $key = $this->base64_to_a32($fid[3]); + $iv = array_merge(array_slice($key, 4, 2), array(0, 0)); + $key = array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7]); + $attr = $this->dec_attr($this->base64url_decode($reply[0]['at']), $key); + if (empty($attr)) html_error((!empty($fid[1]) ? 'Folder Error: ' : '').'File\'s key isn\'t correct.'); + + $this->RedirectDownload($reply[0]['g'], $attr['n'], 0, 0, $link, 0, 0, array('T8[fkey]' => $fid[3])); + } + + private function CheckErr($code) { + if (is_numeric($code)) { + switch ($code) { + default: $msg = '*No message for this error*';break; + case -1: $msg = 'An internal error has occurred';break; + case -2: $msg = 'You have passed invalid arguments to this command, your rapidleech is outdated?';break; + case -3: $msg = 'A temporary congestion or server malfunction prevented your request from being processed';break; + case -4: $msg = 'You have exceeded your command weight per time quota. Please wait a few seconds, then try again';break; + case -9: $msg = 'File not found';break; + case -11: $msg = 'Access violation';break; + case -13: $msg = 'Trying to access an incomplete file';break; + case -14: $msg = 'A decryption operation failed';break; + case -16: $msg = 'User blocked';break; + case -17: $msg = 'Request over quota';break; + case -18: $msg = 'File temporarily not available, please try again later';break; + // Confirmed at page: + case -6: $msg = 'File not found, account was deleted';break; + } + html_error("[Error: $code] $msg."); + } + } + + private function RLCheck() { + if (!function_exists('cURL') || (!function_exists('host_matchs') && !function_exists('host_matches')) || !function_exists('GetDefaultParams')) html_error("Your rapidleech version is outdated and it doesn't support this plugin."); + } + + private function apiReq($atrr, $node='') { + $try = 0; + do { + if ($try > 0) sleep(2); + $ret = $this->doApiReq($atrr, $node); + $try++; + } while ($try < 6 && $ret[0] == -3); + return $ret; + } + + private function doApiReq($atrr, $node='') { + if (!function_exists('json_encode')) html_error('Error: Please enable JSON in php.'); + $page = $this->GetPage('https://g.api.mega.co.nz/cs?id=' . ($this->seqno++) . (!empty($node) ? "&n=$node" : ''), 0, json_encode(array($atrr)), "https://mega.co.nz/\r\nContent-Type: application/json"); + list ($header, $page) = array_map('trim', explode("\r\n\r\n", $page, 2)); + if (is_numeric($page)) return array((int)$page); + if (in_array((int)substr($header, 9, 3), array(500, 503))) return array(-3); // 500 Server Too Busy + return $this->Get_Reply($page); + } + + private function Get_Reply($content) { + if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.'); + if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = substr($content, $pos + 4); + $cb_pos = strpos($content, '{'); + $sb_pos = strpos($content, '['); + if ($cb_pos === false && $sb_pos === false) html_error('Json start braces not found.'); + $sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false; + $content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1); + if (empty($content)) html_error('No json content.'); + $rply = json_decode($content, true); + if (!$rply || count($rply) == 0) html_error('Error reading json.'); + return $rply; + } + + private function str_to_a32($b) { + // Add padding, we need a string with a length multiple of 4 + $b = str_pad($b, 4 * ceil(strlen($b) / 4), "\0"); + return array_values(unpack('N*', $b)); + } + + private function a32_to_str($hex) { + return call_user_func_array('pack', array_merge(array('N*'), $hex)); + } + + private function base64url_encode($data) { + return strtr(rtrim(base64_encode($data), '='), '+/', '-_'); + } + + private function a32_to_base64($a) { + return $this->base64url_encode($this->a32_to_str($a)); + } + + private function base64url_decode($data) { + if (($s = (2 - strlen($data) * 3) % 4) < 2) $data .= substr(',,', $s); + return base64_decode(strtr($data, '-_,', '+/=')); + } + + private function base64_to_a32($s) { + return $this->str_to_a32($this->base64url_decode($s)); + } + + private function aes_cbc_decrypt($data, $key) { + return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); + } + + private function aes_cbc_decrypt_a32($data, $key) { + return $this->str_to_a32($this->aes_cbc_decrypt($this->a32_to_str($data), $this->a32_to_str($key))); + } + + private function decrypt_key($a, $key) { + $x = array(); + for ($i = 0; $i < count($a); $i += 4) $x = array_merge($x, $this->aes_cbc_decrypt_a32(array_slice($a, $i, 4), $key)); + return $x; + } + + private function dec_attr($attr, $key) { + $attr = trim($this->aes_cbc_decrypt($attr, $this->a32_to_str($key))); + if (substr($attr, 0, 6) != 'MEGA{"') return false; + $attr = substr($attr, 4);$attr = substr($attr, 0, strrpos($attr, '}') + 1); + return $this->Get_Reply($attr); + } + + public function CheckBack($header) { + $statuscode = intval(substr($header, 9, 3)); + if ($statuscode != 200) switch ($statuscode) { + case 509: html_error('[Mega] Transfer quota exeeded.'); + case 503: html_error('Too many connections for this download.'); + case 403: html_error('Link used/expired.'); + case 404: html_error('Link expired.'); + default : html_error('[HTTP] '.trim(substr($header, 9, strpos($header, "\n") - 8))); + } + + global $fp; + if (empty($fp) || !is_resource($fp)) html_error("Error: Your rapidleech version is outdated and it doesn't support this plugin."); + if (!empty($_GET['T8']['fkey'])) $key = $this->base64_to_a32(urldecode($_GET['T8']['fkey'])); + elseif (preg_match('@^(T8)?!([^!]{8})!([\w\-\,]{43})@i', parse_url($_GET['referer'], PHP_URL_FRAGMENT), $dat)) $key = $this->base64_to_a32($dat[2]); + else html_error("[CB] File's key not found."); + + $iv = array_merge(array_slice($key, 4, 2), array(0, 0)); + $key = array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7]); + $opts = array('iv' => $this->a32_to_str($iv), 'key' => $this->a32_to_str($key), 'mode' => 'ctr'); + stream_filter_register('MegaDlDecrypt', 'Th3822_MegaDlDecrypt'); + stream_filter_prepend($fp, 'MegaDlDecrypt', STREAM_FILTER_READ, $opts); + } + + private function FSort($a, $b) { + $a = $a['n'];$b = $b['n']; + return strcmp($a, $b); // Case Sensitive Sort + //return strcasecmp($a, $b); // Case Insensitive Sort + //return strnatcmp($a, $b); // Case Sensitive "Natural" Sort + //return strnatcasecmp($a, $b); // Case Insensitive "Natural" Sort + } + + private function Folder($fnid, $fnk) { + $files = $this->apiReq(array('a' => 'f', 'c' => 1), $fnid); + if (is_numeric($files[0])) $this->CheckErr($files[0], 'Cannot get folder contents'); + $dfiles = array(); + foreach ($files[0]['f'] as $file) if ($file['t'] == 0) { + $keys = array(); + foreach (explode('/', $file['k']) as $key) if (strpos($key, ':') !== false && $key = explode(':', $key, 2)) $keys[$key[0]] = $key[1]; + if (!array_key_exists($file['p'], $keys)) continue; + $key = $this->decrypt_key($this->base64_to_a32($keys[$file['p']]), $this->base64_to_a32($fnk)); + if (empty($key)) continue; + $attr = $this->dec_attr($this->base64url_decode($file['a']), array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7])); + if (empty($attr)) html_error('Error while decoding folder: Invalid Key?.'); + $dfiles[$file['h']] = array('k' => $this->a32_to_base64($key), 'n' => $attr['n']); + } + if (empty($dfiles)) html_error('Error while decoding folder: Empty Folder?.'); + uasort($dfiles, array($this, 'FSort')); + $files = array(); + foreach ($dfiles as $file => $key) $files[] = "https://mega.co.nz/#T8!$file!".$key['k']; + $this->moveToAutoDownloader($files); + } +} + +class Th3822_MegaDlDecrypt extends php_user_filter { + private $_td, $_data, $_dlen, $_clen, $bucket; + public function onCreate() { + if (empty($this->params['iv']) || empty($this->params['key']) || empty($this->params['mode'])) return false; + $this->_td = mcrypt_module_open('rijndael-128', '', $this->params['mode'], ''); + $init = mcrypt_generic_init($this->_td, $this->params['key'], $this->params['iv']); + if ($init === false || $init < 0) return false; + return true; + } + + public function filter($in, $out, &$consumed, $stop) { + while ($bucket = stream_bucket_make_writeable($in)) { + if ($bucket->datalen == 0) continue; + $this->bucket = $bucket; + $this->bucket->data = mdecrypt_generic($this->_td, $this->bucket->data); + $consumed += $bucket->datalen; + stream_bucket_append($out, $this->bucket); + } + return PSFS_PASS_ON; + } + + public function onClose() { + mcrypt_generic_deinit($this->_td); + mcrypt_module_close($this->_td); + } +} + +//[24-2-2013] Written by Th3-822. (Rapidleech r415 or newer required) +//[02-3-2013] Added "checks" for validating rapidleech version & added 2 error msg. - Th3-822 +//[27-3-2013] Simplified Stream decrypt function (The other one was not working well... After many tests looks like it's better now :D). - Th3-822 +//[20-7-2013] Fixed link regexp. - Th3-822 +//[09-8-2013] Added folder support and small fixes from upload plugin. (Download links that are fetched from a folder link are not public and only can be downloaded with this plugin.) - Th3-822 + +?> \ No newline at end of file diff --git a/hosts/download/mightyupload_com.php b/hosts/download/mightyupload_com.php new file mode 100644 index 0000000..dcc3bbd --- /dev/null +++ b/hosts/download/mightyupload_com.php @@ -0,0 +1,45 @@ +cookie = array('lang' => 'english'); + $this->page = $this->GetPage($link, $this->cookie); + is_present($this->page, 'File Not Found', 'File Not Found'); + is_present($this->page, 'The file you were looking for could not be found'); + is_present($this->page, 'No such file with this filename', 'Error: Invalid filename, check your link and try again.'); + + if (preg_match('@You have to wait (?:\d+ \w+,\s)?\d+ \w+ till next download@', $this->page, $err)) html_error('Error: '.$err[0]); + + $page2 = cut_str($this->page, '
'); //Cutting page + if (empty($page2)) html_error('Download form not found. File isn\'t available?'); + + $post = array(); + $post['op'] = trim(cut_str($page2, 'name="op" value="', '"')); + if (stripos($post['op'], 'download') !== 0) html_error('Error parsing download post data.'); + $post['id'] = trim(cut_str($page2, 'name="id" value="', '"')); + $post['rand'] = trim(cut_str($page2, 'name="rand" value="', '"')); + $post['method_free'] = urlencode(html_entity_decode(cut_str($page2, 'name="method_free" value="', '"'))); + $post['plugins_are_not_allowed'] = cut_str($page2, 'name="plugins_are_not_allowed" value="', '"'); + + if (preg_match('@[^<>]+]*>(\d+)[^<>]+@i', $page2, $count) && $count[1] > 0) $this->CountDown($count[1]); + + $page = $this->GetPage($link, $this->cookie, $post); + is_present($page, '>Skipped countdown', 'Error: Skipped countdown?.'); + is_present($page, '>Wrong captcha<', 'Error: File needs captcha, captcha was not found.'); + is_present($page, '>Expired session<', 'Error: Expired Download Session.'); + if (preg_match('@You can download files up to \d+ [KMG]b only.@i', $page, $err)) html_error('Error: '.$err[0]); + if (!preg_match('@(?<=[\'\"\t\s>\r\n])https?://[^/\r\n]+/(?:(?:files)|(?:dl?))/[^\'\"\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download link not found.'); + + $this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)))); + } +} + +// [03-9-2013] Written by Th3-822. (XFS, XFS everywhere. D:) + +?> \ No newline at end of file diff --git a/hosts/download/necroupload_com.php b/hosts/download/necroupload_com.php index 5ef52e7..984d938 100644 --- a/hosts/download/necroupload_com.php +++ b/hosts/download/necroupload_com.php @@ -1,4 +1,4 @@ -cookie = array('lang' => 'english'); + + if (empty($_POST['step']) || $_POST['step'] != '1') { + $page = $this->GetPage($link, $this->cookie); + is_present($page, 'File Not Found', 'File Not Found'); + is_present($page, 'The file you were looking for could not be found'); + is_present($page, '>File was removed by user<', 'The file you were looking for could not be found'); + is_present($page, 'No such file with this filename', 'Error: Invalid filename, check your link and try again.'); + } + + if (preg_match('@You have to wait (?:\d+ \w+,\s)?\d+ \w+ till next download@', $page, $err)) html_error('Error: '.$err[0]); + + $page2 = cut_str($page, ''); //Cutting page + if (empty($page2)) html_error('Download form not found. File isn\'t available?'); + + $post = array(); + $post['op'] = trim(cut_str($page2, 'name="op" value="', '"')); + if (stripos($post['op'], 'download') !== 0) html_error('Error parsing download post data.'); + $post['id'] = trim(cut_str($page2, 'name="id" value="', '"')); + $post['fname'] = urlencode(html_entity_decode(trim(cut_str($page2, 'name="fname" value="', '"')))); + $post['referer'] = ''; + $post['hash'] = trim(cut_str($page2, 'name="hash" value="', '"')); + $s_name = trim(cut_str($page2, 'input type="submit" name="', '"')); + $post[$s_name] = trim(cut_str($page2, 'name="'.$s_name.'" value="', '"')); + + if (preg_match('@var\s+countdownNum\s*=\s*(\d+);@i', $page, $count) && $count[1] > 0) $this->CountDown($count[1]); + + $page = $this->GetPage($link, $this->cookie, $post); + is_present($page, '>Skipped countdown', 'Error: Skipped countdown?.'); + is_present($page, '>Wrong captcha<', 'Error: File needs captcha, captcha was not found.'); + is_present($page, '>Expired session<', 'Error: Expired Download Session.'); + if (preg_match('@You can download files up to \d+ [KMG]b only.@i', $page, $err)) html_error('Error: '.$err[0]); + if (!preg_match('@file[\'\"]?\s*:\s*[\'\"](https?://[^/\r\n]+/[^\'\"\t<>\r\n]+)[\'\"]@i', $page, $dlink)) html_error('Error: Download Link not found'); + + $FileName = urldecode($post['fname']); + $this->RedirectDownload($dlink[1], $FileName, 0, 0, 0, $FileName); + } +} + +// [06-10-2013] Written by Th3-822. (XFS, XFS everywhere. D:) + +?> \ No newline at end of file diff --git a/hosts/download/putlocker_com.php b/hosts/download/putlocker_com.php index 23883c8..0916526 100644 --- a/hosts/download/putlocker_com.php +++ b/hosts/download/putlocker_com.php @@ -9,8 +9,9 @@ class putlocker_com extends DownloadClass { private $link, $page, $cookie, $pA, $Getregexp, $DLregexp; public function Download($link) { global $premium_acc; - $this->link = str_ireplace(array('://putlocker.com/', '/mobile/file/'), array('://www.putlocker.com/', '/file/'), $link); - $this->Getregexp = '@(https?://(?:[^/\r\n\t\s\'\"<>]+\.)?putlocker\.com)?/get_file\.php\?(?:(?:id)|(?:file)|(stream))=[^\r\n\t\s\'\"<>]+@i'; + $this->link = str_ireplace(array('://putlocker.com/', '://sockshare.com/', '/mobile/file/'), array('://www.putlocker.com/', '://www.sockshare.com/', '/file/'), $link); + $this->domain = parse_url($this->link, PHP_URL_HOST); + $this->Getregexp = '@(https?://(?:[^/\r\n\t\s\'\"<>]+\.)?(?:putlocker|sockshare)\.com)?/get_file\.php\?(?:(?:id)|(?:file)|(stream))=[^\r\n\t\s\'\"<>]+@i'; $this->DLregexp = '@Location: (https?://(?:(?:[^/\r\n]+/(?:(?:download)|(?:premium)))|(?:cdn\.[^/\r\n]+))/[^\r\n]*)@i'; $this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true); if (empty($_REQUEST['step'])) { @@ -29,7 +30,7 @@ public function Download($link) { $cookie = (empty($c[1]) ? urldecode($premium_acc['putlocker_com']['cookie']) : urldecode($c[1])); if (strpos($cookie, '%')) $cookie = urldecode($cookie); $this->cookie = array('auth' => urlencode($cookie)); - $page = $this->GetPage('http://www.putlocker.com/', $this->cookie); + $page = $this->GetPage('http://'.$this->domain.'/', $this->cookie); is_notpresent($page, '>Sign Out', 'Cookie Error: Invalid Cookie?.'); is_present($page, '>( Free )<', 'Cookie Error: Account isn\'t premium'); $this->cookie = GetCookiesArr($page, $this->cookie); @@ -50,8 +51,8 @@ public function Download($link) { private function FreeDL() { if (!preg_match($this->Getregexp, $this->page, $DL)) { - if (!preg_match('@var\scountdownNum\s?=\s?(\d+);@i', $this->page, $wait)) html_error('Countdown not found.'); - elseif ($wait[1] > 0) $this->CountDown($wait[1]); + if (!preg_match('@var\scountdownNum\s?=\s?(\d+);@i', $this->page, $wait)) $wait = array(1 => 1); + $this->CountDown($wait[1]); if (!preg_match('@page, $hash)) html_error('Filehash not found.'); $post = array(); @@ -72,14 +73,14 @@ private function FreeDL() { if (stripos($page, 'Content-Disposition: attachment;') !== false) { $fname = cut_str($page, 'Content-Disposition: attachment; filename=', "\r\n"); if (!empty($fname)) { - $fname = trim(str_replace(str_split('\\:*?"<>|=;'."\t\r\n"), '', $fname)); + $fname = trim(str_replace(str_split('\\:*?"<>|=;/'."\t\r\n"), '', $fname)); if(strpos($fname, '/') !== false) $fname = basename($fname); } } if (empty($fname)) { if (preg_match('@([^<>\r\n\t\"]+)\s\|\sPutLocker@i', $this->page, $title)) { $title = trim(html_entity_decode($title[1])); - $fname = str_replace(str_split('\\:*?"<>|=;'."\t\r\n"), '', $title); + $fname = str_replace(str_split('\\:*?"<>|=;/'."\t\r\n"), '', $title); } else $fname = urldecode(basename(parse_url($dlink[1], PHP_URL_PATH))); } } else { // Stream @@ -298,5 +299,6 @@ private function SaveCookies($user, $pass, $filename = 'putlocker_dl.php') { //[16-9-2012] Written by Th3-822. //[01-4-2013] Added missing / to str_ireplace & Small changes. - Th3-822 +//[20-9-2013] Allow freedl of files with 1 seg countdown. - Th3-822 ?> \ No newline at end of file diff --git a/hosts/download/rapidgator_net.php b/hosts/download/rapidgator_net.php index 25e209d..d9d58a1 100644 --- a/hosts/download/rapidgator_net.php +++ b/hosts/download/rapidgator_net.php @@ -9,7 +9,7 @@ class rapidgator_net extends DownloadClass { private $page, $link, $cookie; public function Download($link) { global $premium_acc; - $this->link = $link; + $this->link = str_ireplace(array('://www.rg.to/', '://rg.to/'), '://rapidgator.net/', $link); $this->cookie = array('lang' => 'en'); if (empty($_POST['step']) || $_POST['step'] != '1') { $this->page = $this->GetPage($this->link, $this->cookie); @@ -17,7 +17,8 @@ public function Download($link) { // Sometimes i see a couple of redirects that don't let do anything without doing them first, let skip them. $rdc = 0; - while (($redir = $this->ChkRGRedirs($this->page)) && $rdc < 5) { + $redir = $link; + while (($redir = $this->ChkRGRedirs($this->page, parse_url($redir))) && $rdc < 5) { $this->page = $this->GetPage($redir, $this->cookie); $this->cookie = GetCookiesArr($this->page, $this->cookie); $rdc++; @@ -47,7 +48,7 @@ private function FreeDL() { if (!preg_match('@secs\s*=\s*(\d+)\s*;@i', $this->page, $cd)) html_error('Countdown not found.'); $page = $this->GetPage('http://rapidgator.net/download/AjaxStartTimer?fid='.$fid[1], $this->cookie, 0, $this->link."\r\nX-Requested-With: XMLHttpRequest"); - if (!preg_match('@"sid":"([^"|\}]+)"@i', $page, $sid)) html_error('Session id not found.'); + if (!preg_match('@"sid":"([^"\}]+)"@i', $page, $sid)) html_error('Session id not found.'); if ($cd[1] > 0) $this->CountDown($cd[1]); @@ -59,10 +60,10 @@ private function FreeDL() { if (!preg_match('@https?://api\.solvemedia\.com/papi/challenge\.noscript\?k=\w+@i', $page, $cframe)) html_error('CAPTCHA not found.'); $page = $this->GetPage($cframe[0], 0, 0, $capt_url); - if (!preg_match('@<img [^/|<|>]*src\s?=\s?\"((https?://[^/|\"|\<|\>]+)?/papi/media[^\"|<|>]+)\"@i', $page, $imgurl)) html_error('CAPTCHA img not found.'); + if (!preg_match('@<img [^/<>]*src\s?=\s?\"((https?://[^/\"\<\>]+)?/papi/media[^\"<>]+)\"@i', $page, $imgurl)) html_error('CAPTCHA img not found.'); $imgurl = (empty($imgurl[2])) ? 'http://api.solvemedia.com'.$imgurl[1] : $imgurl[1]; - if (!preg_match_all('@<input [^/|<|>]*type\s?=\s?\"?hidden\"?[^/|<|>]*\s?name\s?=\s?\"(\w+)\"[^/|<|>]*\s?value\s?=\s?\"([^\"|<|>]+)\"[^/|<|>]*/?\s*>@i', $page, $forms)) html_error('CAPTCHA data not found.'); + if (!preg_match_all('@<input [^/<>]*type\s?=\s?\"?hidden\"?[^/<>]*\s?name\s?=\s?\"(\w+)\"[^/<>]*\s?value\s?=\s?\"([^\"<>]+)\"[^/<>]*/?\s*>@i', $page, $forms)) html_error('CAPTCHA data not found.'); $forms = array_combine($forms[1], $forms[2]); $data = $this->DefaultParamArr($this->link, $this->cookie); @@ -90,21 +91,21 @@ private function FreeDL() { $url = 'http://api.solvemedia.com/papi/verify.noscript'; $page = $this->GetPage($url, 0, $post, $capt_url); - if (!preg_match('@(https?://[^/|\'|\"|\<|\>|\r|\n]+)?/papi/verify\.pass\.noscript\?[^/|\'|\"|\<|\>|\r|\n]+@i', $page, $resp)) { + if (!preg_match('@(https?://[^/\'\"\<\>\r\n]+)?/papi/verify\.pass\.noscript\?[^/\'\"\<\>\r\n]+@i', $page, $resp)) { is_present($page, '/papi/challenge.noscript', 'Wrong CAPTCHA entered.'); html_error('Error sending CAPTCHA.'); } $resp = (empty($resp[1])) ? 'http://api.solvemedia.com'.$resp[0] : $resp[0]; $page = $this->GetPage($resp, 0, 0, $url); - if (!preg_match('@>[\s|\t|\r|\n]*([^<|>|\r|\n]+)[\s|\t|\r|\n]*</textarea>@i', $page, $gibberish)) html_error('CAPTCHA response not found.'); + if (!preg_match('@>[\s\t\r\n]*([^<>\r\n]+)[\s\t\r\n]*</textarea>@i', $page, $gibberish)) html_error('CAPTCHA response not found.'); $post = array('DownloadCaptchaForm%5Bcaptcha%5D' => '', 'adcopy_challenge' => urlencode($gibberish[1]), 'adcopy_response' => 'manual_challenge'); $page = $this->GetPage($capt_url, $this->cookie, $post); is_present($page, "\r\nSet-Cookie: failed_on_captcha=1", 'Captcha expired. Try again in 15 minutes.'); - if (!preg_match('@https?://pr\d+\.rapidgator\.net/[^\r|\n|\"|\'|<|>|\s|\t]+@i', $page, $dlink)) html_error('Error: Download link not found.'); + if (!preg_match('@https?://pr\d+\.rapidgator\.net/[^\r\n\"\'<>\s\t]+@i', $page, $dlink)) html_error('Error: Download link not found.'); $this->RedirectDownload($dlink[0], 'rapidgatorfr'); } } @@ -114,7 +115,7 @@ private function PremiumDL() { if (preg_match('@You have reached daily quota of downloaded information for premium accounts. At the moment, the quota is \d+ GB@i', $page, $err)) html_error($err[0]); - if (!preg_match('@https?://pr\d+\.rapidgator\.net/[^\r|\n|\"|\'|<|>|\s|\t]+@i', $page, $dlink)) html_error('Error: Download-link not found.'); + if (!preg_match('@https?://pr\d+\.rapidgator\.net/[^\r\n\"\'<>\s\t]+@i', $page, $dlink)) html_error('Error: Download-link not found.'); $this->RedirectDownload($dlink[0], 'rapidgatorpr'); } @@ -142,12 +143,13 @@ private function Login() { } $purl = 'http://rapidgator.net/'; - $page = $this->GetPage('https://rapidgator.net/auth/login', $this->cookie, $post, $purl); + $page = $this->GetPage($purl.'auth/login', $this->cookie, $post, $purl); $this->cookie = GetCookiesArr($page, $this->cookie); // There are more of those redirects at login $rdc = 0; - while (($redir = $this->ChkRGRedirs($page, '/auth/login')) && $rdc < 5) { + $redir = $purl.'auth/login'; + while (($redir = $this->ChkRGRedirs($page, parse_url($redir), '/auth/login')) && $rdc < 5) { $page = $this->GetPage($redir, $this->cookie, $post, $purl); $this->cookie = GetCookiesArr($page, $this->cookie); $rdc++; @@ -191,18 +193,18 @@ private function Login() { } // 4 RG: You don't have nothing to read here :D - private function ChkRGRedirs($page, $rgpath = '/') { + private function ChkRGRedirs($page, $lasturl, $rgpath = '/') { $hpos = strpos($page, "\r\n\r\n"); $headers = empty($hpos) ? $page : substr($page, 0, $hpos); - if (stripos($headers, "\r\nLocation: ") === false && stripos($page, "\r\nSet-Cookie: ") === false && !(cut_str($page, '<title>', ''))) { + if (stripos($headers, "\nLocation: ") === false && stripos($headers, "\nSet-Cookie: ") === false && !(cut_str($page, '', ''))) { if (empty($_GET['rgredir'])) { global $PHP_SELF; if (!($body = cut_str($page, '', ''))) $body = $page; if (stripos($body, 'DefaultParamArr($this->link); - $data['rgredir'] = ''; + $data['rgredir'] = $pform = $sform = ''; $data['premium_acc'] = $_REQUEST['premium_acc']; // I should add 'premium_acc' to DefaultParamArr() if ($login) { $data['pA_encrypted'] = 'true'; @@ -211,23 +213,43 @@ private function ChkRGRedirs($page, $rgpath = '/') { } if (!($js = cut_str($body, '')) && !($js = cut_str($body, ''))) html_error('Cannot get the redirect code.'); $js = str_ireplace(array('window.location.href','document.location.href'), 'document.getElementById("rgredir").value', $js); - if (stripos($js, 'document.body.onmousemove') !== false) { // New redirect code + if (strpos($js, 'document.body.onmousemove') !== false) { // New redirect code $js = preg_replace('@^[\s\t]*\w+\([^\;]+;@i', '', $js); $js = preg_replace('@document\.body\.onmousemove[\s\t]*=[\s\t]*function[\s\t]*\(\)[\s\t]*\{@i', '', $js); $js = preg_replace('@document\.body\.onmousemove[\s\t]*=[\s\t]*\'\';?\};[\s\t]*window\.setTimeout\([\s\t]*((\"[^\"]+\")|(\'[^\']+\'))[^\;]+;[\s\t\r\n]*$@i', '', $js); + } elseif (($funcPos = stripos($js, 'function WriteA(')) !== false) { // JS + aaaaaaaaaaaaaaaaaaaaaaaaa + $links = array(); + if (preg_match_all('@]*\shref="((?:https?://(?:www\.)?rapidgator\.net)?/[^\"]+)"[^>]*\sid="([A-Za-z][\w\.\-]*)"@i', $body, $a)) $links = array_merge($links, array_combine($a[2], $a[1])); + if (preg_match_all('@]*\sid="([A-Za-z][\w\.\-]*)"[^>]*\shref="((?:https?://(?:www\.)?rapidgator\.net)?/[^\"]+)"@i', $body, $a)) $links = array_merge($links, array_combine($a[1], $a[2])); + if (empty($links)) html_error('Cannot get the redirect fields'); + unset($a); + + $jsLinks = ''; + foreach ($links as $key => $link) { + if (strpos($link, '://') === false) $link = (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net' . $link; + $jsLinks .= "$key: '".addslashes($link)."', "; + } + unset($links, $key, $link); + $jsLinks = '{' . substr($jsLinks, 0, -2) . '}'; + $func = substr($js, $funcPos); + if (!preg_match('@\.getElementById\(([\$_A-Za-z][\$\w]*)\)@i', $func, $linkVar)) html_error('Cannot edit redirect JS'); + $linkVar = $linkVar[1]; + unset($func); + $js = substr($js, 0, $funcPos)."\nvar T8RGLinks = $jsLinks;\nif ($linkVar in T8RGLinks) document.getElementById('rgredir').value = T8RGLinks[$linkVar];"; + unset($jsLinks, $funcPos, $linkVar); } echo "\n
\n"; foreach ($data as $name => $input) echo "\n"; echo "
"; - echo "\n\n\n\n"; + echo "\n\n\n\n"; exit; } else { $_GET['rgredir'] = rawurldecode($_GET['rgredir']); if (strpos($_GET['rgredir'], '://')) $_GET['rgredir'] = parse_url($_GET['rgredir'], PHP_URL_PATH); if (empty($_GET['rgredir']) || substr($_GET['rgredir'], 0, 1) != '/') html_error('Invalid redirect value.'); - $redir = 'http://rapidgator.net'.$_GET['rgredir']; + $redir = (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net'.$_GET['rgredir']; } - } elseif (preg_match('@Location: ((https?://(?:[^/|\r|\n]+\.)?rapidgator\.net)?'.$rgpath.'[^\r|\n]*)@i', $headers, $redir)) $redir = (empty($redir[2])) ? 'http://rapidgator.net'.$redir[1] : $redir[1]; + } elseif (preg_match('@Location: ((https?://(?:[^/\r\n]+\.)?rapidgator\.net)?'.$rgpath.'[^\r\n]*)@i', $headers, $redir)) $redir = (empty($redir[2])) ? (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net'.$redir[1] : $redir[1]; return (empty($redir) ? false : $redir); } @@ -239,5 +261,8 @@ private function ChkRGRedirs($page, $rgpath = '/') { // [09-9-2012] Fixed redirect issues, more code added & small edits. -Th3-822 // [02-10-2012] Fixed for new weird redirect code. - Th3-822 // [28-1-2013] Added Login captcha support. - Th3-822 +// [10-8-2013] Fixed redirects (again). - Th3-822 +// [25-11-2013] Fixed redirects function (aagain :D ). - Th3-822 +// [03-01-2013] Added support for rg.to domain. - Th3-822 ?> \ No newline at end of file diff --git a/hosts/download/sendspace_com.php b/hosts/download/sendspace_com.php index 5a62772..07b79c5 100644 --- a/hosts/download/sendspace_com.php +++ b/hosts/download/sendspace_com.php @@ -1,83 +1,111 @@ link = str_ireplace('://sendspace.com', '://www.sendspace.com', $link); + $this->pA = (empty($_GET['premium_user']) || empty($_GET['premium_pass']) ? false : true); + if ($_GET['premium_acc'] == 'on' && ($this->pA || (!empty($premium_acc['sendspace_com']['user']) && !empty($premium_acc['sendspace_com']['pass'])))) $this->Login(); + else $this->Free(); + } - public function Download($link) { - global $premium_acc; - if (($_REQUEST['premium_acc'] == 'on' && $_REQUEST['premium_user'] && $_REQUEST['premium_pass']) || ($_REQUEST['premium_acc'] == 'on' && $premium_acc['sendspace_com']['user'] && $premium_acc['sendspace_com']['pass'])) { - $this->Premium($link); - } else { - $this->Free($link); - } - } - - private function Free($link) { - global $Referer; - $page = $this->GetPage($link); - if (!preg_match('@http:\/\/fs(\d+)?n(\d+)?\.sendspace\.com\/[^|\r|\n|\'"]+@i', $page, $dl)) { //non direct link - if (preg_match('@Location: (http:\/\/.+sendspace\.com\/pro\/[^|\r|\n]+)@i', $page, $check)) { - $link = trim($check[1]); - $page = $this->GetPage($link); - } - } - is_present($page, 'Sorry, the file you requested is not available.'); - $cookie = GetCookies($page); - $dlink = html_entity_decode(urldecode(trim($dl[0])), ENT_QUOTES, 'UTF-8'); - $filename = parse_url($dlink); - $FileName = basename($filename['path']); - $this->RedirectDownload($dlink, $FileName, $cookie, 0, $Referer); - exit(); - } - - private function Premium($link) { - $pA = ($_REQUEST["premium_user"] && $_REQUEST["premium_pass"] ? true : false); - $cookie = $this->Login($pA); - $page = $this->GetPage($link, $cookie); - if (!preg_match('@http:\/\/fs(\d+)?n(\d+)?\.sendspace\.com\/[^|\r|\n|\'"]+@i', $page, $dl)) { //non direct link - if (preg_match('@Location: (http:\/\/.+sendspace\.com\/pro\/[^|\r|\n]+)@i', $page, $check)) { - $link = trim($check[1]); - $page = $this->GetPage($link, $cookie); - } - } - is_present($page, 'Sorry, the file you requested is not available.'); - $dlink = html_entity_decode(urldecode(trim($dl[0])), ENT_QUOTES, 'UTF-8'); - $filename = parse_url($dlink); - $FileName = basename($filename['path']); - $this->RedirectDownload($dlink, $FileName, $cookie, 0, $Referer); - } - - private function Login($pA = false) { - global $premium_acc; - $user = ($pA ? $_REQUEST["premium_user"] : $premium_acc["sendspace_com"]["user"]); - $pass = ($pA ? $_REQUEST["premium_pass"] : $premium_acc["sendspace_com"]["pass"]); - if (empty($user) || empty($pass)) { - html_error("Login Failed: email or password is empty. Please check login data."); - } - $post['action'] = 'login'; - $post['submit'] = 'login'; - $post['target'] = urlencode('%2F'); - $post['action_type'] = 'login'; - $post['remember'] = '1'; - $post['username'] = $user; - $post['password'] = $pass; - $post['remember'] = 'on'; - $page = $this->GetPage('http://www.sendspace.com/login.html', 0, $post, 'http://www.sendspace.com/'); - $cookie = GetCookies($page); - is_present($cookie, "ssal=deleted", "Login incorrect retype your username or password correctly"); - - $page = $this->GetPage('http://www.sendspace.com/mysendspace/myindex.html', $cookie); - is_notpresent($page, 'Your membership is valid', 'Account Free, login not validated!'); - - return $cookie; - } + private function Free() { + $this->page = $this->GetPage($this->link); + $this->cookie = GetCookiesArr($this->page); + $this->chkCaptcha(); + if (preg_match('@\nLocation: ((https?://www\.sendspace\.com)?/[^\r\n\"\'\t<>]+)@i', $this->page, $check)) { + $check[1] = (empty($check[2])) ? 'http://www.sendspace.com'.$check[1] : $check[1]; + $this->page = $this->GetPage($check[1]); + $this->cookie = GetCookiesArr($this->page, $this->cookie); + } + is_present($this->page, 'Sorry, the file you requested is not available.'); + + if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*sendspace\.com/dl/[^\r\n\"\'\t<>]+@i', $this->page, $dl)) html_error('Download Link Not Found.'); + + $this->RedirectDownload($dl[0], basename(parse_url($dl[0], PHP_URL_PATH)), $this->cookie); + } + + private function Premium() { + $this->page = $this->GetPage($this->link, $this->cookie); + $this->chkCaptcha(); + if (preg_match('@\nLocation: ((https?://www\.sendspace\.com)?/[^\r\n\"\'\t<>]+)@i', $this->page, $check)) { + $check[1] = (empty($check[2])) ? 'http://www.sendspace.com'.$check[1] : $check[1]; + $this->page = $this->GetPage($check[1]); + $this->cookie = GetCookiesArr($this->page, $this->cookie); + } + is_present($this->page, 'Sorry, the file you requested is not available.'); + + if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*sendspace\.com/dlp/[^\r\n\"\'\t<>]+@i', $this->page, $dl)) html_error('Download-Link Not Found.'); + + $this->RedirectDownload($dl[0], basename(parse_url($dl[0], PHP_URL_PATH)), $this->cookie); + } + + private function Login() { + global $premium_acc; + $site = 'http://www.sendspace.com'; + $post = array(); + $post['action'] = 'login'; + $post['submit'] = 'login'; + $post['target'] = '%252F'; + $post['action_type'] = 'login'; + $post['remember'] = '1'; + $post['username'] = urlencode($this->pA ? $_GET['premium_user'] : $premium_acc['sendspace_com']['user']); + $post['password'] = urlencode($this->pA ? $_GET['premium_pass'] : $premium_acc['sendspace_com']['pass']); + $post['remember'] = 'on'; + $page = $this->GetPage("$site/login.html", 0, $post, "$site/"); + + is_present($page, 'check your username and password', 'Login Failed: Invalid User/Password.'); + $this->cookie = GetCookiesArr($page); + if (empty($this->cookie['ssal'])) html_error('Login Error: Cannot find "ssal" cookie.'); + + $page = $this->GetPage("$site/mysendspace/myindex.html", $this->cookie, 0, "$site/"); + is_notpresent($page, 'Your account needs to be renewed in', 'Login Failed: Account Isn\'t Premium.'); + + $this->Premium(); + } + + private function Show_reCaptcha($pid, $inputs, $sname = 'Download File') { + global $PHP_SELF; + if (!is_array($inputs)) html_error('Error parsing captcha data.'); + + // Themes: 'red', 'white', 'blackglass', 'clean' + echo "\n\n

\n"; + foreach ($inputs as $name => $input) echo "\n"; + echo "
\n\n
\n\n"; + exit; + } + + private function chkCaptcha() { + if (stripos($this->page, 'Please complete the form below:') === false) return; + if (!empty($_POST['step']) && $_POST['step'] == '1') { + if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.'); + $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie']))); + $post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']); + $this->page = $this->GetPage($this->link, $this->cookie, $post); + if (stripos($this->page, 'You entered an invalid captcha') !== false) { + echo "\nYou entered an invalid captcha, please try again.
"; + unset($_POST['step']); + $this->chkCaptcha(); + } + } else { + if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*(?:google\.com/recaptcha/api|recaptcha\.net)/(?:challenge|noscript)\?k=([\w|\-]+)@i', $this->page, $cpid)) html_error('reCaptcha Not Found.'); + $data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie))); + $data['step'] = '1'; + $this->Show_reCaptcha($cpid[1], $data); + exit; + } + } } // Use PREMIUM? [szalinski 09-May-09] // fix free download by kaox 19-dec-2009 // Fix premium & free by Ruud v.Tony 03-Okt-2011 +// [16-6-2013] Rewritten & Added captcha support. - Th3-822 + ?> \ No newline at end of file diff --git a/hosts/download/turbobit_net.php b/hosts/download/turbobit_net.php index bc0b5bb..0af0923 100644 --- a/hosts/download/turbobit_net.php +++ b/hosts/download/turbobit_net.php @@ -118,16 +118,39 @@ private function PremiumDL() { $this->RedirectDownload(html_entity_decode($dllink[0]), 'turbobit_pr', $this->cookie); } + private function Show_reCaptcha($pid, $inputs, $sname = 'Download File') { + global $PHP_SELF; + if (!is_array($inputs)) html_error('Error parsing captcha data.'); + + // Themes: 'red', 'white', 'blackglass', 'clean' + echo "\n"; + + echo "\n

\n"; + foreach ($inputs as $name => $input) echo "\n"; + echo ""; + echo "
"; + echo "\n"; + echo "\n"; + echo "
\n\n"; + exit; + } + private function Login($user, $pass) { $purl = 'http://turbobit.net/'; - if (!empty($_POST['step']) && $_POST['step'] == '1') { - if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.'); + if (!empty($_POST['step']) && ($_POST['step'] == '1' || $_POST['step'] == '2')) { $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie']))); $post = array(); $post['user%5Blogin%5D'] = urlencode($user); $post['user%5Bpass%5D'] = urlencode($pass); - $post['user%5Bcaptcha_response%5D'] = urlencode($_POST['captcha']); + if ($_POST['step'] == '1') { + if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.'); + $post['user%5Bcaptcha_response%5D'] = urlencode($_POST['captcha']); + } else { + if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.'); + $post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']); + $post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']); + } $post['user%5Bcaptcha_type%5D'] = urlencode($_POST['c_type']); $post['user%5Bcaptcha_subtype%5D'] = (!empty($_POST['c_subtype']) ? urlencode($_POST['c_subtype']) : ''); $post['user%5Bmemory%5D'] = 'on'; @@ -147,6 +170,8 @@ private function Login($user, $pass) { is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect.'); is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail.'); is_present($page, 'Incorrect verification code', 'Login Failed: Wrong CAPTCHA entered.'); + is_present($page, 'Incorrect captcha code', 'Login Failed: Wrong Recaptcha entered.'); + // is_present($page, 'Limit of login attempts exceeded for your account. It has been temporarily locked.', 'Login Failed: Account Temporally Locked.'); if (empty($redir) || $redir != $purl) $page = $this->GetPage($purl, $this->cookie, 0, $purl); is_notpresent($page, '/user/logout">Logout<', 'Login Failed.'); @@ -160,7 +185,7 @@ private function Login($user, $pass) { $post['user%5Bpass%5D'] = urlencode($pass); $post['user%5Bmemory%5D'] = 'on'; $post['user%5Bsubmit%5D'] = 'Login'; - $page = $this->GetPage($purl.'user/login', $this->cookie, $post, $purl); + $page = $this->GetPage($purl.'user/login', $this->cookie, $post, $purl.'login'); $this->cookie = GetCookiesArr($page, $this->cookie); if (!empty($this->cookie['user_isloggedin']) && $this->cookie['user_isloggedin'] == '1') { @@ -181,41 +206,53 @@ private function Login($user, $pass) { is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect'); is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail'); + // is_present($page, 'Limit of login attempts exceeded for your account. It has been temporarily locked.', 'Login Failed: Account Temporally Locked'); - if (!preg_match('@(https?://[^/\r\n\t\s\'\"<>]+)?/captcha/[^\r\n\t\s\'\"<>]+@i', $page, $imgurl)) { - if (stripos($page, '/user/logout">Logout<') !== false) { - $this->SaveCookies($user, $pass); // Update cookies file - is_present($page, 'Turbo Access denied', 'Login Failed: Account isn\'t premium'); - return $this->PremiumDL(); - } else html_error('CAPTCHA not found.'); - } - $imgurl = (empty($imgurl[1])) ? 'http://turbobit.net'.$imgurl[0] : $imgurl[0]; - $imgurl = html_entity_decode($imgurl); - - if (!preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]+)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_type\][\'\"]@i', $page, $c_type) || !preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]*)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_subtype\][\'\"]@i', $page, $c_subtype)) html_error('CAPTCHA data not found.'); - - - //Download captcha img. - $capt_page = $this->GetPage($imgurl, $this->cookie); - $capt_img = substr($capt_page, strpos($capt_page, "\r\n\r\n") + 4); - $imgfile = DOWNLOAD_DIR . 'turbobit_captcha.png'; - - if (file_exists($imgfile)) unlink($imgfile); - if (!write_file($imgfile, $capt_img)) html_error('Error getting CAPTCHA image.'); - unset($capt_page, $capt_img); - - $data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie))); - $data['step'] = '1'; - $data['c_type'] = urlencode($c_type[1]); - $data['c_subtype'] = urlencode($c_subtype[1]); - $data['premium_acc'] = 'on'; // I should add 'premium_acc' to DefaultParamArr() - if ($this->pA) { - $data['pA_encrypted'] = 'true'; - $data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe. - $data['premium_pass'] = urlencode(encrypt($pass)); // And this too. - } - $this->EnterCaptcha($imgfile.'?'.time(), $data); - exit; + if (preg_match('@(https?://[^/\r\n\t\s\'\"<>]+)?/captcha/[^\r\n\t\s\'\"<>]+@i', $page, $imgurl)) { + $imgurl = (empty($imgurl[1])) ? 'http://turbobit.net'.$imgurl[0] : $imgurl[0]; + $imgurl = html_entity_decode($imgurl); + + if (!preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]+)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_type\][\'\"]@i', $page, $c_type) || !preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]*)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_subtype\][\'\"]@i', $page, $c_subtype)) html_error('CAPTCHA data not found.'); + + + //Download captcha img. + $capt_page = $this->GetPage($imgurl, $this->cookie); + $capt_img = substr($capt_page, strpos($capt_page, "\r\n\r\n") + 4); + $imgfile = DOWNLOAD_DIR . 'turbobit_captcha.png'; + + if (file_exists($imgfile)) unlink($imgfile); + if (!write_file($imgfile, $capt_img)) html_error('Error getting CAPTCHA image.'); + unset($capt_page, $capt_img); + + $data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie))); + $data['step'] = '1'; + $data['c_type'] = urlencode($c_type[1]); + $data['c_subtype'] = urlencode($c_subtype[1]); + $data['premium_acc'] = 'on'; // I should add 'premium_acc' to DefaultParamArr() + if ($this->pA) { + $data['pA_encrypted'] = 'true'; + $data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe. + $data['premium_pass'] = urlencode(encrypt($pass)); // And this too. + } + $this->EnterCaptcha($imgfile.'?'.time(), $data); + exit; + } elseif (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $page, $pid)) { + $data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie))); + $data['step'] = '2'; + $data['c_type'] = 'recaptcha'; + $data['premium_acc'] = 'on'; // I should add 'premium_acc' to DefaultParamArr() + if ($this->pA) { + $data['pA_encrypted'] = 'true'; + $data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe. + $data['premium_pass'] = urlencode(encrypt($pass)); // And this too. + } + $this->Show_reCaptcha($pid[1], $data, 'Login'); + exit; + } elseif (stripos($page, '/user/logout">Logout<') !== false) { + $this->SaveCookies($user, $pass); // Update cookies file + is_present($page, 'Turbo Access denied', 'Login Failed: Account isn\'t premium'); + return $this->PremiumDL(); + } else html_error('CAPTCHA not found.'); } } @@ -282,6 +319,7 @@ private function SaveCookies($user, $pass, $filename = 'turbobit_dl.php') { } } -//[9-01-2013] Written by Th3-822. +//[09-1-2013] Written by Th3-822. +//[07-6-2013] Added login recaptcha support. - Th3-822 ?> \ No newline at end of file diff --git a/hosts/download/upafile_com.php b/hosts/download/upafile_com.php index 489d5bc..5f1edb7 100644 --- a/hosts/download/upafile_com.php +++ b/hosts/download/upafile_com.php @@ -1,4 +1,4 @@ -link = $link; - if (!$_REQUEST['step']) { - $this->page = $this->GetPage($this->link); - if (preg_match_all('/href="([^\r\n"]+)" class="file"/', $this->page, $match, PREG_SET_ORDER)) { - $arr_link = array(); - foreach ($match as $tmp) $arr_link[] = "http://uploaded.net/$tmp[1]"; - $this->moveToAutoDownloader($arr_link); - } - is_present($this->page, 'doesn\'t contain files', 'The folder link doesn\'t contain any files!'); - is_present($this->page, '/404', 'File not found or set to private only'); - is_present($this->page, 'This file was protected by a password against unauthorised downloads'); - $this->cookie = GetCookiesArr($this->page); - } - if (($_REQUEST["cookieuse"] == "on" && preg_match("/login\s?=\s?(\w{84})/i", $_REQUEST["cookie"], $c)) || ($_REQUEST["premium_acc"] == "on" && $premium_acc["uploaded_net"]["cookie"])) { - $loginc = (empty($c[1]) ? $premium_acc["uploaded_net"]["cookie"] : $c[1]); - return $this->login($loginc); - } elseif ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_user'] && $_REQUEST['premium_pass']) || ($premium_acc['uploaded_net']['user'] && $premium_acc['uploaded_net']['pass']))) { - return $this->login(); - } else { - return $this->Free(); - } - } - - private function login($loginc=false) { - global $premium_acc; - - $posturl = 'http://uploaded.net/'; - if (!$loginc) { - $id = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["uploaded_net"] ["user"]); - $pw = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["uploaded_net"] ["pass"]); - if (empty($id) || empty($pw)) html_error("Login failed, username or password is empty!"); - - $post = array(); - $post['id'] = $id; - $post['pw'] = $pw; - $page = $this->GetPage($posturl . 'io/login', $this->cookie, $post, $posturl, 0, 1); - is_present($page, "Error[" . cut_str($page, 'err":"', '"')) . "]"; - $this->cookie = GetCookiesArr($page, $this->cookie); - } elseif (strlen($loginc) == 84) { - $this->cookie['login'] = $loginc; - } else { - html_error("Error[Cookie Invalid(" . strlen($loginc) . " != 84). Try to encode your cookie first!]"); - } - - $page = $this->GetPage($posturl . 'me', $this->cookie, 0, $posturl); - $this->cookie = GetCookiesArr($page, $this->cookie, true, array('', 'deleted', '""')); - is_present($page, 'Free', 'Error[Account isn\'t Premium!]'); - is_present($page, 'ocation: http://uploaded.net', 'Error[Cookie Failed!]'); - - $quota = cut_str($page, '
'); - if (!preg_match_all('/class="cB">(\d.+)\s? (\wB)<\/\w+><\/th>/i', $quota, $tr)) html_error('Error[Form account profile may have changed!]'); - - $this->changeMesg(lang(300) . "
Uploaded.net Premium Download
Traffic: For Downloading: {$tr[1][0]} {$tr[2][0]}, Flexible usable contingent for DDL: {$tr[1][1]} {$tr[2][1]}, Total: {$tr[1][2]} {$tr[2][2]}."); - if ((round($tr[1][2]) <= 100) && ($tr[2][2] != 'GB')) html_error("Error[Traffic is exhausted! Total Traffic Left: {$tr[1][2]} {$tr[2][2]}]"); - - return $this->Premium(); - } - - private function Premium() { - - $page = $this->GetPage($this->link, $this->cookie); - is_present($page, "Traffic exhausted", "Premium account is out of Bandwidth"); - if (!preg_match('/https?:\/\/.+\.uploaded\.net(:\d+)?\/dl\/[^\r\n\'"]+/', $page, $dl)) html_error('Error[Download link - PREMIUM not found!]'); - $dlink = trim($dl[0]); - $this->RedirectDownload($dlink, "uploaded", $this->cookie); - } - - private function Free() { - if ($_REQUEST['step'] == '1') { - $post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field']; - $post['recaptcha_response_field'] = $_POST['recaptcha_response_field']; - $this->link = urldecode($_POST['link']); - $this->cookie = urldecode($_POST['cookie']); - $recap = $_POST['recap']; - $page = $this->GetPage(str_replace('/file/', '/io/ticket/captcha/', $this->link), $this->cookie, $post, $this->link, 0, 1); - } else { - is_present($this->page, 'This file exceeds the max. filesize which can be downloaded by free users.'); - if (!preg_match('/(\d+)<\/span> seconds/', $this->page, $w)) html_error('Error[Timer not found!]'); - if (!preg_match('/Recaptcha\.create\("([^"]+)/i', $this->GetPage('http://uploaded.net/js/download.js'), $c)) html_error('Error[Captcha data not found!]'); - // first post - $page = $this->GetPage(str_replace('/file/', '/io/ticket/slot/', $this->link), $this->cookie, array(), $this->link, 0, 1); - if (!stripos($page, 'succ:true')) html_error('Error[Unknown error for FREE Download!]'); - $this->CountDown($w[1]); - - $data = $this->DefaultParamArr($this->link, $this->cookie); - $data['step'] = '1'; - $data['recap'] = $c[1]; // to enable captcha retry - $this->Show_reCaptcha($c[1], $data); - exit; - } - if (stripos($page, 'err')) { - $json = $this->Get_Reply($page); - if ($json['err'] == 'captcha') { - echo "
Entered CAPTCHA was incorrect, please try again!
"; - $data = $this->DefaultParamArr($this->link, $this->cookie); - $data['step'] = '1'; - $data['recap'] = $recap; - $this->Show_reCaptcha($recap, $data); - exit; - } else { - html_error($json['err']); - } - } - if (!preg_match("/url:'(https?:\/\/[^\r\n\']+)'/", $page, $dl)) html_error('Error[Download link - FREE not found!]'); - $dlink = trim($dl[1]); - $this->RedirectDownload($dlink, 'uploaded', $this->cookie, 0, $this->link); - exit; - } - - private function Get_Reply($page) { - if (!function_exists('json_decode')) html_error("Error: Please enable JSON in php."); - $json = substr($page, strpos($page, "\r\n\r\n") + 4); - $json = substr($json, strpos($json, "{")); - $json = substr($json, 0, strrpos($json, "}") + 1); - $rply = json_decode($json, true); - if (!$rply || (is_array($rply) && count($rply) == 0)) html_error("Error getting json data."); - return $rply; - } - - private function Show_reCaptcha($pid, $inputs) { - global $PHP_SELF; - if (!is_array($inputs)) { - html_error("Error parsing captcha data."); - } - // Themes: 'red', 'white', 'blackglass', 'clean' - echo "\n"; - echo "\n

\n"; - foreach ($inputs as $name => $input) { - echo "\n"; - } - echo ""; - echo "
"; - echo "\n"; - echo "\n"; - echo "
\n\n"; - exit; - } - -} - -/* - * Written by Tony Fauzi Wihana/Ruud v.Tony 18-01-2013 - */ -?> +fid = $fid[1]; + $this->link = $Referer = 'http://uploaded.net/file/'.$fid[1]; + + if (empty($_POST['step']) || $_POST['step'] != 1) { + $this->page = $this->GetPage($this->link); + $header = substr($this->page, 0, strpos($this->page, "\r\n\r\n")); + is_present($header, '/404', 'File Not Found'); + $this->cookie = GetCookiesArr($this->page, $this->cookie); + } + + $this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true); + if (($_REQUEST['cookieuse'] == 'on' && preg_match('@login[\s\t]*=[\s\t]*([\w\%\-]+);?@i', $_REQUEST['cookie'], $c)) || ($_REQUEST['premium_acc'] == 'on' && !empty($premium_acc['uploaded_net']['cookie']))) { + $cookie = (empty($c[1]) ? urldecode($premium_acc['uploaded_net']['cookie']) : urldecode($c[1])); + if (strpos($cookie, '%')) $cookie = urldecode($cookie); + $this->cookie = array('login' => urlencode($cookie)); + $this->page = $this->GetPage('http://uploaded.net/me', $this->cookie, 0, 'http://uploaded.net/'); + if (substr($this->page, 9, 3) != '200') html_error('Cookie Error: Invalid Cookie?.'); + $this->cookie = GetCookiesArr($this->page, $this->cookie); + if (stripos($this->page, 'Free') !== false) { + $this->changeMesg(lang(300).'
Cookie: Account isn\'t premium
Using it as member.'); + $this->page = $this->GetPage($this->link, $this->cookie); + return $this->FreeDL(); + } + return $this->PremiumDL(); + } elseif (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($premium_acc['uploaded_net']['user']) && !empty($premium_acc['uploaded_net']['pass']))))) { + return $this->CookieLogin(($this->pA ? $_REQUEST['premium_user'] : $premium_acc['uploaded_net']['user']), ($this->pA ? $_REQUEST['premium_pass'] : $premium_acc['uploaded_net']['pass'])); + } else { + return $this->FreeDL(); + } + } + + private function FreeDL() { + $url = 'http://uploaded.net'; + $errs = array('host' => 'Download of this file isn\'t available right now, try again later.', 'limit-dl' => 'Free download limit reached.', 'parallel' => 'You\'re already downloading a file.', 'size' => 'Only Premium users can download this file.', 'slot' => 'Free download of this file isn\'t available right now, try again later.', 'captcha' => 'Wrong CAPTCHA entered.'); + + if (empty($_POST['step']) || $_POST['step'] != 1) { + // Find countdown + if (!preg_match('@]*>[^<>]+]*>(\d+)[\s\t\r\n]+seconds[^<>]*@i', $this->page, $cD)) html_error('Countdown not found.'); + // Check slots + $page = $this->GetPage("$url/io/ticket/slot/".$this->fid, $this->cookie, 0, 0, 0, 1); + if (stripos($page, 'succ:true') === false) { + if (preg_match('@\"?err\"?\s*:\s*\"((?:[^\"]+(?:\\\")?)+)(?GetPage("$url/js/download.js", $this->cookie); + if (!preg_match('@Recaptcha\.create[\s\t]*\([\s\t]*\"[\s\t]*([\w\-]+)[\s\t]*\"@i', $js, $cpid)) html_error('reCAPTCHA Not Found.'); + // Do countdown + if ($cD[1] > 0) $this->CountDown($cD[1]); + // Prepare data for Show_reCaptcha and call it + $data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie))); + $data['step'] = '1'; + return $this->Show_reCaptcha($cpid[1], $data); + } + + if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.'); + $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie']))); + + $post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']); + $page = $this->GetPage("$url/io/ticket/captcha/".$this->fid, $this->cookie, $post, 0, 0, 1); + if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)+uploaded\.(?:net|to)/dl/[^\r\n\s\t\'\"<>]+@i', $page, $dl)) { + if (preg_match('@\"?err\"?\s*:\s*\"((?:[^\"]+(?:\\\")?)+)(?RedirectDownload($dl[0], 'uploaded_net_fr', $this->cookie); + } + + private function Show_reCaptcha($pid, $inputs, $sname = 'Download File') { + global $PHP_SELF; + if (!is_array($inputs)) html_error('Error parsing captcha data.'); + + // Themes: 'red', 'white', 'blackglass', 'clean' + echo "\n\n

\n"; + foreach ($inputs as $name => $input) echo "\n"; + echo "
\n\n
\n\n"; + exit; + } + + private function PremiumDL() { + // Parse and show BW from $this->page + $cutted = cut_str($this->page, '
'); + if (!empty($cutted) && preg_match_all('@>(\d+(?:,\d+)?\s+(?:[KMGT]i?)?B)<@i', $cutted, $bw)) $this->changeMesg(lang(300)."
[Acc. Traffic] Download: {$bw[1][0]} + Hybrid: {$bw[1][1]} = Total: ".$bw[1][2]); + + $page = $this->GetPage($this->link, $this->cookie); + if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)+uploaded\.(?:net|to)/dl/[^\r\n\s\t\'\"<>]+@i', $page, $dl)) { + $body = trim(substr($page, strpos($page, "\r\n\r\n") + 4)); + if ($body == '') html_error('Download-Link Not Found. (Empty page body)'); + if (stripos($body, 'Traffic is completely exhausted,') !== false || stripos($body, 'Su tráfico híbrido esta completamente gastado') !== false) html_error('Premium account is out of bandwidth.'); + if (stripos($body, 'You used too many different IPs,') !== false || stripos($body, 'descarga bloqueada (ip)') !== false) html_error('Account blocked, too many IPs used for dl.'); + html_error('Account IP-blocked? | Not enough traffic? | Download-Link Not Found'); + } + $this->RedirectDownload($dl[0], 'uploaded_net_pr', $this->cookie); + } + + private function Login($user, $pass) { + $post = array_map('urlencode', array('id' => $user, 'pw' => $pass)); + $page = $this->GetPage('http://uploaded.net/io/login', 0, $post, 'http://uploaded.net/', 0, 1); + $body = trim(substr($page, strpos($page, "\r\n\r\n") + 4)); + is_present($body, 'No connection to database', 'Login failed: "No connection to database".'); + if (preg_match('@\{\"err\":\"([^\"]+)\"@i', $body, $err)) html_error('Login Error: "'.html_entity_decode(stripslashes($err[1])).'".'); + $this->cookie = GetCookiesArr($page, $this->cookie); + if (empty($this->cookie['login'])) { + if ($body == '') html_error('The host didn\'t replied the login request, wait 15-30 seconds and try again.'); + html_error('Login Error: Cannot find "login" cookie.'); + } + + $this->SaveCookies($user, $pass); // Update cookies file + + $this->page = $this->GetPage('http://uploaded.net/me', $this->cookie, 0, 'http://uploaded.net/'); + if (stripos($this->page, 'Free') !== false) { + $this->changeMesg(lang(300).'
Account isn\'t premium
Using it as member.'); + $this->page = $this->GetPage($this->link, $this->cookie); + return $this->FreeDL(); + } + + return $this->PremiumDL(); + } + + private function IWillNameItLater($cookie, $decrypt=true) { + if (!is_array($cookie)) { + if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie)); + return ''; + } + if (count($cookie) < 1) return $cookie; + $keys = array_keys($cookie); + $values = array_values($cookie); + $keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys)); + $values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values)); + return array_combine($keys, $values); + } + + private function CookieLogin($user, $pass) { + global $secretkey; + if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.'); + $user = strtolower($user); + + $filename = DOWNLOAD_DIR . basename('uploaded_dl.php'); + if (!file_exists($filename) || filesize($filename) <= 6) return $this->Login($user, $pass); + + $file = file($filename); + $savedcookies = unserialize($file[1]); + unset($file); + + $hash = hash('crc32b', $user.':'.$pass); + if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) { + $_secretkey = $secretkey; + $secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D + $this->cookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : ''; + $secretkey = $_secretkey; + if (empty($this->cookie) || (is_array($this->cookie) && count($this->cookie) < 1)) return $this->Login($user, $pass); + + $this->page = $this->GetPage('http://uploaded.net/me', $this->cookie, 0, 'http://uploaded.net/'); + if (substr($this->page, 9, 3) != '200') return $this->Login($user, $pass); + $this->cookie = GetCookiesArr($this->page, $this->cookie); // Update cookies + $this->SaveCookies($user, $pass); // Update cookies file + if (stripos($this->page, 'Free') !== false) { + $this->changeMesg(lang(300).'
Account isn\'t premium
Using it as member.'); + $this->page = $this->GetPage($this->link, $this->cookie); + return $this->FreeDL(); + } + return $this->PremiumDL(); + } + return $this->Login($user, $pass); + } + + private function SaveCookies($user, $pass) { + global $secretkey; + $maxdays = 30; // Max days to keep cookies for more than 1 user. + $filename = DOWNLOAD_DIR . basename('uploaded_dl.php'); + if (file_exists($filename) && filesize($filename) > 6) { + $file = file($filename); + $savedcookies = unserialize($file[1]); + unset($file); + + // Remove old cookies + if (is_array($savedcookies)) { + foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]); + } else $savedcookies = array(); + } else $savedcookies = array(); + $hash = hash('crc32b', $user.':'.$pass); + $_secretkey = $secretkey; + $secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D + $savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false)); + $secretkey = $_secretkey; + + file_put_contents($filename, "\r\n" . serialize($savedcookies), LOCK_EX); + } +} + +//[29-5-2013] Written by Th3-822. + +?> \ No newline at end of file diff --git a/hosts/download/uploadhero_com.php b/hosts/download/uploadhero_co.php similarity index 78% rename from hosts/download/uploadhero_com.php rename to hosts/download/uploadhero_co.php index 7529f16..be1fb4c 100644 --- a/hosts/download/uploadhero_com.php +++ b/hosts/download/uploadhero_co.php @@ -5,33 +5,37 @@ exit(); } -class uploadhero_com extends DownloadClass { +class uploadhero_co extends DownloadClass { private $page, $cookie; public function Download($link) { global $premium_acc; $this->cookie = array('lang' => 'en'); + $link = str_ireplace('uploadhero.com/', 'uploadhero.co/', $link); if (empty($_POST['step']) || $_POST['step'] != 1) { $this->page = $this->GetPage($link, $this->cookie); is_present($this->page, 'The link file above no longer exists.', 'File not found.'); + is_present($this->page, 'uploadhero.co/maintenance.html', 'File not available, site or server in maintenance.'); + is_present($this->page, "\nLocation: http://uploadhero.co/forbbiden", 'Dedicated server blocked.'); + is_present($this->page, "\nLocation: /forbbiden", 'Dedicated server blocked.'); $this->cookie = GetCookiesArr($this->page, $this->cookie); } - if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['uploadhero_com']['user']) && !empty($premium_acc['uploadhero_com']['pass'])))) $this->Login($link); + if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['uploadhero_co']['user']) && !empty($premium_acc['uploadhero_co']['pass'])))) $this->Login($link); else $this->FreeDL($link); } private function FreeDL($link) { if (empty($_POST['step']) || $_POST['step'] != 1) { if (preg_match('@/lightbox_block_download\.php\?(min=-?\d+&)?sec=\d+@i', $this->page)) { - $page = $this->GetPage('http://uploadhero.com/lightbox_block_download.php', $this->cookie); + $page = $this->GetPage('http://uploadhero.co/lightbox_block_download.php', $this->cookie); if (!preg_match('@(?:id="minn">(\d+)[\r\n\s\r]*)*]*id="secondss">(\d+)@i', $page, $timer)) html_error('The last download was performed fewer than 30 minutes, you have to wait.'); $wait = $timer[2]; if (!empty($timer[1])) $wait += ($timer[1] * 60); $data = $this->DefaultParamArr($link); return $this->JSCountdown($wait, $data, 'You have to wait before downloading again'); } - if (!preg_match('@\"]+)"@i', $this->page, $cimg)) html_error('Error: CAPTCHA not found.'); - $cimg = (empty($cimg[2])) ? 'http://uploadhero.com'.$cimg[1] : $cimg[1]; + if (!preg_match('@\"]+)"@i', $this->page, $cimg)) html_error('Error: CAPTCHA not found.'); + $cimg = (empty($cimg[2])) ? 'http://uploadhero.co'.$cimg[1] : $cimg[1]; //Download captcha img. $page = $this->GetPage($cimg, $this->cookie); @@ -76,15 +80,15 @@ private function PremiumDL($link) { private function Login($link) { global $premium_acc; $pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false); - $user = ($pA ? $_REQUEST['premium_user'] : $premium_acc['uploadhero_com']['user']); - $pass = ($pA ? $_REQUEST['premium_pass'] : $premium_acc['uploadhero_com']['pass']); + $user = ($pA ? $_REQUEST['premium_user'] : $premium_acc['uploadhero_co']['user']); + $pass = ($pA ? $_REQUEST['premium_pass'] : $premium_acc['uploadhero_co']['pass']); if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.'); $post = array(); $post['pseudo_login'] = urlencode($user); $post['password_login'] = urlencode($pass); - $purl = 'http://uploadhero.com/'; + $purl = 'http://uploadhero.co/'; $page = $this->GetPage($purl.'lib/connexion.php', $this->cookie, $post, $purl); $this->cookie = GetCookiesArr($page, $this->cookie); @@ -105,10 +109,12 @@ private function Login($link) { } public function CheckBack($headers) { - if (preg_match('@\r\nLocation: https?://(www\.)?uploadhero\.com/optmizing@i', $headers)) html_error('[UploadHero] Server in Maintenance.'); + if (preg_match('@\nLocation: https?://(www\.)?uploadhero\.com?/optmizing@i', $headers)) html_error('[UploadHero] Server in Maintenance.'); } } // [08-11-2012] Written by Th3-822. +// [04-4-2013] Updated for .co tld + Small updates. - Th3-822 +// [24-11-2013] Added server blocked msg. - Th3-822 ?> \ No newline at end of file diff --git a/hosts/download/uptobox_com.php b/hosts/download/uptobox_com.php new file mode 100644 index 0000000..5b96f63 --- /dev/null +++ b/hosts/download/uptobox_com.php @@ -0,0 +1,119 @@ +cookie = array('lang' => 'english'); + $this->page = $this->GetPage($link, $this->cookie); + is_present($this->page, 'The file you were looking for could not be found'); + is_present($this->page, 'No such file with this filename', 'Error: Invalid filename, check your link and try again.'); + + if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['uptobox_com']['user']) && !empty($premium_acc['uptobox_com']['pass'])))) $this->Login($link); + else $this->FreeDL($link); + } + + private function FreeDL($link) { + $page2 = cut_str($this->page, 'Form method="POST" action=', ''); //Cutting page + $post = array(); + $post['op'] = cut_str($page2, 'name="op" value="', '"'); + $post['usr_login'] = (empty($this->cookie['xfss'])) ? '' : $this->cookie['xfss']; + $post['id'] = cut_str($page2, 'name="id" value="', '"'); + $post['fname'] = cut_str($page2, 'name="fname" value="', '"'); + $post['referer'] = ''; + $post['method_free'] = cut_str($page2, 'name="method_free" value="', '"'); + + $page = $this->GetPage($link, $this->cookie, $post); + if (preg_match('@You have to wait (?:\d+ \w+,\s)?\d+ \w+ till next download@', $page, $err)) html_error('Error: '.$err[0]); + + $page2 = cut_str($page, '
'); //Cutting page + $post = array(); + $post['op'] = cut_str($page2, 'name="op" value="', '"'); + $post['id'] = cut_str($page2, 'name="id" value="', '"'); + $post['rand'] = cut_str($page2, 'name="rand" value="', '"'); + $post['referer'] = ''; + $post['method_free'] = cut_str($page2, 'name="method_free" value="', '"'); + + if (!preg_match_all("@]*padding-left\s*:\s*(\d+)[^\'>]*'[^>]*>((?:&#\w+;)|(?:\d))@i", $page2, $spans)) html_error('Error: Cannot decode captcha.'); + $spans = array_combine($spans[1], $spans[2]); + ksort($spans, SORT_NUMERIC); + $captcha = ''; + foreach ($spans as $digit) $captcha .= $digit; + $post['code'] = html_entity_decode($captcha); + + $post['down_script'] = 1; + + if (preg_match('@]*>[^<>]+]*>(\d+)[^<>]+@i', $page2, $count) && $count[1] > 0) $this->CountDown($count[1]); + + $page = $this->GetPage($link, $this->cookie, $post); + + is_present($page, '>Skipped countdown', 'Error: Skipped countdown?.'); + is_present($page, '>Wrong captcha<', 'Error: Unknown error after sending decoded captcha.'); // The sended captcha it's correct... But sometimes it's showed. + if (preg_match('@You can download files up to \d+ [KMG]b only.@i', $page, $err)) html_error('Error: '.$err[0]); + + if (!preg_match('@https?://[^/\r\n]+/(?:files|dl?|cgi-bin/dl\.cgi)/[^\'\"\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download link not found.'); + + $this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)))); + } + + private function PremiumDL($link) { + $page = $this->GetPage($link, $this->cookie); + if (!preg_match('@https?://[^/\r\n]+/(?:(?:files)|(?:dl?))/[^\'\"\t<>\r\n]+@i', $page, $dlink)) { + $page2 = cut_str($page, ''); //Cutting page + + $post = array(); + $post['op'] = cut_str($page2, 'name="op" value="', '"'); + $post['id'] = cut_str($page2, 'name="id" value="', '"'); + $post['rand'] = cut_str($page2, 'name="rand" value="', '"'); + $post['referer'] = ''; + $post['method_premium'] = cut_str($page2, 'name="method_premium" value="', '"'); + $post['down_direct'] = 1; + + $page = $this->GetPage($link, $this->cookie, $post); + + if (!preg_match('@https?://[^/\r\n]+/(?:(?:files)|(?:dl?))/[^\'\"\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download-link not found.'); + } + + $this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)))); + } + + private function Login($link) { + global $premium_acc; + $pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false); + $user = ($pA ? $_REQUEST['premium_user'] : $premium_acc['uptobox_com']['user']); + $pass = ($pA ? $_REQUEST['premium_pass'] : $premium_acc['uptobox_com']['pass']); + + if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.'); + $post = array(); + $post['login'] = urlencode($user); + $post['password'] = urlencode($pass); + $post['op'] = 'login'; + $post['redirect'] = ''; + + $purl = 'http://uptobox.com/'; + $page = $this->GetPage($purl, $this->cookie, $post, $purl); + if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.'); + is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.'); + + $this->cookie = GetCookiesArr($page); + if (empty($this->cookie['xfss'])) html_error('Login Error: Cannot find session cookie.'); + $this->cookie['lang'] = 'english'; + + $page = $this->GetPage("$purl?op=my_account", $this->cookie, 0, $purl); + if (stripos($page, '/?op=logout') === false && stripos($page, '/logout') === false) html_error('Login Error.'); + + if (stripos($page, 'Upgrade to premium') !== false) { + $this->changeMesg(lang(300).'
Account isn\\\'t premium
Using it as member.'); + return $this->FreeDL($link); + } else return $this->PremiumDL($link); + } +} + +// [05-7-2013] Written by Th3-822. (XFS, XFS everywhere. D:) + +?> \ No newline at end of file diff --git a/hosts/download/video_google_com.php b/hosts/download/video_google_com.php deleted file mode 100644 index 18d9e8c..0000000 --- a/hosts/download/video_google_com.php +++ /dev/null @@ -1,42 +0,0 @@ -DownloadFree($link); - } - - private function DownloadFree($link) - { - $Referer = $link; - $page = $this->GetPage($link); - - //is_present ( $page, "Due to a violation of our terms of use, the file has been removed from the server." ); - - $downloadLink_1 = trim ( cut_str ( $page, 'If the download does not start automatically, right-click ' ) ); - - $downloadLink_1 = urldecode( $downloadLink_1 ); - - //$page = $this->GetPage($downloadLink_1, 0, 0, 0 ); - //preg_match('/Location: *(.+)/i', $page, $newredir ); - - $FileName = ""; - $Href = trim ( $downloadLink_1 ); - //$Href = trim ( $newredir [1] ); - - $FileName = trim ( cut_str ( $Href, 'title=', '&' ) ); - - $this->RedirectDownload($Href,$FileName,0, 0,$Referer); - exit (); - } -} - -// Created by rajmalhotra on 05 Jan 2010 -?> \ No newline at end of file diff --git a/hosts/download/youtube_com.php b/hosts/download/youtube_com.php index 232b741..c1a5353 100644 --- a/hosts/download/youtube_com.php +++ b/hosts/download/youtube_com.php @@ -19,7 +19,7 @@ public function Download($link) { $this->vid = $this->vid[1]; $link = 'http://www.youtube.com/watch?v='.$this->vid; - $this->page = $this->GetPage('http://www.youtube.com/get_video_info?video_id='.$this->vid.'&asv=3&el=detailpage&hl=en_US', $this->cookie); + $this->page = $this->GetPage('http://www.youtube.com/get_video_info?video_id='.$this->vid.'&asv=3&el=detailpage&hl=en_US&s'.'t'.'s'.'=0', $this->cookie); $response = array_map('urldecode', $this->FormToArr(substr($this->page, strpos($this->page, "\r\n\r\n") + 4))); if (!empty($response['reason'])) html_error('['.htmlentities($response['errorcode']).'] '.htmlentities($response['reason'])); @@ -28,7 +28,7 @@ public function Download($link) { if (empty($response['url_encoded_fmt_stream_map'])) html_error('Video links not found.'); $fmt_url_maps = explode(',', $response['url_encoded_fmt_stream_map']); - $this->fmts = array(38,37,22,45,35,44,34,43,18,5,17); + $this->fmts = array(38,37,46,22,45,44,35,43,34,18,6,5); $yt_fmt = empty($_REQUEST['yt_fmt']) ? '' : $_REQUEST['yt_fmt']; $this->fmturlmaps = $this->GetVideosArr($fmt_url_maps); @@ -48,7 +48,7 @@ public function Download($link) { } $ext = '.flv'; - $fmtexts = array('.3gp' => array(17), '.mp4' => array(18,22,37,38), '.webm' => array(43,44,45)); + $fmtexts = array('.mp4' => array(18,22,37,38), '.webm' => array(43,44,45,46)); foreach ($fmtexts as $k => $v) { if (!is_array($v)) $v = array($v); if (in_array($fmt, $v)) { @@ -58,12 +58,11 @@ public function Download($link) { } if (empty($response['title'])) html_error('No video title found! Download halted.'); - $FileName = str_replace(str_split('\\/:*?"<>|'), '_', html_entity_decode(trim($response['title']), ENT_QUOTES)) . "-[YT-f$fmt][{$this->vid}]$ext"; + $FileName = str_replace(str_split('\\:*?"<>|=;'."\t\r\n\f"), '_', html_entity_decode(trim($response['title']), ENT_QUOTES)); + if (!empty($_REQUEST['cleanname'])) $FileName = preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', $FileName); + $FileName .= " [YT-f$fmt][{$this->vid}]$ext"; - if (isset($_REQUEST['ytdirect']) && $_REQUEST['ytdirect'] == 'on') { - echo "

Click here or copy the link to your download manager to download

(This may not work)"; - echo ""; - } else $this->RedirectDownload($furl, $FileName, $this->cookie, 0, 0, $FileName); + $this->RedirectDownload($furl, $FileName, $this->cookie, 0, 0, $FileName); } private function FormToArr($content, $v1 = '&', $v2 = '=') { @@ -113,36 +112,47 @@ private function captcha($link) { } private function Show_reCaptcha($pid, $inputs, $sname = 'Download File') { - global $PHP_SELF; if (!is_array($inputs)) html_error('Error parsing captcha data.'); // Themes: 'red', 'white', 'blackglass', 'clean' - echo "\n\n

\n"; + echo "\n\n

\n"; foreach ($inputs as $name => $input) echo "\n"; echo "
\n\n
\n\n"; exit; } + private function sigDecode($sig) { + html_error('Encoded signature found D:'); + } + private function GetVideosArr($fmtmaps) { $fmturls = array(); foreach ($fmtmaps as $fmtlist) { $fmtlist = array_map('urldecode', $this->FormToArr($fmtlist)); - $fmturls[$fmtlist['itag']] = $fmtlist['url']; - if (stripos($fmtlist['url'], '&signature=') === false) $fmturls[$fmtlist['itag']] .= '&signature='.$fmtlist['sig']; + if (!in_array($fmtlist['itag'], $this->fmts)) continue; + $fmtlist['url'] = parse_url($fmtlist['url']); + $fmtlist['url']['query'] = array_map('urldecode', $this->FormToArr($fmtlist['url']['query'])); + if (empty($fmtlist['url']['query']['signature'])) $fmtlist['url']['query']['signature'] = (!empty($fmtlist['s']) ? $this->sigDecode($fmtlist['s']) : $fmtlist['sig']); + foreach (array_diff(array_keys($fmtlist), array('signature', 'sig', 's', 'url')) as $k) $fmtlist['url']['query'][$k] = $fmtlist[$k]; + ksort($fmtlist['url']['query']); + $fmtlist['url']['query'] = http_build_query($fmtlist['url']['query']); + $fmturls[$fmtlist['itag']] = rebuild_url($fmtlist['url']); } return $fmturls; } private function QSelector($link) { - global $PHP_SELF; - $fmtlangs = array(38 => 377, 37 => 228, 22 => 227, 45 => 225, 35 => 223, 44 => 389, 34 => 222, 43 => 224, 18 => 226, 5 => 221, 17 => 220); + $VR = array('>1080', 1080, 720, 480, 360, 270, 240); + $VC = array('MP4', 'WebM', 'FLV'); + $AC = array('AAC', 'Vorbis', 'MP3'); + $AB = array(192, 128, 96, 64); + $vinfo = array(38=>'0000',37=>'1000',46=>'1110',22=>'2000',45=>'2110',44=>'3111',35=>'3201',43=>'4111',34=>'4201',18=>'4002',6=>'5223',5=>'6223'); // VR VC AC AB $sizes = array(); /* Add a // at the start of this line for enable this code. if (extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec')) { $sizes = array(); $opt = array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLOPT_NOBODY => true); // Redirects may fail with open_basedir enabled - if (!empty($this->cookie)) $opt[CURLOPT_COOKIE] = CookiesToStr($this->cookie); foreach ($this->fmturlmaps as $fmt => $url) { if (!in_array($fmt, $this->fmts)) continue; $headers = explode("\r\n\r\n", cURL($url, $this->cookie, 0, 0, 0, $opt)); @@ -153,18 +163,18 @@ private function QSelector($link) { } //*/ echo "\n

".lang(216).".

"; - echo "\n
\n"; + echo "\n
\n"; echo "\n"; - echo ' '.lang(217).'
'; + echo '
'; echo "\n"; if (count($this->cookie) > 0) $this->cookie = encrypt(CookiesToStr($this->cookie)); $data = $this->DefaultParamArr($link, $this->cookie); $data['ytube_mp4'] = 'on'; foreach ($data as $n => $v) echo("\n"); - echo "\n"; + echo "\n"; echo "
\n\n"; exit; } @@ -184,5 +194,6 @@ private function QSelector($link) { // [14-9-2012] Fixed Download links & small changes. - Th3-822 // [07-10-2012] Fixed for redirect at link. - Th3-822 // [02-1-2013] Using new way for getting links and video info, now it doesn't need login for restricted videos. - Th3-822 +// [02-10-2013] Fixed issues with videos with ciphered signature & Rewritten quality selector (Now it doesn't use lang) & Remove direct-link option & Added option for sanitize filenames & small changes. - Th3-822 ?> \ No newline at end of file diff --git a/hosts/upload/.htaccess b/hosts/upload/.htaccess index e30ae10..c468487 100644 --- a/hosts/upload/.htaccess +++ b/hosts/upload/.htaccess @@ -1,9 +1,2 @@ order deny,allow - - deny from all - - - -deny from all - \ No newline at end of file diff --git a/hosts/upload/10upload.com.index.php b/hosts/upload/10upload.com.index.php deleted file mode 100644 index befeb46..0000000 --- a/hosts/upload/10upload.com.index.php +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/hosts/upload/10upload.com.php b/hosts/upload/10upload.com.php deleted file mode 100644 index 065bfc6..0000000 --- a/hosts/upload/10upload.com.php +++ /dev/null @@ -1,60 +0,0 @@ - - -
-
- -
Retrive upload ID
- - - -([^><]+)<#", $upfiles, $dl); - if($dl[1][1] != 'OK') - html_error('Erro in upload'); - $post['fn'] = $dl[1][0]; - $post['st'] = 'OK'; - $post['op'] = 'upload_result'; - $page = geturl("www.10upload.com", 80, "/", 0, 0, $post, 0, $_GET["proxy"]); - if(!empty($dl[1][0])) - $download_link = 'http://10upload.com/'.$dl[1][0].'/'.$lname.'.html'; - else - html_error ("Didn't find download link!"); - if(preg_match("#killcode=([^=<]+)<#", $page, $del)) - $delete_link = $download_link.'?killcode='.$del[1]; - else - html_error ("Didn't find delete link!"); -function uid(){ - $nu = "0123456789"; - for($i=0; $i < 12; $i++){ - $rand .= $nu{mt_rand() % strlen($nu)}; - } - return $rand; - //function by simplesdescraga 05/02/2012 - } -/** -written by simplesdescarga 05/02/2012 -**/ -?> diff --git a/hosts/upload/10upload.com_member.index.php b/hosts/upload/10upload.com_member.index.php deleted file mode 100644 index 8718091..0000000 --- a/hosts/upload/10upload.com_member.index.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/hosts/upload/10upload.com_member.php b/hosts/upload/10upload.com_member.php deleted file mode 100644 index 4455354..0000000 --- a/hosts/upload/10upload.com_member.php +++ /dev/null @@ -1,114 +0,0 @@ -
Automatic Login 10Upload.com
\n"; - } - if ($_REQUEST['action'] == "FORM"){ - $continue_up = true; - }else { -?> - -
LOGIN
- - - - - - - - -
 User*  
 Password*  
*You can set it as default in
- - - -
- -
Login to 10Upload.com
- - -
Retrive upload ID
- - - -([^><]+)<#", $upfiles, $dl); - if($dl[1][1] != 'OK') - html_error('Erro in upload'); - $post['fn'] = $dl[1][0]; - $post['st'] = 'OK'; - $post['op'] = 'upload_result'; - $page = geturl("www.10upload.com", 80, "/", 0, $cookie, $post, 0, $_GET["proxy"]); - if(!empty($dl[1][0])) - $download_link = 'http://10upload.com/'.$dl[1][0].'/'.$lname.'.html'; - else - html_error ("Didn't find download link!"); - if(preg_match("#killcode=([^=<]+)<#", $page, $del)) - $delete_link = $download_link.'?killcode='.$del[1]; - else - html_error ("Didn't find delete link!"); - } -function uid(){ - $nu = "0123456789"; - for($i=0; $i < 12; $i++){ - $rand .= $nu{mt_rand() % strlen($nu)}; - } - return $rand; - //function by simplesdescraga 05/02/2012 - } -/** -written by simplesdescarga 05/02/2012 -**/ -?> \ No newline at end of file diff --git a/hosts/upload/115.com.php b/hosts/upload/115.com.php index 776a8dd..caf5cb8 100644 --- a/hosts/upload/115.com.php +++ b/hosts/upload/115.com.php @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/hosts/upload/180upload.com.php b/hosts/upload/180upload.com.php new file mode 100644 index 0000000..dd50999 --- /dev/null +++ b/hosts/upload/180upload.com.php @@ -0,0 +1,28 @@ + 2); // Version of this config file. (Do Not Edit) + +/* # Plugin's Settings # */ +$_T8['domain'] = '180upload.com'; // May require the www. (Check first if the site adds the www.) +$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro) +$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro) + +// Advanced Settings (Don't edit it unless you know what are you doing) + $_T8['xfsFree'] = false; // Change to true if the host is using XFS free. + $_T8['path'] = '/'; // URL path to XFS script, default: '/' + $_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload' + $_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro) + +$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit) + +/* # Account Info # */ +$upload_acc[$acc_key_name]['user'] = ''; //Set your login +$upload_acc[$acc_key_name]['pass'] = ''; //Set your password + +if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://www.rapidleech.com/index.php/topic/14014-upload-plugin-for-sites-with-xfs-pro/ or http://pastebin.com/E0z7qMU1 '); +require(HOST_DIR . 'upload/GenericXFSHost.inc.php'); + +// Written by Th3-822 - Last Update: [21-9-2013] + +?> \ No newline at end of file diff --git a/hosts/upload/4shared.com.index.php b/hosts/upload/4shared.com.index.php deleted file mode 100644 index 37756b9..0000000 --- a/hosts/upload/4shared.com.index.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/hosts/upload/4shared.com.php b/hosts/upload/4shared.com.php deleted file mode 100644 index 06f6f0b..0000000 --- a/hosts/upload/4shared.com.php +++ /dev/null @@ -1,90 +0,0 @@ -
Use Default login/pass.
\n"; -} -if ($_REQUEST['action'] == "FORM") - $continue_up=true; -else{ -?> - - - - - - - -
 Email*  
 Password*  
*You can set it as default in
- - - - - -
-
Login to 4shared
- - -
Retrive upload ID
- - - - - \ No newline at end of file diff --git a/hosts/upload/4shared.com_member.index.php b/hosts/upload/4shared.com_member.index.php new file mode 100644 index 0000000..55ca006 --- /dev/null +++ b/hosts/upload/4shared.com_member.index.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hosts/upload/4shared.com_member.php b/hosts/upload/4shared.com_member.php new file mode 100644 index 0000000..09d039a --- /dev/null +++ b/hosts/upload/4shared.com_member.php @@ -0,0 +1,99 @@ +
Using Default Login.
\n"; +} + +if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') { + echo " + + + + \n"; + echo "\n"; + echo "\n"; + echo "\n
 Email* 
 Password* 

*You can set it as default in ".basename(__FILE__)."
\n"; +} else { + $not_done = false; + + // Login + echo "\n
\n
Login to 4shared.com
\n"; + + if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) { + $user = $_REQUEST['up_login']; + $pass = $_REQUEST['up_pass']; + $soap_options = array('connection_timeout' => 120, 'cache_wsdl' => WSDL_CACHE_DISK, 'exceptions' => false); + if (!empty($_GET['proxy'])) { + list($soap_options['proxy_host'], $soap_options['proxy_port']) = explode(':', $_GET['proxy'], 2); + if (!empty($pauth)) list($soap_options['proxy_login'], $soap_options['proxy_password']) = array_map('rawurldecode', explode(':', base64_decode($pauth), 2)); + } + $client = new SoapClient('http://api.4shared.com/jax3/DesktopApp?wsdl', $soap_options); + if (!is_object($client)) html_error('Cannot get 4shared\'s wsdl.'); + + if (($Chk = $client->hasRightUpload()) !== true) { + if (is_soap_fault($Chk)) html_error('[' . $Chk->faultcode . '] ' . htmlentities($Chk->faultstring)); + else html_error('Uploading is temporarily disabled.'); + } + + $LoginChk = $client->isExistsLoginPassword($user, $pass); + if (is_soap_fault($LoginChk)) html_error('[' . $LoginChk->faultcode . '] ' . htmlentities($LoginChk->faultstring)); + elseif ($LoginChk !== true) html_error('Login failed: Email/Password incorrect.'); + + if ($client->isAccountBanned($user, $pass) === true) html_error('Login failed: Account is banned.'); + + if ($fsize > $client->getMaxFileSize($user, $pass)) html_error('Error: Your file is too big.'); + elseif ($fsize > $client->getFreeSpace($user, $pass)) html_error('Error: Not enough space in your account.'); + } else html_error('Login failed: User/Password empty.'); + + // Retrive upload ID + echo "\n
Retrive upload ID
\n"; + + $session = $client->createUploadSessionKey($user, $pass, -1); + if (!$session) html_error('Error: Cannot get upload session.'); + + $dc = $client->getNewFileDataCenter($user, $pass, -1); + if ($dc <= 0) html_error('Error: Cannot get upload server.'); + + $up_url = $client->getUploadFormUrl($dc, $session); + if (!$up_url) html_error('Error: Cannot get upload url.'); + + $fid = $client->uploadStartFile($user, $pass, -1, $lname, $fsize); + if (!$fid) html_error('Error: Cannot get upload id.'); + + $post = array(); + $post['resumableFileId'] = $fid; + $post['resumableFirstByte'] = 0; + + // Uploading + echo "\n"; + + $url = parse_url($up_url); + $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'FilePart', '', $_GET['proxy'], $pauth); + + // Upload Finished + echo "\n"; + + is_page($upfiles); + + $finish = $client->uploadFinishFile($user, $pass, $fid, md5_file($lfile)); + if (is_soap_fault($finish)) html_error('[' . $finish->faultcode . '] ' . htmlentities($finish->faultstring)); + elseif ($finish != '') html_error('Upload error: ' . htmlentities($finish)); + + $fileinfo = $client->getFileInfo($user, $pass, $fid); + $download_link = $fileinfo->downloadLink; +} + +//[09-4-2013] Written by Th3-822 + +?> \ No newline at end of file diff --git a/hosts/upload/GenericXFSHost.inc.php b/hosts/upload/GenericXFSHost.inc.php new file mode 100644 index 0000000..383bd17 --- /dev/null +++ b/hosts/upload/GenericXFSHost.inc.php @@ -0,0 +1,192 @@ + 2) html_error('Error: '.basename(__FILE__).' is outdated, please install last version from: http://www.rapidleech.com/index.php/topic/14014-upload-plugin-for-sites-with-xfs-pro/ or http://pastebin.com/E0z7qMU1 '); + +/* # Default Settings # */ +$default = array(); +$default['path'] = '/'; // URL path to XFS script, default: '/' +$default['xfsFree'] = false; // Change to true if the host is using XFS free. +$default['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload' +$default['anonUploadDisable'] = false; // Disallow non registered users upload. (XFS Pro) +$default['anonUploadLimit'] = 0; // File-size limit for non registered users (MB) - 0 = Plugin's limit | (XFS Pro) +$default['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro) + +$_T8 = array_merge($default, array_filter($_T8)); // Merge default settings with loader's settings + +$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : ''; +$not_done = true; + +if (!$_T8['xfsFree'] && !empty($upload_acc[$acc_key_name]['user']) && !empty($upload_acc[$acc_key_name]['pass'])) { + $_REQUEST['up_login'] = $upload_acc[$acc_key_name]['user']; + $_REQUEST['up_pass'] = $upload_acc[$acc_key_name]['pass']; + $_REQUEST['action'] = 'FORM'; + echo "
Using Default Login.
\n"; +} + +if (!$_T8['xfsFree'] && (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM')) { + echo "\n\n\t\n\t\n\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n
 Username* 
 Password* 

*You can set it as default in ".$page_upload[$_REQUEST['uploaded']]."
\n"; +} else { + $not_done = false; + if (substr($_T8['path'], 0, 1) != '/') $_T8['path'] = '/'.$_T8['path']; + if (substr($_T8['path'], -1) != '/') $_T8['path'] .= '/'; + $referer = 'http://'.$_T8['domain'].$_T8['path']; + + // Login + echo "\n
\n
Login to ".str_ireplace('www.', '', $_T8['domain'])."
\n"; + + $cookie = (!empty($cookie)) ? (is_array($cookie) ? $cookie : StrToCookies($cookie)) : array(); + $cookie['lang'] = 'english'; + if ($_T8['xfsFree']) $login = false; + elseif (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) { + $post = array(); + $post['op'] = 'login'; + $post['redirect'] = ''; + $post['login'] = $_REQUEST['up_login']; + $post['password'] = $_REQUEST['up_pass']; + + $page = geturl($_T8['domain'], 80, $_T8['path'].'?op=login', $referer, $cookie, array_map('urlencode', $post), 0, $_GET['proxy'], $pauth);is_page($page); + $header = substr($page, 0, strpos($page, "\r\n\r\n")); + if (stripos($header, "\nLocation: ") !== false && preg_match('@\nLocation: (https?://[^\r\n]+)@i', $header, $redir) && 'www.' . strtolower($_T8['domain']) == strtolower(parse_url($redir[1], PHP_URL_HOST))) html_error("Please set \$_T8['domain'] to 'www.{$_T8['domain']}'."); + if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.'); + is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.'); + $cookie = GetCookiesArr($header, $cookie); + if (empty($cookie['xfss']) && empty($cookie['login'])) html_error('Error: Login cookies not found.'); + $cookie['lang'] = 'english'; + $login = true; + } else { + if ($_T8['anonUploadDisable']) html_error('Login failed: User/Password empty.'); + echo "
Login not found or empty, using non member upload.
\n"; + if ($_T8['anonUploadLimit'] > 0 && $fsize > $_T8['anonUploadLimit']*1024*1024) html_error('File is too big for anon upload'); + $login = false; + } + + // Retrive upload ID + echo "\n
Retrive upload ID
\n"; + + $page = geturl($_T8['domain'], 80, $_T8['path'].'?op='.(empty($_T8['opUploadName']) ? 'upload' : urlencode($_T8['opUploadName'])), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); + if (substr($page, 9, 3) != '200') { + $page = geturl($_T8['domain'], 80, $_T8['path'], $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); + } + $header = substr($page, 0, strpos($page, "\r\n\r\n")); + if (!$login && stripos($header, "\nLocation: ") !== false && preg_match('@\nLocation: (https?://[^\r\n]+)@i', $header, $redir) && 'www.' . strtolower($_T8['domain']) == strtolower(parse_url($redir[1], PHP_URL_HOST))) html_error("Please set \$_T8['domain'] to 'www.{$_T8['domain']}'."); + + if (preg_match('@var[\s\t]+max_upload_filesize[\s\t]*=[\s\t]*[\'\"]?(\d+)[\'\"]?[\s\t]*;@i', $page, $fzlimit) && $fzlimit[1] > 0 && $fsize > $fzlimit[1]*1024*1024) html_error('Error: '.lang(66)); // Max upload filesize test + + if (!preg_match('@action=["\']((https?://[^/"\']+)?/(?:[^\?"\'/]+/)*[\w\-]+\.cgi)\?upload_id=@i', $page, $up) && (empty($_T8['flashUpload']) || !preg_match('@[\'"]?uploader[\'"]?\s*:\s*[\'"]((https?://[^/"\']+)?/(?:[^\?"\'/]+/)*'.preg_quote((is_string($_T8['flashUpload']) ? $_T8['flashUpload'] :'up_flash.cgi'), '@').')[\'"]@i', $page, $up))) { + is_present($page, 'We\'re sorry, there are no servers available for upload at the moment.', 'Site isn\'t accepting uploads.'); + if (!$login) { + if (stripos($header, "\nLocation: ") !== false) is_present(cut_str($header, "\nLocation: ", "\n"), '?op=login', 'Please set '.($_T8['xfsFree'] ? '$_T8[\'xfsFree\'] to false and ' : '').'$_T8[\'anonUploadDisable\'] to true.'); + is_present($page, '>Register on site to be able to upload files<', 'Please set '.($_T8['xfsFree'] ? '$_T8[\'xfsFree\'] to false and ' : '').'$_T8[\'anonUploadDisable\'] to true.'); + } + html_error('Error: Cannot find upload server.', 0); + } + $up_url = (empty($up[2])) ? 'http://'.$_T8['domain'].$up[1] : $up[1]; + + // File-ext checks + if (preg_match('@var[\s\t]+ext_allowed[\s\t]*=[\s\t]*[\'\"]\|?(\w+(?:\|\w+)*)\|?[\'\"][\s\t]*;@i', $page, $allowedExts) || preg_match('@var[\s\t]+ext_not_allowed[\s\t]*=[\s\t]*[\'\"]\|?(\w+(?:\|\w+)*)\|?[\'\"][\s\t]*;@i', $page, $notAllowedExts)) { + $fExt = (strpos($lname, '.') !== false) ? strtolower(substr(strrchr($lname, '.'), 1)) : ''; + if (!empty($allowedExts[1])) { + $allowedExts = array_map('strtolower', array_filter(explode('|', $allowedExts[1]))); + if (!in_array($fExt, $allowedExts)) html_error('Server doesn\'t allow upload of files with this ext: "'.htmlentities($fExt).'".'); + } + if (!empty($notAllowedExts[1])) { + $notAllowedExts = array_map('strtolower', array_filter(explode('|', $notAllowedExts[1]))); + if (in_array($fExt, $notAllowedExts)) html_error('Server doesn\'t allow upload of files with this ext: "'.htmlentities($fExt).'".'); + } + } + + $uid = '';for ($i = 0; $i < 12; $i++) $uid .= mt_rand(0,9); + + $post = array(); + if (empty($_T8['flashUpload'])) { + $post['upload_type'] = 'file'; + $post['sess_id'] = cut_str($page, 'name="sess_id" value="', '"'); + $post['srv_tmp_url'] = cut_str($page, 'name="srv_tmp_url" value="', '"'); + if (stripos($page, 'name="srv_id" value="') !== false && ($tmp = cut_str($page, 'name="srv_id" value="', '"'))) $post['srv_id'] = $tmp; + if (stripos($page, 'name="disk_id" value="') !== false && ($tmp = cut_str($page, 'name="disk_id" value="', '"'))) $post['disk_id'] = $tmp; + $post['link_rcpt'] = ''; + $post['link_pass'] = ''; + $post['file_descr'] = 'Uploaded with Rapidleech.'; + $post['file_public'] = '1'; + $post['tos'] = '1'; + $post['submit_btn'] = ' Upload! '; + + $up_url .= "?upload_id=$uid&js_on=1"; + if (!$_T8['xfsFree']) $up_url .= '&utype='.cut_str($page, "var utype='", "'").'&upload_type=file'.(!empty($post['disk_id']) ? '&disk_id=' . urlencode($post['disk_id']) : ''); + } else { + $post['Filename'] = $lname; + if ($login) if (!($post['sess_id'] = cut_str($page, 'name="sess_id" value="', '"'))) { + if (!empty($cookie['xfss'])) $post['sess_id'] = $cookie['xfss']; + elseif (preg_match('@["\']sess_id["\']\s*:\s*["\'](\w+)["\']@i', $page, $sid)) $post['sess_id'] = $sid[1]; + else html_error('Flash upload session key not found.'); + } + $post['Upload'] = 'Submit Query'; + } + + // Uploading + echo "\n"; + + $url = parse_url($up_url); + if (!empty($_T8['flashUpload'])) $url['path'] = substr($url['path'], 0, strrpos($url['path'], '/') + 1).(is_string($_T8['flashUpload']) ? $_T8['flashUpload'] : 'up_flash.cgi'); + $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, $cookie, $post, $lfile, $lname, + (empty($_T8['flashUpload']) ? 'file' : 'Filedata'), '', $_GET['proxy'], $pauth); + + // Upload Finished + echo "\n"; + + is_page($upfiles); + + if (!$login && stripos($page, 'Uploads not enabled for this type of users') !== false) html_error('Please set '.($_T8['xfsFree'] ? '$_T8[\'xfsFree\'] to false and ' : '').'$_T8[\'anonUploadDisable\'] to true.'); + + $statuscode = intval(substr($upfiles, 9, 3)); + if ($statuscode >= 400 || preg_match('@([^<>]+)@i', $upfiles, $err)) html_error('Upload server isn\'t working or has failed'.(!empty($err[1]) ? ', response: ' . htmlentities($err[1]) : '.')); + + if (!empty($_T8['flashUpload'])) { + $body = trim(substr($upfiles, strpos($upfiles, "\r\n\r\n") + 4)); + if (strpos($body, ':') === false || !($reply = explode(':', $body, 6)) || strlen($reply[0]) != 12) html_error('Bad response from flash uploader, response: ' . htmlentities($body)); + $download_link = $referer.$reply[0]; + return; + } + + $page = cut_str($upfiles, '
'); + if (empty($page)) html_error('Error: upload_result form not found.'); + if (!preg_match_all('@@i', $page, $textareas)) html_error('Error: upload_result data not found.'); + $post = array_map('urlencode', array_map('html_entity_decode', array_combine(array_map('trim', $textareas[1]), array_map('trim', $textareas[2])))); + if (empty($post['op']) || strtolower(urldecode($post['op'])) != 'upload_result') html_error('Error: "upload_result" value not found.'); + if (empty($post['fn'])) html_error('Error: "fn" input not found.'); + if (strtolower($post['st']) != 'ok') html_error('Upload failed, response: '.htmlentities(urldecode($post['st']))); + + $page = geturl($_T8['domain'], 80, $_T8['path'], $up_url, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); + $host_rexexp = 'https?://(?:www\.)?'.preg_quote(str_ireplace('www.', '', $_T8['domain']).$_T8['path'], '@'); + + if (preg_match('@('.$host_rexexp.'\w{12}(?:/[^\?/<>\"\'\r\n]+)?(?:\.html?)?)\?killcode=\w+@i', $page, $lnk)) { + $download_link = $lnk[1]; + $delete_link = $lnk[0]; + } elseif (preg_match('@'.$host_rexexp.'del-(\w{12})-\w+/([^<>\"\'\r\n]+)@i', $page, $lnk)) { + $download_link = substr($lnk[0], 0, (stripos($lnk[0], '/del-') + 1)) . $lnk[2] . '/' . $lnk[3]; + $delete_link = $lnk[0]; + } elseif (preg_match('@'.$host_rexexp.'\w{12}(?:/[^\?/<>\"\'\r\n]+)?(?:\.html?)?(?=[\r\n\t\s\'\"<>])@i', $page, $lnk)) $download_link = $lnk[0]; + else html_error('Download link not found.', 0); +} + +//[17-8-2012] Written by Th3-822 +//[30-9-2012] Using ?op=upload for some sites that need it. - Th3-822 +//[17-10-2012] Added "domain requires the www." check. - Th3-822 +//[08-11-2012] Added XFS Free support. - Th3-822 +//[16-3-2013] Some updates, it should support more sites now & Added more error msgs. - Th3-822 +//[05-8-2013] Plugin rewritten for making it a include (for saving space) & Added file-ext check & Small edits. - Th3-822 +//[21-9-2013] Fixed upload url regexp (Now it will work on hosts that change upload.cgi filename/path) & Edits for allow extra cookies & Added support for XFS's flash upload. - Th3-822 + +?> \ No newline at end of file diff --git a/hosts/upload/billionuploads.com.index.php b/hosts/upload/billionuploads.com.index.php new file mode 100644 index 0000000..2d7d966 --- /dev/null +++ b/hosts/upload/billionuploads.com.index.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hosts/upload/billionuploads.com.php b/hosts/upload/billionuploads.com.php new file mode 100644 index 0000000..bd2877a --- /dev/null +++ b/hosts/upload/billionuploads.com.php @@ -0,0 +1,30 @@ + 2); // Version of this config file. (Do Not Edit) + +/* # Plugin's Settings # */ +$_T8['domain'] = 'upload.billionuploads.com'; // May require the www. (Check first if the site adds the www.) +$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro) +$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro) + +// Advanced Settings (Don't edit it unless you know what are you doing) + $_T8['xfsFree'] = false; // Change to true if the host is using XFS free. + $_T8['path'] = '/'; // URL path to XFS script, default: '/' + $_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload' + $_T8['flashUpload'] = true; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro) + +$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit) + +/* # Account Info # */ +$upload_acc[$acc_key_name]['user'] = ''; //Set your login +$upload_acc[$acc_key_name]['pass'] = ''; //Set your password + +if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://www.rapidleech.com/index.php/topic/14014-upload-plugin-for-sites-with-xfs-pro/ or http://pastebin.com/E0z7qMU1 '); +require(HOST_DIR . 'upload/GenericXFSHost.inc.php'); +if (!empty($download_link)) $download_link = str_ireplace('://upload.', '://', $download_link); + +// Written by Th3-822 - Last Update: [21-9-2013] +// [11-11-2013] Edited for billionuploads's "API". - Th3-822 + +?> \ No newline at end of file diff --git a/hosts/upload/bulletupload.com.index.php b/hosts/upload/bulletupload.com.index.php deleted file mode 100644 index 3ee1328..0000000 --- a/hosts/upload/bulletupload.com.index.php +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/hosts/upload/bulletupload.com.php b/hosts/upload/bulletupload.com.php deleted file mode 100644 index a8e0142..0000000 --- a/hosts/upload/bulletupload.com.php +++ /dev/null @@ -1,80 +0,0 @@ - - -
-
- -
Retrive upload ID
- - - -([^><]+)<#", $upfiles, $dl); - if($dl[1][1] != 'OK') - html_error('Erro in upload'); - $post['fn'] = $dl[1][0]; - $post['st'] = 'OK'; - $post['op'] = 'upload_result'; - $page = geturl("bulletupload.com", 80, "/", 0, 0, $post, 0, $_GET["proxy"]); - if(!empty($dl[1][0])) - $download_link = 'http://bulletupload.com/'.$dl[1][0].'/'.$lname.'.html'; - else - html_error ("Didn't find download link!"); - if(preg_match("#killcode=([^=<]+)<#", $page, $del)) - $delete_link = $download_link.'?killcode='.$del[1]; - else - html_error ("Didn't find delete link!"); - function uid(){ - $nu = "0123456789"; - for($i=0; $i < 12; $i++){ - $rand .= $nu{mt_rand() % strlen($nu)}; - } - return $rand; - //function by simplesdescraga 05/02/2012 - } - function extensao($file){ - $tam = strlen($file); - if( $file[($tam)-4] == '.' ){ - $extensao = substr($file,-3);} - elseif( $file[($tam)-5] == '.' ){ - $extensao = substr($file,-4);} - elseif( $file[($tam)-6] == '.' ){ - $extensao = substr($file,-5);} - elseif( $file[($tam)-3] == '.' ){ - $extensao = substr($file,-2); - }else{ - $extensao = NULL;} - return $extensao; - //function by simplesdescarga 13/01/2012 - //function fixed extensão by simplesdescarga 06/02/2012 - } -/** -written by simplesdescarga 05/02/2012 -**/ -?> diff --git a/hosts/upload/bulletupload.com_member.index.php b/hosts/upload/bulletupload.com_member.index.php deleted file mode 100644 index 776d3b3..0000000 --- a/hosts/upload/bulletupload.com_member.index.php +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/hosts/upload/bulletupload.com_member.php b/hosts/upload/bulletupload.com_member.php deleted file mode 100644 index 6cde616..0000000 --- a/hosts/upload/bulletupload.com_member.php +++ /dev/null @@ -1,137 +0,0 @@ -
Automatic Login bulletupload.com
\n"; - } - if ($_REQUEST['action'] == "FORM"){ - $continue_up = true; - }else { -?> - -
LOGIN
- - - - - - - - -
 User*  
 Password*  
*You can set it as default in
- - - -
- -
Login to 10Upload.com
- php|pl|cgi|py|sh|shtml - - -
Retrive upload ID
- - - -([^><]+)<#", $upfiles, $dl); - if($dl[1][1] != 'OK') - html_error('Erro in upload'); - $post['fn'] = $dl[1][0]; - $post['st'] = 'OK'; - $post['op'] = 'upload_result'; - $page = geturl("bulletupload.com", 80, "/", 0, $cookie, $post, 0, $_GET["proxy"]); - if(!empty($dl[1][0])) - $download_link = 'http://bulletupload.com/'.$dl[1][0].'/'.$lname.'.html'; - else - html_error ("Didn't find download link!"); - if(preg_match("#killcode=([^=<]+)<#", $page, $del)) - $delete_link = $download_link.'?killcode='.$del[1]; - else - html_error ("Didn't find delete link!"); - } - } - function uid(){ - $nu = "0123456789"; - for($i=0; $i < 12; $i++){ - $rand .= $nu{mt_rand() % strlen($nu)}; - } - return $rand; - //function by simplesdescraga 05/02/2012 - } - function extensao($file){ - $tam = strlen($file); - if( $file[($tam)-4] == '.' ){ - $extensao = substr($file,-3);} - elseif( $file[($tam)-5] == '.' ){ - $extensao = substr($file,-4);} - elseif( $file[($tam)-6] == '.' ){ - $extensao = substr($file,-5);} - elseif( $file[($tam)-3] == '.' ){ - $extensao = substr($file,-2); - }else{ - $extensao = NULL;} - return $extensao; - //function by simplesdescarga 13/01/2012 - //function fixed extensão by simplesdescarga 06/02/2012 - } -/** -written by simplesdescarga 05/02/2012 -**/ -?> \ No newline at end of file diff --git a/hosts/upload/crocko.com_member.index.php b/hosts/upload/crocko.com_member.index.php index c98fb80..33ed097 100644 --- a/hosts/upload/crocko.com_member.index.php +++ b/hosts/upload/crocko.com_member.index.php @@ -1,4 +1,4 @@ - +
diff --git a/hosts/upload/fileape.com_member.index.php b/hosts/upload/fileape.com_member.index.php index 38b357e..827282e 100644 --- a/hosts/upload/fileape.com_member.index.php +++ b/hosts/upload/fileape.com_member.index.php @@ -1,4 +1,4 @@ -
Using Default Login.
\n"; -} - -if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') { - echo " - - - - \n"; - echo "\n"; - echo "\n"; - echo "
 Username* 
 Password* 

*You can set it as default in ".basename(__FILE__)."
\n\n"; -} else $continue_up = true; - -if ($continue_up) { - $not_done = false; - $referer = "http://$domain/"; - - // Login - echo "\n
\n
Login to ".str_replace('www.', '', $domain)."
\n"; - - $cookie = array('lang' => 'english'); - if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) { - $post = array(); - $post['op'] = 'login'; - $post['redirect'] = ''; - $post['login'] = $_REQUEST['up_login']; - $post['password'] = $_REQUEST['up_pass']; - - $page = geturl($domain, 80, '/?op=login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); - $header = substr($page, 0, strpos($page, "\r\n\r\n")); - if (stripos($header, "\r\nLocation: ") !== false && preg_match('@\r\nLocation: (https?://[^\r\n]+)@i', $header, $redir) && 'www.' . strtolower($domain) == strtolower(parse_url($redir[1], PHP_URL_HOST))) html_error("Please set \$domain to 'www.$domain'."); - if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.'); - is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.'); - is_notpresent($header, 'Set-Cookie: xfss=', 'Error: Cannot find session cookie.'); - $cookie = GetCookiesArr($header); - $cookie['lang'] = 'english'; - $login = true; - } else { - if (!$anonupload) html_error('Login failed: User/Password empty.'); - echo "
Login not found or empty, using non member upload.
\n"; - if ($anonlimit > 0 && getSize($lfile) > $anonlimit*1024*1024) html_error('File is too big for anon upload'); - $login = false; - } +if (!defined('RAPIDLEECH')) exit; +$_T8 = array('v' => 2); // Version of this config file. (Do Not Edit) - // Retrive upload ID - echo "\n
Retrive upload ID
\n"; +/* # Plugin's Settings # */ +$_T8['domain'] = 'filedefend.com'; // May require the www. (Check first if the site adds the www.) +$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro) +$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro) - $page = geturl($domain, 80, '/?op=upload', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); - if (substr($page, 9, 3) != '200') { - $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); - } - if (!$login) { - $header = substr($page, 0, strpos($page, "\r\n\r\n")); - if (stripos($header, "\r\nLocation: ") !== false && preg_match('@\r\nLocation: (https?://[^\r\n]+)@i', $header, $redir) && 'www.' . strtolower($domain) == strtolower(parse_url($redir[1], PHP_URL_HOST))) html_error("Please set \$domain to 'www.$domain'."); - } - if (!preg_match('@action="((https?://[^/|"]+)?/[^\?|"]+upload\.cgi)\?@i',$page, $up)) html_error('Error: Cannot find upload server.', 0); - $up[1] = (empty($up[2])) ? "http://$domain".$up[1] : $up[1]; +// Advanced Settings (Don't edit it unless you know what are you doing) + $_T8['xfsFree'] = false; // Change to true if the host is using XFS free. + $_T8['path'] = '/'; // URL path to XFS script, default: '/' + $_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload' + $_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro) - $uid = '';for ($i = 0; $i < 12; $i++) $uid .= rand(0,9); +$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit) - $post = array(); - $post['upload_type'] = 'file'; - $post['sess_id'] = cut_str($page, 'name="sess_id" value="', '"'); - $post['srv_tmp_url'] = urlencode(cut_str($page, 'name="srv_tmp_url" value="', '"')); - $post['link_rcpt'] = ''; - $post['link_pass'] = ''; - $post['tos'] = 1; - $post['submit_btn'] = ' Upload! '; - - $up_url = $up[1]."?upload_id=$uid&js_on=1&utype=".cut_str($page, "var utype='", "'")."&upload_type=file"; - - // Uploading - echo "\n"; - - $url = parse_url($up_url); - $upfiles = upfile($url['host'], 80, $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'file_0', '', $_GET['proxy'], $pauth); - - // Upload Finished - echo "\n"; - - is_page($upfiles); - - $post = array(); - $post['op'] = 'upload_result'; - $post['fn'] = cut_str($upfiles,"'fn'>","<"); - $post['st'] = 'OK'; - - $page = geturl($domain, 80, '/', $up_url, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); +/* # Account Info # */ +$upload_acc[$acc_key_name]['user'] = ''; //Set your login +$upload_acc[$acc_key_name]['pass'] = ''; //Set your password - if (preg_match('@(https?://(?:www\.)?'.str_replace(array('www.', '.'), array('', '\.'), $domain).'/\w+(?:/[^\?|/|<|>|\"|\'|\r|\n]+)?(?:\.html?)?)\?killcode=\w+@i', $page, $lnk)) { - $download_link = $lnk[1]; - $delete_link = $lnk[0]; - } else html_error('Download link not found.', 0); -} +if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://www.rapidleech.com/index.php/topic/14014-upload-plugin-for-sites-with-xfs-pro/ or http://pastebin.com/E0z7qMU1 '); +require(HOST_DIR . 'upload/GenericXFSHost.inc.php'); -//[17-8-2012] Written by Th3-822 +// Written by Th3-822 - Last Update: [21-9-2013] ?> \ No newline at end of file diff --git a/hosts/upload/filefactory.com.index.php b/hosts/upload/filefactory.com.index.php deleted file mode 100644 index c9a1af5..0000000 --- a/hosts/upload/filefactory.com.index.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/hosts/upload/filefactory.com.php b/hosts/upload/filefactory.com.php deleted file mode 100644 index 73769f7..0000000 --- a/hosts/upload/filefactory.com.php +++ /dev/null @@ -1,31 +0,0 @@ -\n
\n
Retrive upload ID
\n"; - - $post = array(); - $post['Filename'] = $lname; - $post['Upload'] = 'Submit Query'; - - $up_loc = "http://upload.filefactory.com/upload.php"; - - // Uploading - echo "\n"; - - $url = parse_url($up_loc); - $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), 0, 0, $post, $lfile, $lname, "Filedata", '', 0, 0, "Shockwave Flash"); - - // Upload Finished - echo ""; - - is_page($upfiles); - - if(!preg_match('@(\w+)$@i', $upfiles, $uid)) html_error("Upload ID not found.", 0); - $page = geturl("www.filefactory.com", 80, "/file/complete.if.php/{$uid[1]}/", 'http://www.filefactory.com/upload/upload.if.php', $cookie);is_page($page); - - if(!preg_match('@/file/\w+/n/[^\'|"|<]+@i', $page, $dl)) html_error("Download link not found. (ID: {$uid[1]})", 0); - $download_link = "http://www.filefactory.com{$dl[0]}"; - -//[17-6-2011] Written by Th3-822. - -?> \ No newline at end of file diff --git a/hosts/upload/filefactory.com_member.php b/hosts/upload/filefactory.com_member.php index e269455..071f29f 100644 --- a/hosts/upload/filefactory.com_member.php +++ b/hosts/upload/filefactory.com_member.php @@ -6,79 +6,73 @@ ############################## $not_done = true; -$continue_up = false; -if ($upload_acc['filefactory_com']['user'] && $upload_acc['filefactory_com']['pass']) { +if (!empty($upload_acc['filefactory_com']['user']) && !empty($upload_acc['filefactory_com']['pass'])) { $_REQUEST['up_login'] = $upload_acc['filefactory_com']['user']; $_REQUEST['up_pass'] = $upload_acc['filefactory_com']['pass']; - $_REQUEST['action'] = "FORM"; - echo "Using Default Login and Pass.\n"; + $_REQUEST['action'] = '_T8_'; + echo "
Using Default Login.
\n"; } -if ($_REQUEST['action'] == "FORM") $continue_up=true; -else { - echo " - - - - - - \n
 Email*  
 Password*  
*You can set it as default in {$page_upload["filefactory.com_member"]}
\n"; -} - -if ($continue_up) { +if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_T8_') { + echo "\n\n\t\n\t\n\t\n"; + echo "\t\n"; + echo "\t\n"; + echo "\n
 Email* 
 Password* 

*You can set it as default in ".basename(__FILE__)."
\n"; +} else { $not_done = $login = false; + $domain = 'www.filefactory.com'; + $referer = "http://$domain"; + // Login echo "\n
\n
Login to FileFactory
\n"; - $cookie = "rPopHome=1"; + $cookie = array('ff_locale'=>'en_US.utf8'); if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) { $post = array(); - $post["redirect"] = "/member/"; - $post["email"] = $_REQUEST['up_login']; - $post["password"] = $_REQUEST['up_pass']; - - $page = geturl("www.filefactory.com", 80, "/member/login.php", 0, $cookie, $post);is_page($page); - - is_present($page, "?err=", "Login Failed: The email or password you have entered is incorrect."); - $cookie = "$cookie; " . GetCookies($page); - is_notpresent($cookie, "ff_membership=", "Login Failed."); + $post['loginEmail'] = urlencode($_REQUEST['up_login']); + $post['loginPassword'] = urlencode($_REQUEST['up_pass']); + $post['Submit'] = 'Sign+In'; + $page = geturl($domain, 80, '/member/signin.php', "$referer/member/signin.php", $cookie, $post);is_page($page); + + is_present($page, 'The Email Address submitted was invalid', 'Login Failed: Invalid email address.'); + is_present($page, 'The email or password wre invalid', 'Login Failed: The Email/Password you have entered is incorrect.'); + is_present($page, 'The email or password were invalid', 'Login Failed: The Email/Password you have entered is incorrect.'); + is_present($page, "\nLocation: /member/setpwd.php", 'Your password has expired, please change it.'); + + $cookie = GetCookiesArr($page, $cookie); + if (empty($cookie['auth'])) html_error('Login Failed, auth cookie not found.'); $login = true; - } else { - echo "
Login not found or empty, using non member upload.
\n"; - } + } else html_error('Login failed: User/Password empty.'); // Retrive upload ID echo "\n
Retrive upload ID
\n"; $post = array(); - $post['Filename'] = $lname; - if ($login) { - $post['cookie'] = urldecode(cut_str("$cookie;", 'ff_membership=', ';')); - $post['folderViewhash'] = 0; - } - $post['Upload'] = 'Submit Query'; + $post['cookie'] = rawurldecode($cookie['auth']); - $up_loc = "http://upload.filefactory.com/upload.php"; + $up_loc = 'http://upload.filefactory.com/upload-beta.php'; // Uploading echo "\n"; $url = parse_url($up_loc); - $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), 0, 0, $post, $lfile, $lname, "Filedata", '', 0, 0, "Shockwave Flash"); + $upfiles = upfile('upload.filefactory.com', 80, '/upload-beta.php', "$referer/upload/", 0, $post, $lfile, $lname, 'Filedata'); // Upload Finished echo ""; is_page($upfiles); - if(!preg_match('@(\w+)$@i', $upfiles, $uid)) html_error("Upload ID not found.", 0); - $page = geturl("www.filefactory.com", 80, "/file/complete.if.php/{$uid[1]}/", 'http://www.filefactory.com/upload/upload.if.php', $cookie);is_page($page); + if(!preg_match('@\s(\w+)\s*$@i', $upfiles, $uid)) html_error('Upload ID not found.'); + $page = geturl($domain, 80, '/upload/results.php?files='.$uid[1], "$referer/upload/", $cookie);is_page($page); - if(!preg_match('@/file/\w+/n/[^\'|"|<]+@i', $page, $dl)) html_error("Download link not found. (ID: {$uid[1]})", 0); - $download_link = "http://www.filefactory.com{$dl[0]}"; + if(!preg_match('@/file/\w+(/[^\r\n\"\'<>\s\t]+)?@i', $page, $dl)) html_error("Download link not found. (ID: {$uid[1]})"); + $download_link = $referer.$dl[0]; } //[17-6-2011] Written by Th3-822. +//[15-9-2013] Rewritten and fixed for new FF site & Removed anon user support. - Th3-822 +//[24-10-2013] Added a error at login. - Th3-822 ?> \ No newline at end of file diff --git a/hosts/upload/filegaze.com.index.php b/hosts/upload/filegaze.com.index.php index aaaf5f6..80590aa 100644 --- a/hosts/upload/filegaze.com.index.php +++ b/hosts/upload/filegaze.com.index.php @@ -1,4 +1,4 @@ - +
diff --git a/hosts/upload/filevelocity.com_member.index.php b/hosts/upload/filevelocity.com_member.index.php index c3cd88c..703f32c 100644 --- a/hosts/upload/filevelocity.com_member.index.php +++ b/hosts/upload/filevelocity.com_member.index.php @@ -1,4 +1,4 @@ - +
diff --git a/hosts/upload/filewinds.com_member.index.php b/hosts/upload/filewinds.com_member.index.php index 9146826..84e9606 100644 --- a/hosts/upload/filewinds.com_member.index.php +++ b/hosts/upload/filewinds.com_member.index.php @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/hosts/upload/hotfile.com.php b/hosts/upload/hotfile.com.php deleted file mode 100644 index b298d92..0000000 --- a/hosts/upload/hotfile.com.php +++ /dev/null @@ -1,94 +0,0 @@ -
Use Default login/pass.
\n"; -} -if ($_REQUEST['action'] == "FORM") - $continue_up=true; -else{ -?> - - - - - - - -
 Username*  
 Password*  
*You can set it as default in hotfile.com.php
- - - - - -
-
Retrive upload ID
- - - - - - - -
- - - \ No newline at end of file diff --git a/hosts/upload/hugefiles.net.index.php b/hosts/upload/hugefiles.net.index.php index 73412c5..84dd915 100644 --- a/hosts/upload/hugefiles.net.index.php +++ b/hosts/upload/hugefiles.net.index.php @@ -1,4 +1,4 @@ - +
diff --git a/hosts/upload/hugefiles.net_member.index.php b/hosts/upload/hugefiles.net_member.index.php index 387ed64..c99b416 100644 --- a/hosts/upload/hugefiles.net_member.index.php +++ b/hosts/upload/hugefiles.net_member.index.php @@ -1,4 +1,4 @@ - +\n"; echo "
diff --git a/hosts/upload/ok2upload.com_member.index.php b/hosts/upload/ok2upload.com_member.index.php index b8aa70f..1da836b 100644 --- a/hosts/upload/ok2upload.com_member.index.php +++ b/hosts/upload/ok2upload.com_member.index.php @@ -1,4 +1,4 @@ -', '')); if (!empty($dlnk)) $download_link = $dlnk; else { + is_present($upfiles, 'Uploading is current disabled'); $rmsg = trim(cut_str($upfiles, '', '')); html_error('Upload error: Msg: '. htmlentities($rmsg)); } diff --git a/hosts/upload/queenshare.com.index.php b/hosts/upload/queenshare.com.index.php new file mode 100644 index 0000000..0e41cd8 --- /dev/null +++ b/hosts/upload/queenshare.com.index.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/hosts/upload/queenshare.com.php b/hosts/upload/queenshare.com.php new file mode 100644 index 0000000..e1fbd51 --- /dev/null +++ b/hosts/upload/queenshare.com.php @@ -0,0 +1,28 @@ + 2); // Version of this config file. (Do Not Edit) + +/* # Plugin's Settings # */ +$_T8['domain'] = 'queenshare.com'; // May require the www. (Check first if the site adds the www.) +$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro) +$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro) + +// Advanced Settings (Don't edit it unless you know what are you doing) + $_T8['xfsFree'] = false; // Change to true if the host is using XFS free. + $_T8['path'] = '/'; // URL path to XFS script, default: '/' + $_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload' + $_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro) + +$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit) + +/* # Account Info # */ +$upload_acc[$acc_key_name]['user'] = ''; //Set your login +$upload_acc[$acc_key_name]['pass'] = ''; //Set your password + +if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://www.rapidleech.com/index.php/topic/14014-upload-plugin-for-sites-with-xfs-pro/ or http://pastebin.com/E0z7qMU1 '); +require(HOST_DIR . 'upload/GenericXFSHost.inc.php'); + +// Written by Th3-822 - Last Update: [21-9-2013] + +?> \ No newline at end of file diff --git a/hosts/upload/rapidgator.net.index.php b/hosts/upload/rapidgator.net.index.php deleted file mode 100644 index 8d3be80..0000000 --- a/hosts/upload/rapidgator.net.index.php +++ /dev/null @@ -1,7 +0,0 @@ - \ No newline at end of file diff --git a/hosts/upload/rapidgator.net_member.index.php b/hosts/upload/rapidgator.net_member.index.php new file mode 100644 index 0000000..539e3d5 --- /dev/null +++ b/hosts/upload/rapidgator.net_member.index.php @@ -0,0 +1,7 @@ + \ No newline at end of file diff --git a/hosts/upload/rapidgator.net.php b/hosts/upload/rapidgator.net_member.php similarity index 74% rename from hosts/upload/rapidgator.net.php rename to hosts/upload/rapidgator.net_member.php index 401c2b6..dd60896 100644 --- a/hosts/upload/rapidgator.net.php +++ b/hosts/upload/rapidgator.net_member.php @@ -29,7 +29,7 @@ echo "
*You can set it as default in ".basename(__FILE__)."
\n\n"; } else { - $not_done = false; + $not_done = $login = false; $domain = 'rapidgator.net'; $referer = "http://$domain/"; @@ -54,13 +54,14 @@ $post['LoginForm%5BverifyCode%5D'] = urlencode($_POST['captcha']); } - $page = geturl($domain, 80, '/auth/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page); + $page = geturl($domain, 80, '/auth/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0);is_page($page); $cookie = GetCookiesArr($page, $cookie); //Redirects $rdc = 0; - while (($redir = ChkRGRedirs($page, true, ($upload_acc['rapidgator_net']['user'] && $upload_acc['rapidgator_net']['pass']))) && $rdc < 5) { - $page = geturl($redir['host'], 80, $redir['path'].(!empty($redir['query']) ? '?'.$redir['query'] : ''), $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, $redir['scheme']);is_page($page); + $redir = parse_url("http://$domain/auth/login"); + while (($redir = ChkRGRedirs($page, $redir, true, ($upload_acc['rapidgator_net']['user'] && $upload_acc['rapidgator_net']['pass']))) && $rdc < 5) { + $page = geturl($redir['host'], defport($redir), $redir['path'].(!empty($redir['query']) ? '?'.$redir['query'] : ''), $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, $redir['scheme']);is_page($page); $cookie = GetCookiesArr($page, $cookie); $rdc++; } @@ -99,26 +100,23 @@ if (empty($cookie['user__'])) html_error("Login Error: Cannot find 'user__' cookie."); $cookie['lang'] = 'en'; $login = true; - } else { - echo "
Login not found or empty, using non member upload.
\n"; - $login = false; - } + } else html_error('Login failed: User/Password empty.'); // Retrive upload ID echo "\n
Retrive upload ID
\n"; $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); - if (!$login) { - $cookie = GetCookiesArr($page, $cookie); + if (!$login) $cookie = GetCookiesArr($page, $cookie); - //Redirects - $rdc = 0; - while (($redir = ChkRGRedirs($page)) && $rdc < 5) { - $page = geturl($redir['host'], 80, $redir['path'].(!empty($redir['query']) ? '?'.$redir['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); - $cookie = GetCookiesArr($page, $cookie); - $rdc++; - } + //Redirects + $rdc = 0; + $redir = parse_url("http://$domain/"); + while (($redir = ChkRGRedirs($page, $redir)) && $rdc < 5) { + $page = geturl($redir['host'], 80, $redir['path'].(!empty($redir['query']) ? '?'.$redir['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); + $cookie = GetCookiesArr($page, $cookie); + $rdc++; } + if (!preg_match('@var\s+form_url\s*=\s*"(https?://[^/|\"]+/[^\"]+)"\s*;@i', $page, $form_url) || !preg_match('@var\s+progress_url_web\s*=\s*"(https?://[^/|\"]+/[^\"]+)"\s*;@i', $page, $prog_url)) html_error('Error: Cannot find upload url.', 0); $starttime = time(); @@ -142,6 +140,15 @@ $url = parse_url($prog_url[1]."&data%5B0%5D%5Buuid%5D=$uuid&data%5B0%5D%5Bstart_time%5D=$starttime"); $page = geturl($url['host'], 80, $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); + //Redirects + $rdc = 0; + $redir = $url; + while ((stripos($page, "\nLocation: ") !== false) && ($redir = ChkRGRedirs($page, $redir)) && $rdc < 5) { + $page = geturl($redir['host'], 80, $redir['path'].(!empty($redir['query']) ? '?'.$redir['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); + $cookie = GetCookiesArr($page, $cookie); + $rdc++; + } + $body = substr($page, strpos($page, "\r\n\r\n") + 4); if (!preg_match_all('@"([^\"]*)":"([^\"]*)"@i', $body, $resp)) html_error("Unknown reply from server."); $resp = array_combine($resp[1], array_map('stripcslashes', $resp[2])); @@ -160,7 +167,7 @@ function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5') { } // 4 RG: You don't have nothing to read here :D -function ChkRGRedirs($page, $login = false, $default_login = false) { // Edited for upload plugin usage. +function ChkRGRedirs($page, $lasturl, $login = false, $default_login = false) { // Edited for upload plugin usage. $hpos = strpos($page, "\r\n\r\n"); $headers = empty($hpos) ? $page : substr($page, 0, $hpos); @@ -180,6 +187,26 @@ function ChkRGRedirs($page, $login = false, $default_login = false) { // Edited $js = preg_replace('@^[\s\t]*\w+\([^\;]+;@i', '', $js); $js = preg_replace('@document\.body\.onmousemove[\s\t]*=[\s\t]*function[\s\t]*\(\)[\s\t]*\{@i', '', $js); $js = preg_replace('@document\.body\.onmousemove[\s\t]*=[\s\t]*\'\';?\};[\s\t]*window\.setTimeout\([\s\t]*((\"[^\"]+\")|(\'[^\']+\'))[^\;]+;[\s\t\r\n]*$@i', '', $js); + } elseif (($funcPos = stripos($js, 'function WriteA(')) !== false) { // JS + aaaaaaaaaaaaaaaaaaaaaaaaa + $links = array(); + if (preg_match_all('@]*\shref="((?:https?://(?:www\.)?rapidgator\.net)?/[^\"]+)"[^>]*\sid="([A-Za-z][\w\.\-]*)"@i', $body, $a)) $links = array_merge($links, array_combine($a[2], $a[1])); + if (preg_match_all('@]*\sid="([A-Za-z][\w\.\-]*)"[^>]*\shref="((?:https?://(?:www\.)?rapidgator\.net)?/[^\"]+)"@i', $body, $a)) $links = array_merge($links, array_combine($a[1], $a[2])); + if (empty($links)) html_error('Cannot get the redirect fields'); + unset($a); + + $jsLinks = ''; + foreach ($links as $key => $link) { + if (strpos($link, '://') === false) $link = (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net' . $link; + $jsLinks .= "$key: '".addslashes($link)."', "; + } + unset($links, $key, $link); + $jsLinks = '{' . substr($jsLinks, 0, -2) . '}'; + $func = substr($js, $funcPos); + if (!preg_match('@\.getElementById\(([\$_A-Za-z][\$\w]*)\)@i', $func, $linkVar)) html_error('Cannot edit redirect JS'); + $linkVar = $linkVar[1]; + unset($func); + $js = substr($js, 0, $funcPos)."\nvar T8RGLinks = $jsLinks;\nif ($linkVar in T8RGLinks) document.getElementById('rgredir').value = T8RGLinks[$linkVar];"; + unset($jsLinks, $funcPos, $linkVar); } echo "\n

\n"; foreach ($data as $name => $input) echo "\n"; @@ -190,9 +217,9 @@ function ChkRGRedirs($page, $login = false, $default_login = false) { // Edited $_REQUEST['rgredir'] = rawurldecode($_REQUEST['rgredir']); if (strpos($_REQUEST['rgredir'], '://')) $_REQUEST['rgredir'] = parse_url($_REQUEST['rgredir'], PHP_URL_PATH); if (empty($_REQUEST['rgredir']) || substr($_REQUEST['rgredir'], 0, 1) != '/') html_error('Invalid redirect value.'); - $redir = 'http://rapidgator.net'.$_REQUEST['rgredir']; + $redir = (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net'.$_REQUEST['rgredir']; } - } elseif (preg_match('@Location: ((https?://(?:[^/|\r|\n]+\.)?rapidgator\.net)?'.($login ? '/auth/login' : '/').'[^\r|\n]*)@i', $headers, $redir)) $redir = (empty($redir[2])) ? 'http://rapidgator.net'.$redir[1] : $redir[1]; + } elseif (preg_match('@Location: ((https?://(?:[^/\r\n]+\.)?rapidgator\.net)?'.($login ? '/auth/login' : '/').'[^\r\n]*)@i', $headers, $redir)) $redir = (empty($redir[2])) ? (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net'.$redir[1] : $redir[1]; return (empty($redir) ? false : parse_url($redir)); } @@ -201,5 +228,9 @@ function ChkRGRedirs($page, $login = false, $default_login = false) { // Edited // [02-10-2012] Fixed for new weird redirect code. - Th3-822 // [31-10-2012] Fixed for https on login/redirects. - Th3-822 // [28-1-2013] Added Login captcha support. - Th3-822 +// [14-6-2013] Removed https from first login try, for avoid block. - Th3-822 +// [10-8-2013] Fixed redirects (again). - Th3-822 +// [05-10-2013] Removed anon user support. - Th3-822 +// [25-11-2013] Fixed redirects function (aagain :D ). - Th3-822 ?> \ No newline at end of file diff --git a/hosts/upload/share-now.net.php b/hosts/upload/share-now.net.php index 60ffdc9..1ef6287 100644 --- a/hosts/upload/share-now.net.php +++ b/hosts/upload/share-now.net.php @@ -1,4 +1,4 @@ - +
diff --git a/hosts/upload/shragle.com_member.index.php b/hosts/upload/shragle.com_member.index.php index 2c505c8..7d16f57 100644 --- a/hosts/upload/shragle.com_member.index.php +++ b/hosts/upload/shragle.com_member.index.php @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/hosts/upload/turbobit.net_member.php b/hosts/upload/turbobit.net.php similarity index 61% rename from hosts/upload/turbobit.net_member.php rename to hosts/upload/turbobit.net.php index 26cf5ed..f05354c 100644 --- a/hosts/upload/turbobit.net_member.php +++ b/hosts/upload/turbobit.net.php @@ -21,7 +21,7 @@ echo " - + \n"; echo "\n"; echo "\n"; @@ -56,28 +56,23 @@ $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); } - if (!preg_match('@]*[\s\t\r\n]flashvars[\s\t]*=[\s\t]*"([^\"\r\n<>]+)"@i', $page, $fvars)) html_error('Error: Cannot find upload data.', 0); - $fvars = FormToArr($fvars[1]); - if (empty($fvars['urlSite'])) html_error('Error: Upload URL not found.'); + if (!preg_match('@https?://s\d+\.turbobit\.net/uploadfile@i', $page, $up_url)) html_error('Error: Upload URL not found.'); $post = array(); $post['Filename'] = $lname; if ($login) { - if (empty($fvars['userId'])) html_error('Error: UserID not found.'); - $post['user_id'] = $fvars['userId']; + $post['user_id'] = cut_str($page, 'name="user_id" value="', '"'); + if (empty($post['user_id'])) html_error('Error: UserID not found.'); } - $post['id'] = (empty($fvars['fileId']) ? 'null' : $fvars['fileId']); - $post['stype'] = (empty($fvars['stype']) ? 'null' : $fvars['stype']); - $post['apptype'] = $fvars['apptype']; - $post['Upload'] = 'Submit Query'; + $post['apptype'] = cut_str($page, 'name="apptype" value="', '"'); - $up_url = $fvars['urlSite']; + $up_url = $up_url[0]; // Uploading echo "\n"; $url = parse_url($up_url); - $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 'Shockwave Flash'); + $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth); // Upload Finished echo "\n"; @@ -86,7 +81,7 @@ $json = Get_Reply($upfiles); if ((empty($json['result']) || $json['result'] != 'true') || empty($json['id'])) html_error('Upload error: "'.htmlentities($json['message']).'"'); - $id = $json['id']; + $id = is_array($json['id']) ? $json['id']['fid'] : $json['id']; //geturl($domain, 80, '/newfile/edit/'.$id, $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); $page = geturl($domain, 80, '/newfile/gridFile/'.$id, $referer."newfile/edit/\r\nX-Requested-With: XMLHttpRequest", $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); @@ -97,16 +92,6 @@ if (!empty($info['cell'][7])) $delete_link = $referer."delete/file/$id/".$info['cell'][7]; } -function FormToArr($content, $v1 = '&', $v2 = '=') { - $rply = array(); - if (strpos($content, $v1) === false || strpos($content, $v2) === false) return $rply; - foreach (array_filter(array_map('trim', explode($v1, $content))) as $v) { - $v = array_map('trim', explode($v2, $v, 2)); - if ($v[0] != '') $rply[$v[0]] = $v[1]; - } - return $rply; -} - function Get_Reply($page) { if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.'); $json = substr($page, strpos($page, "\r\n\r\n") + 4); @@ -120,28 +105,43 @@ function Get_Reply($page) { function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5') { echo "\n\n"; foreach ($inputs as $name => $input) echo "\t\n"; - echo "\t

" . lang(301) . " CAPTCHA Image " . lang(302) . ":   \n\t\t\n\t

\n"; - echo "\t\n"; - echo "\n\n"; + echo "\t

" . lang(301) . " CAPTCHA Image " . lang(302) . ":   \n\t\t\n\t

\n\t\n\n\n"; +} + +// Edited For upload.php usage. +function Show_reCaptcha($pid, $inputs, $sname = 'Upload File') { + if (!is_array($inputs)) html_error('Error parsing captcha data.'); + + // Themes: 'red', 'white', 'blackglass', 'clean' + echo "\n\n

\n"; + foreach ($inputs as $name => $input) echo "\n"; + echo "
\n\n
\n\n"; + exit; } function Login($user, $pass) { global $default_acc, $cookie, $domain, $referer, $pauth; $errors = array('CaptchaInvalid' => 'Wrong CAPTCHA entered.', 'InvalidLogIn' => 'Invalid Login/Pass.', 'CaptchaRequired' => 'Captcha Required.'); - if (!empty($_POST['step']) && $_POST['step'] == '1') { - if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.'); + if (!empty($_POST['step']) && ($_POST['step'] == '1' || $_POST['step'] == '2')) { $cookie = StrToCookies(decrypt(urldecode($_POST['cookie']))); $post = array(); $post['user%5Blogin%5D'] = urlencode($user); $post['user%5Bpass%5D'] = urlencode($pass); - $post['user%5Bcaptcha_response%5D'] = urlencode($_POST['captcha']); + if ($_POST['step'] == '1') { + if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.'); + $post['user%5Bcaptcha_response%5D'] = urlencode($_POST['captcha']); + } else { + if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.'); + $post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field']; + $post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']); + } $post['user%5Bcaptcha_type%5D'] = urlencode($_POST['c_type']); $post['user%5Bcaptcha_subtype%5D'] = (!empty($_POST['c_subtype']) ? urlencode($_POST['c_subtype']) : ''); $post['user%5Bmemory%5D'] = 'on'; $post['user%5Bsubmit%5D'] = 'Login'; - $page = geturl($domain, 80, '/user/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); + $page = geturl($domain, 80, '/user/login', $referer.'login', $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); $cookie = GetCookiesArr($page, $cookie); $x = 0; @@ -156,6 +156,8 @@ function Login($user, $pass) { is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect.'); is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail.'); is_present($page, 'Incorrect verification code', 'Login Failed: Wrong CAPTCHA entered.'); + is_present($page, 'Incorrect captcha code', 'Login Failed: Wrong Recaptcha entered.'); + //is_present($page, 'Limit of login attempts exceeded for your account. It has been temporarily locked.', 'Login Failed: Account Temporally Locked.'); if (empty($redir) || $redir != $referer) { $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); @@ -171,11 +173,11 @@ function Login($user, $pass) { $post['user%5Bmemory%5D'] = 'on'; $post['user%5Bsubmit%5D'] = 'Login'; - $page = geturl($domain, 80, '/user/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); + $page = geturl($domain, 80, '/user/login', $referer.'login', $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); $cookie = GetCookiesArr($page, $cookie); if (!empty($cookie['user_isloggedin']) && $cookie['user_isloggedin'] == '1') { - $page = geturl($domain, 80, '/', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); + $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); SaveCookies($user, $pass); // Update cookies file return $page; } @@ -192,41 +194,54 @@ function Login($user, $pass) { is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect'); is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail'); - - if (!preg_match('@(https?://[^/\r\n\t\s\'\"<>]+)?/captcha/[^\r\n\t\s\'\"<>]+@i', $page, $imgurl)) { - if (stripos($page, '/user/logout">Logout<') !== false) { - $this->SaveCookies($user, $pass); // Update cookies file - is_present($page, 'Turbo Access denied', 'Login Failed: Account isn\'t premium'); - return $this->PremiumDL(); - } else html_error('CAPTCHA not found.'); - } - $imgurl = (empty($imgurl[1])) ? 'http://turbobit.net'.$imgurl[0] : $imgurl[0]; - $imgurl = html_entity_decode($imgurl); - - if (!preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]+)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_type\][\'\"]@i', $page, $c_type) || !preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]*)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_subtype\][\'\"]@i', $page, $c_subtype)) html_error('CAPTCHA data not found.'); - - //Download captcha img. - $url = parse_url($imgurl); - $page = geturl($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); - $capt_img = substr($page, strpos($page, "\r\n\r\n") + 4); - $imgfile = DOWNLOAD_DIR . 'turbobit_captcha.png'; - - if (file_exists($imgfile)) unlink($imgfile); - if (!write_file($imgfile, $capt_img)) html_error('Error getting CAPTCHA image.'); - - $data = array(); - $data['action'] = 'FORM'; - $data['cookie'] = urlencode(encrypt(CookiesToStr($cookie))); - $data['step'] = '1'; - $data['c_type'] = urlencode($c_type[1]); - $data['c_subtype'] = urlencode($c_subtype[1]); - if (!$default_acc) { - $data['up_encrypted'] = 'true'; - $data['up_login'] = urlencode(encrypt($user)); - $data['up_pass'] = urlencode(encrypt($pass)); - } - EnterCaptcha($imgfile.'?'.time(), $data); - exit; + // is_present($page, 'Limit of login attempts exceeded for your account. It has been temporarily locked.', 'Login Failed: Account Temporally Locked'); + + if (preg_match('@(https?://[^/\r\n\t\s\'\"<>]+)?/captcha/[^\r\n\t\s\'\"<>]+@i', $page, $imgurl)) { + $imgurl = (empty($imgurl[1])) ? 'http://turbobit.net'.$imgurl[0] : $imgurl[0]; + $imgurl = html_entity_decode($imgurl); + + if (!preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]+)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_type\][\'\"]@i', $page, $c_type) || !preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]*)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_subtype\][\'\"]@i', $page, $c_subtype)) html_error('CAPTCHA data not found.'); + + //Download captcha img. + $url = parse_url($imgurl); + $page = geturl($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); + $capt_img = substr($page, strpos($page, "\r\n\r\n") + 4); + $imgfile = DOWNLOAD_DIR . 'turbobit_captcha.png'; + + if (file_exists($imgfile)) unlink($imgfile); + if (!write_file($imgfile, $capt_img)) html_error('Error getting CAPTCHA image.'); + + $data = array(); + $data['action'] = 'FORM'; + $data['cookie'] = urlencode(encrypt(CookiesToStr($cookie))); + $data['step'] = '1'; + $data['c_type'] = urlencode($c_type[1]); + $data['c_subtype'] = urlencode($c_subtype[1]); + if (!$default_acc) { + $data['up_encrypted'] = 'true'; + $data['up_login'] = urlencode(encrypt($user)); + $data['up_pass'] = urlencode(encrypt($pass)); + } + EnterCaptcha($imgfile.'?'.time(), $data); + exit; + } elseif (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $page, $pid)) { + $data = array(); + $data['action'] = 'FORM'; + $data['cookie'] = urlencode(encrypt(CookiesToStr($cookie))); + $data['step'] = '2'; + $data['c_type'] = 'recaptcha'; + if (!$default_acc) { + $data['up_encrypted'] = 'true'; + $data['up_login'] = urlencode(encrypt($user)); + $data['up_pass'] = urlencode(encrypt($pass)); + } + Show_reCaptcha($pid[1], $data, 'Login'); + exit; + } elseif (stripos($page, '/user/logout">Logout<') !== false) { + $this->SaveCookies($user, $pass); // Update cookies file + is_present($page, 'Turbo Access denied', 'Login Failed: Account isn\'t premium'); + return $this->PremiumDL(); + } else html_error('CAPTCHA not found.'); } } @@ -276,7 +291,7 @@ function CookieLogin($user, $pass) { function SaveCookies($user, $pass) { global $cookie, $secretkey; - $maxdays = 7; // Max days to keep cookies saved + $maxdays = 31; // Max days to keep cookies saved $filename = DOWNLOAD_DIR.basename('turbobit_ul.php'); if (file_exists($filename)) { $file = file($filename); @@ -296,5 +311,8 @@ function SaveCookies($user, $pass) { } //[11-1-2013] Written by Th3-822. +//[07-6-2013] Added login recaptcha support. - Th3-822 +//[22-8-2013] Fixed for changes at upload page. - Th3-822 +//[06-9-2013] Fixed get fileid. - Th3-822 ?> \ No newline at end of file diff --git a/hosts/upload/turbobit.net_member.index.php b/hosts/upload/turbobit.net_member.index.php deleted file mode 100644 index b933c6e..0000000 --- a/hosts/upload/turbobit.net_member.index.php +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/hosts/upload/turboupload.com.php b/hosts/upload/turboupload.com.php index 529087e..a548116 100644 --- a/hosts/upload/turboupload.com.php +++ b/hosts/upload/turboupload.com.php @@ -1,4 +1,4 @@ - \ No newline at end of file diff --git a/hosts/upload/uploadhero.co.php b/hosts/upload/uploadhero.co.php new file mode 100644 index 0000000..e9abc8e --- /dev/null +++ b/hosts/upload/uploadhero.co.php @@ -0,0 +1,111 @@ +
Using Default Login.
\n"; +} + +if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') { + echo "
 Login* 
 Email* 
 Password* 

*You can set it as default in ".basename(__FILE__)."
+ + + + \n"; + echo "\n"; + echo "\n"; + echo "
 Username* 
 Password* 

*You can set it as default in ".basename(__FILE__)."
\n\n"; +} else { + $not_done = false; + $cookie = array(); + + // Login + echo "\n
\n
Login to uploadhero.co
\n"; + + if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) { + $query = array(); + $query['u'] = $_REQUEST['up_login']; + $query['p'] = $_REQUEST['up_pass']; + + $page = geturl('api.uploadhero.co', 80, '/upload.php?'.http_build_query($query), '', 0, 0, 0, $_GET['proxy'], $pauth);is_page($page); + $body = substr($page, strpos($page, "\r\n\r\n") + 4); + is_present($body, 'Invalid Username/password', 'Login failed: User/Password incorrect.'); + $login = true; + } else { + echo "
Login not found or empty, using non member upload.
\n"; + if ($GetUpUrlFromApi) { + $page = geturl('api.uploadhero.co', 80, '/upload.php', '', 0, 0, 0, $_GET['proxy'], $pauth); + is_page($page); + } + $login = false; + } + + // Retrive upload ID + echo "\n
Preparing upload
\n"; + + if (!$GetUpUrlFromApi) { + $page = geturl('uploadhero.co', 80, '/', '', 0, 0, 0, $_GET['proxy'], $pauth); + is_page($page); + } + + if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*uploadhero\.com?/upload/upload\.php[^\r\n\s\t<>\"\']*@i', $page, $up)) html_error('Error: Cannot find upload URL.', 0); + + if ($login) { + if (!preg_match('@[\r\n\s\t]*([^<>\r\n\s\t]+)[\r\n\s\t]*@i', $body, $pars)) html_error('Upload params not found.'); + $post = FormToArr($pars[1].'&'); + } else $post = array(); + + $up_url = $up[0]; + + // Uploading + echo "\n"; + + $url = parse_url($up_url); + $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), '', 0, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth); + + // Upload Finished + echo "\n"; + + is_page($upfiles); + + is_present($upfiles, "\r\n\r\nupload_error", 'Your upload has failed.'); + $body = trim(substr($upfiles, strpos($upfiles, "\r\n\r\n") + 4)); + + if (!$login) { + $finds = array('%20', '%27', '%C3%A9', '%C3%A8', '%E2%82%AC', '%25', '%26'); + $replace = array('kkk', 'qspkq', 'ab12', 'ab21', 'eurobcd', 'pourcentbcd', 'uuuuuu'); + $name = str_replace($finds, $replace, rawurlencode($lname)); + $page = geturl('uploadhero.co', 80, "/fileinfo.php?folder=&name=$name&size=$fsize", '', 0, 0, 0, $_GET['proxy'], $pauth);is_page($page); + } + + if (!$login && preg_match('@https?://(?:www\.)?uploadhero\.com?/dl/[^\r\n\s\t<>\"\']+@i', $page, $dlnk)) { + $download_link = $dlnk[0]; + if (preg_match('@https?://(?:www\.)?uploadhero\.com?/delete/[^\r\n\s\t<>\"\']+@i', $page, $dellnk)) $delete_link = $dellnk[0]; + } elseif (strlen($body) == 8) $download_link = "http://uploadhero.co/dl/$body"; + else html_error('Download link not found.', 0); +} + +function FormToArr($content, $v1 = '&', $v2 = '=') { + $rply = array(); + if (empty($content) || strpos($content, $v1) === false || strpos($content, $v2) === false) return $rply; + foreach (array_filter(array_map('trim', explode($v1, $content))) as $v) { + $v = array_map('trim', explode($v2, $v, 2)); + if ($v[0] != '') $rply[$v[0]] = $v[1]; + } + return $rply; +} + +//[03-4-2013] Written by Th3-822. +//[24-11-2013] Fixed get download link as member. - Th3-822 + +?> \ No newline at end of file diff --git a/hosts/upload/uploadhero.com.index.php b/hosts/upload/uploadhero.com.index.php deleted file mode 100644 index d6939d2..0000000 --- a/hosts/upload/uploadhero.com.index.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/hosts/upload/uploadhero.com.php b/hosts/upload/uploadhero.com.php deleted file mode 100644 index 4183589..0000000 --- a/hosts/upload/uploadhero.com.php +++ /dev/null @@ -1,100 +0,0 @@ -
Using Default Login.
\n"; -} - -if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') { - echo " - - - - \n"; - echo "\n"; - echo "\n"; - echo "
 User* 
 Password* 

*You can set it as default in ".basename(__FILE__)."
\n\n"; -} else { - $not_done = false; - $domain = 'uploadhero.com'; - $referer = "http://$domain/"; - - // Login - echo "\n
\n
Login to $domain
\n"; - - $cookie = array('lang' => 'en'); - if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) { - $post = array(); - $post['pseudo_login'] = urlencode($_REQUEST['up_login']); - $post['password_login'] = urlencode($_REQUEST['up_pass']); - - $page = geturl($domain, 80, '/lib/connexion.php', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); - $cookie = GetCookiesArr($page, $cookie); - - is_present($page, 'Username or password invalid.', 'Login Failed: Invalid Username or Password.'); - - if (!preg_match('@
]*>([^<>]+)
@i', $page, $uh)) html_error('Login Error: Cannot find \'uh\' cookie.'); // Why in many sites at the code the site is called as "transitfiles.com"? - $cookie['uh'] = urlencode(html_entity_decode($uh[1])); - $cookie['lang'] = 'en'; - $login = true; - } else { - echo "
Login not found or empty, using non member upload.
\n"; - $login = false; - } - - // Retrive upload ID - echo "\n
Retrive upload ID
\n"; - - $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); - $cookie = GetCookiesArr($page, $cookie); - if (!preg_match('@[\t\s]upload_url[\t\s]*:[\t\s]*"(https?://[^/\"]+/[^\"]+)"@i', $page, $upload_url)) html_error('Error: Cannot find upload url.', 0); - - $post = array(); - $post['Filename'] = $lname; - if ($login) { - if (!preg_match('@"ID"[\t\s]*:[\t\s]*"([^\"]+)"@i', $page, $uid)) html_error('Error: UserID not found.'); - $post['ID'] = $uid[1]; - } - $post['PHPSESSID'] = $cookie['PHPSESSID']; - $post['Upload'] = 'Submit Query'; - - $up_url = $upload_url[1]; - - // Uploading - echo "\n"; - - $url = parse_url($up_url); - $upfiles = upfile($url['host'], 80, $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), '', 0, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 'Shockwave Flash'); - - // Upload Finished - echo ""; - - is_page($upfiles); - - $body = trim(substr($upfiles, strpos($upfiles, "\r\n\r\n") + 4)); - - $finds = array('%20', '%27', '%C3%A9', '%C3%A8', '%E2%82%AC', '%25', '%26'); - $replace = array('kkk', 'qspkq', 'ab12', 'ab21', 'eurobcd', 'pourcentbcd', 'uuuuuu'); - $name = str_replace($finds, $replace, rawurlencode($lname)); - - $page = geturl($domain, 80, "/fileinfo.php?folder=&name=$name&size=$fsize", $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); - - if (preg_match('@https?://(?:www\.)?uploadhero\.com/dl/[^\r\n\s\t<>\"\']+@i', $page, $dlnk)) { - $download_link = $dlnk[0]; - if (preg_match('@https?://(?:www\.)?uploadhero\.com/delete/[^\r\n\s\t<>\"\']+@i', $page, $dellnk)) $delete_link = $dellnk[0]; - } elseif (strlen($body) == 8) $download_link = "http://uploadhero.com/dl/$body"; - else html_error('Download link not found.', 0); -} - -// [06-11-2012] Written by Th3-822. - -?> \ No newline at end of file diff --git a/hosts/upload/uptobox.com_member.index.php b/hosts/upload/uptobox.com_member.index.php index 04ce181..e005ff8 100644 --- a/hosts/upload/uptobox.com_member.index.php +++ b/hosts/upload/uptobox.com_member.index.php @@ -1,4 +1,4 @@ - 20*1024*1024) html_error('You only can upload mp3 files up to 20 MB.'); $video = $upload_mp3_as_video; @@ -64,8 +66,8 @@ sleep(1); // They have a limit of 3 Request/Second... Let's wait a second :D - if ($video) $data = array('api_id'=>$app['id'], 'method'=>'video.save', 'name'=>urlencode($lname), 'description'=>'Uploaded+With+Rapidleech'); - else $data = array('api_id'=>$app['id'], 'method'=>'audio.getUploadServer'); + if ($video) $data = array('method'=>'video.save', 'name'=>$lname, 'description'=>'Uploaded with Rapidleech'); + else $data = array('method'=>'audio.getUploadServer'); $req = SigAndReq($data, '/method/'.$data['method'].'?'); if ($usecurl) $page = cURL ('https://api.vk.com'.$req); @@ -82,7 +84,7 @@ $post = array(); // if ($video) $post['is_private'] = '1'; // Uncomment for upload videos as private - $up_url = $upsrv['response']['upload_url'];// .'&api_id='.$app['id'].'&access_token='.$json['access_token']; + $up_url = $upsrv['response']['upload_url']; // Uploading echo "\n"; @@ -99,11 +101,11 @@ if (!$video) { sleep(1); // Let's wait another second :D - $data = array('api_id'=>$app['id'], 'method'=>'audio.save', 'audio'=>$upres['audio'], 'hash'=>$upres['hash'], 'server'=>$upres['server']); + $data = array('method'=>'audio.save', 'server'=>$upres['server'], 'audio'=>$upres['audio'], 'hash'=>$upres['hash']); $req = SigAndReq($data, '/method/'.$data['method'].'?'); if ($usecurl) $page = cURL ('https://api.vk.com'.$req); else { - $page = geturl('api.vk.com', 0, $req, 0, 0, array('hash'=>$upres['hash']), 0, $_GET['proxy'], $pauth, 0, 'https'); // Port is overridden to 443 + $page = geturl('api.vk.com', 0, $req, 0, 0, 0, 0, $_GET['proxy'], $pauth, 0, 'https'); // Port is overridden to 443 is_page($page); } $rply = Get_Reply($page); @@ -116,21 +118,20 @@ if ($video && !empty($upsrv['response']['vid'])) $download_link = 'http://vk.com/video' . $json['user_id'] . '_' . $upsrv['response']['vid']; elseif ($video) html_error('Your video will appear in your VK account after a while.', 0); - elseif (!$video && !empty($rply['response']['url'])) $download_link = $rply['response']['url']; else html_error('Check your VK account for see the new uploaded file.', 0); } function SigAndReq($data, $req) { + global $app; + $data['api_id'] = $app['id']; $data['format'] = 'json'; $data['v'] = '3.0'; $sig = ''; ksort($data); - foreach ($data as $k => $v) { - $sig .= "$k=$v"; - if ($k != 'method') $req .= "$k=$v&"; - } - $sig = md5($sig.$GLOBALS['app']['secret']); - $req .= "sig=$sig&access_token=".$GLOBALS['json']['access_token']; + foreach ($data as $k => $v) $sig .= "$k=$v"; + $sig = md5($sig.$app['secret']); + unset($k, $v, $data['method']); + $req .= http_build_query($data) . "&sig=$sig&access_token=".$GLOBALS['json']['access_token']; return $req; } @@ -146,5 +147,6 @@ function Get_Reply($page) { //[30-8-2012] Written by Th3-822. //[28-10-2012] Small fixes that i don't remember. - Th3-822 //[24-11-2012] Now it shows video url & Fixed auul for this plugin. - Th3-822 +//[22-9-2013] Fixed mp3 upload & Other issues. - Th3-822 ?> \ No newline at end of file diff --git a/hosts/upload/zippyshare.com.php b/hosts/upload/zippyshare.com.php index edb4acf..23da7c9 100644 --- a/hosts/upload/zippyshare.com.php +++ b/hosts/upload/zippyshare.com.php @@ -1,57 +1,92 @@ - - -
- -
Retrive upload ID
- - -"); -$nsv=cut_str($page,"enctype=\"multipart/form-data\" action=\"http://www",".zippyshare.com"); - -echo "
uploadId: {$uploadid} & nsv: {$nsv}
"; - -$url =parse_url("http://www".$nsv.".zippyshare.com/upload?uploadId=".$upladid); - -$post["uploadId"] = $upladid; -$post["terms"] = "checkbox"; -$post["x"] = rand(1,140); -$post["y"] = rand(1,20); - -$upfiles = upfile($url["host"], defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""), "http://www.zippyshare.com/", $cookie, $post, $lfile, $lname, "file_0"); - -?> - - +
Using Default Login.
\n"; +} + +if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'FORM') $continue_up = true; +else { + echo " + + + + \n"; + echo "\n"; + echo "\n"; + echo "\n
 User* 
 Password* 

*You can set it as default in ".basename(__FILE__)."
\n"; +} + +if ($continue_up) { + $not_done = false; + $domain = 'zippyshare.com'; + $referer = "http://$domain/"; + + // Login + echo "\n' : ''); - echo ($delete_link ? '' : ''); - echo ($stat_link ? '' : ''); - echo ($adm_link ? '': ''); - echo ($user_id ? '': ''); - echo ($ftp_uplink ? '': ''); - echo ($access_pass ? '': ''); - /*echo ($protect ? '': '');*/ + echo (!empty($download_link) ? '' : ''); + echo (!empty($delete_link) ? '' : ''); + echo (!empty($stat_link) ? '' : ''); + echo (!empty($adm_link) ? '': ''); + echo (!empty($user_id) ? '': ''); + echo (!empty($ftp_uplink) ? '': ''); + echo (!empty($access_pass) ? '': ''); + /*echo ($protect ? '': '');*/ echo "
\n
Login to zippyshare.com
\n"; + + $cookie = array('ziplocale' => 'en'); + if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) { + $post = array(); + $post['login'] = $_REQUEST['up_login']; + $post['pass'] = $_REQUEST['up_pass']; + $post['remember'] = 'on'; + + $page = geturl($domain, 80, '/services/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page); + is_present($page, '?invalid=1', 'Login failed: User/Password incorrect.'); + $cookie = GetCookiesArr($page, $cookie); + if (empty($cookie['zipname']) && empty($cookie['ziphash'])) html_error('Error: Login cookies not found.'); + $login = true; + } else { + echo "
Login not found or empty, using non member upload.
\n"; + $login = false; + } + + // Retrive upload ID + echo "\n
Retrive upload ID
\n"; + + $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page); + + if (!preg_match('@\'uploader\'[\s\t]*:[\s\t]*[\'|\"](https?://www\d+\.zippyshare\.com/[^\r\n\'\"\s\t<>]+)[\'|\"]@i', $page, $up)) html_error('Error: Cannot find upload server.', 0); + + $post = array(); + $post['Filename'] = $lname; + $post['uploadify'] = 'true'; + $post['embPlayerValues'] = (!empty($cookie['embed-player-values']) ? $cookie['embed-player-values'] : 'null'); + if ($login) { + $post['zipname'] = $cookie['zipname']; + $post['ziphash'] = $cookie['ziphash']; + } + $post['Upload'] = 'Submit Query'; + + $up_url = $up[1]; + + // Uploading + echo "\n"; + + $url = parse_url($up_url); + $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 'Shockwave Flash'); + + // Upload Finished + echo "\n"; + + is_page($upfiles); + + if (preg_match('@https?://www\d*\.zippyshare\.com/v/\d+/file\.html@i', $upfiles, $link)) $download_link = $link[0]; + else html_error('Download link not found.', 0); + +} + +//[17-5-2013] Written by Th3-822. + +?> \ No newline at end of file diff --git a/index.php b/index.php index 7afa48d..d2adcf1 100644 --- a/index.php +++ b/index.php @@ -1,45 +1,9 @@ RapidLeech PlugMod (eqbal) rev. ' . $rev_num . ' ' . $dev_name . '
Credits to Pramode & Checkmate & Kloon

RapidleechHost Offical Hosting

'); - -require_once(CONFIG_DIR . 'setup.php'); -// $options['download_dir'] should always end with a '/' -if (substr($options['download_dir'], - 1) != '/') $options['download_dir'] .= '/'; -define('DOWNLOAD_DIR', (substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir'])); - -define('TEMPLATE_DIR', 'templates/' . $options['template_used'] . '/'); -define('IMAGE_DIR', TEMPLATE_DIR . 'images/'); - -if ($options['no_cache']) { - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); - header('Last-Modified: ' . gmdate ("D, d M Y H:i:s") . 'GMT'); - header('Cache-Control: no-cache, must-revalidate'); - header('Pragma: no-cache'); -} -require_once(CLASS_DIR . 'other.php'); +require_once('rl_init.php'); +ignore_user_abort(true); +login_check(); -require_once(TEMPLATE_DIR . 'functions.php'); // If configs/files.lst is not writable, give a warning if (!is__writable(CONFIG_DIR . 'files.lst')) html_error(lang(304)); @@ -47,18 +11,14 @@ if (!is__writable(DOWNLOAD_DIR)) html_error(DOWNLOAD_DIR . lang(305)); purge_files($options['delete_delay']); - register_shutdown_function('pause_download'); -login_check(); - -$_REQUEST['premium_acc'] = $_POST['premium_acc'] = isset($_REQUEST['premium_acc']) && $_REQUEST['premium_acc'] == 'on' ? 'on' : false; -$_REQUEST['cookieuse'] = $_POST['cookieuse'] = isset($_REQUEST['cookieuse']) && $_REQUEST['cookieuse'] == 'on' ? 'on' : false; - -foreach($_POST as $key => $value) $_GET[$key] = $value; +$_REQUEST = $_GET = array_merge($_GET, $_POST); +$_REQUEST['premium_acc'] = $_POST['premium_acc'] = $_GET['premium_acc'] = isset($_REQUEST['premium_acc']) && $_REQUEST['premium_acc'] == 'on' ? 'on' : false; +$_REQUEST['cookieuse'] = $_POST['cookieuse'] = $_GET['cookieuse'] = isset($_REQUEST['cookieuse']) && $_REQUEST['cookieuse'] == 'on' ? 'on' : false; if (!$_COOKIE) { - if (isset($_SERVER['HTTP_COOKIE']) && strpos ($_SERVER['HTTP_COOKIE'], ';') !== false) { + if (isset($_SERVER['HTTP_COOKIE']) && strpos($_SERVER['HTTP_COOKIE'], ';') !== false) { foreach(explode('; ', $_SERVER['HTTP_COOKIE']) as $key => $value) { list ($var, $val) = explode('=', $value); $_COOKIE[$var] = $val; @@ -76,7 +36,7 @@ // require "hosts.php"; require_once(HOST_DIR . 'download/hosts.php'); -if (!empty ($_GET['image'])) { +if (!empty($_GET['image'])) { require_once(CLASS_DIR . 'http.php'); require_once(CLASS_DIR . 'image.php'); exit(); @@ -98,10 +58,10 @@ exit(); } - check_referer(); + if ($options['ref_check']) check_referer(); // Detect if it doesn't have a protocol assigned - if (stripos($LINK, '://') === false || (substr($LINK, 0, 7) != 'http://' && substr($LINK, 0, 6) != 'ftp://' && substr($LINK, 0, 6) != 'ssl://' && substr($LINK, 0, 8) != 'https://')) { + if (stripos($LINK, '://') === false || (strtolower(substr($LINK, 0, 7)) != 'http://' && strtolower(substr($LINK, 0, 6)) != 'ftp://' && strtolower(substr($LINK, 0, 6)) != 'ssl://' && strtolower(substr($LINK, 0, 8)) != 'https://')) { // Automatically assign http:// $LINK = 'http://' . $LINK; } @@ -116,18 +76,20 @@ } $Url = parse_url($LINK); + $Url['scheme'] = strtolower($Url['scheme']); $Url['path'] = (empty($Url['path'])) ? '/' :str_replace('%2F', '/', rawurlencode(rawurldecode($Url['path']))); $LINK = rebuild_url($Url); if (empty($_GET['referer'])) { $Referer = $Url; + $Referer['scheme'] = strtolower($Referer['scheme']); // Remove login from Referer unset($Referer['user'], $Referer['pass']); $Referer = rebuild_url($Referer); } else $Referer = trim(rawurldecode($_GET['referer'])); - if ($Url['scheme'] != 'http' && $Url['scheme'] != 'https' && $Url['scheme'] != 'ftp') html_error(lang(5)); + if (!in_array($Url['scheme'], array('http', 'https', 'ftp'))) html_error(lang(5)); if (empty($Url['user']) xor empty($Url['pass'])) { unset($Url['user'], $Url['pass']); @@ -159,9 +121,10 @@ foreach ($host as $site => $file) { if (host_matches($site, $Url['host'])) { include(TEMPLATE_DIR . '/header.php'); + error_reporting(E_ERROR | E_PARSE | error_reporting()); // Make sure to show any critical error while loading the plugin. require_once(CLASS_DIR . 'http.php'); require_once(HOST_DIR . 'DownloadClass.php'); - require_once(HOST_DIR . 'download/' . $file); + require_once(HOST_DIR . "download/$file"); $class = substr($file, 0, -4); $firstchar = substr($file, 0, 1); if ($firstchar > 0) $class = "d$class"; @@ -193,8 +156,9 @@ insert_location($redir); } else { + require_once(TEMPLATE_DIR . 'functions.php'); include(TEMPLATE_DIR . '/header.php'); - check_referer(); + if ($options['ref_check']) check_referer(); echo('
'); do { @@ -214,6 +178,12 @@ // if ($_GET["resume"]) {unset($_GET["resume"]);} $redirectto = ''; + if ($options['bw_save']) { + $mydomain = ($pos = strpos($_SERVER['HTTP_HOST'], ':')) !== false ? substr($_SERVER['HTTP_HOST'], 0, $pos) : $_SERVER['HTTP_HOST']; + if (($_GET['host'] == $_SERVER['SERVER_ADDR'] || host_matches($mydomain, $_GET['host']))) html_error(sprintf(lang(7), $mydomain, $_SERVER['SERVER_ADDR'])); + unset($mydomain); + } + $pauth = !empty($_GET['pauth']) ? decrypt(urldecode(trim($_GET['pauth']))) : ''; $AUTH = array(); @@ -246,10 +216,10 @@ if ($options['redir'] && $lastError && strpos($lastError, substr(lang(95), 0, strpos(lang(95), '%1$s'))) !== false) { $redirectto = trim(cut_str($lastError, substr(lang(95), 0, strpos(lang(95), '%1$s')), ']')); - print lang(8) . " $redirectto ...
$nn"; + print lang(8) . ' ' . htmlspecialchars($redirectto) . " ...
$nn"; $_GET['referer'] = urlencode($_GET['link']); - if (strpos($redirectto, '://') === false) { // If redirect doesn't have the host - $ref = parse_url(urldecode($_GET['referer'])); + if (!preg_match('@^(?:https?|ftp)\://@i', $redirectto)) { // If redirect doesn't have the host + $ref = parse_url($_GET['link']); unset($ref['user'], $ref['pass'], $ref['query'], $ref['fragment']); if (substr($redirectto, 0, 1) != '/') $redirectto = "/$redirectto"; $purl = array_merge($ref, parse_url($redirectto)); @@ -258,19 +228,19 @@ $_GET['filename'] = urlencode(basename($purl['path'])); $_GET['host'] = urlencode($purl['host']); $_GET['path'] = urlencode($purl['path'] . (!empty($purl['query']) ? '?' . $purl['query'] : '')); - $_GET['port'] = !empty($purl['port']) ? $purl['port'] : 80; + $_GET['port'] = !empty($purl['port']) ? $purl['port'] : 0; $_GET['cookie'] = !empty($_GET['cookie']) ? urlencode(encrypt($_GET['cookie'])) : ''; - if (is_array($_GET['post'])) $_GET['post'] = urlencode(encrypt(serialize($_GET['post']))); + if (is_array($_GET['post'])) $_GET['post'] = false;//$_GET['post'] = urlencode(encrypt(serialize($_GET['post']))); if (!empty($_GET['proxy'])) { $_GET['proxy'] = urlencode($_GET['proxy']); if (!empty($pauth)) $_GET['pauth'] = urlencode(encrypt($pauth)); } - $lastError = $_GET['auth'] = ''; // With $_GET['auth'] empty it will still using the $auth + $lastError = $_GET['auth'] = ''; unset($ref, $purl); } } while ($redirectto && !$lastError); - if ($lastError) html_error($lastError, 0); + if ($lastError) html_error(htmlspecialchars($lastError), 0); elseif ($file['bytesReceived'] == $file['bytesTotal'] || $file['size'] == 'Unknown') { echo '\r\n"; echo sprintf(lang(10), link_for_file(dirname($pathWithName) . '/' . basename($file['file'])), $file['size'], $file['time'], $file['speed']); @@ -301,7 +271,7 @@ if (!empty($_GET['audl'])) { echo $nn . ''; } - echo ''; + //echo ''; } echo "\n
\n\n"; } diff --git a/languages/.htaccess b/languages/.htaccess new file mode 100644 index 0000000..c468487 --- /dev/null +++ b/languages/.htaccess @@ -0,0 +1,2 @@ +order deny,allow +deny from all diff --git a/languages/en.php b/languages/en.php index 806df05..cc1bee9 100644 --- a/languages/en.php +++ b/languages/en.php @@ -396,4 +396,8 @@ $lang[387] = 'Put each file on a separated archive'; $lang[388] = 'OpenSSL'; $lang[389] = '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]'; +$lang[390] = 'CRC32 Hash'; +$lang[391] = 'CRC32 found in file\'s name is valid'; +$lang[392] = 'CRC32 found in file\'s name ("%1$s") doesn\'t match calculated CRC32'; +$lang[393] = 'SHA1 Hash'; ?> \ No newline at end of file diff --git a/languages/es.php b/languages/es.php index a5a96e0..5fd6e7e 100644 --- a/languages/es.php +++ b/languages/es.php @@ -395,4 +395,8 @@ $lang[387] = 'Colocar cada fichero en archivos separados'; $lang[388] = 'OpenSSL'; $lang[389] = '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]'; +$lang[390] = 'Hash CRC32'; +$lang[391] = 'El CRC32 encontrado en nombre del archivo es válido'; +$lang[392] = 'El CRC32 encontrado en nombre del archivo ("%1$s") no concuerda con el CRC32 calculado'; +$lang[390] = 'Hash SHA1'; ?> \ No newline at end of file diff --git a/notes.php b/notes.php index 8ef0532..506c892 100644 --- a/notes.php +++ b/notes.php @@ -1,32 +1,28 @@

@@ -34,4 +30,4 @@
- + \ No newline at end of file diff --git a/rar/.htaccess b/rar/.htaccess new file mode 100644 index 0000000..c468487 --- /dev/null +++ b/rar/.htaccess @@ -0,0 +1,2 @@ +order deny,allow +deny from all diff --git a/rl_init.php b/rl_init.php new file mode 100644 index 0000000..9ce4da3 --- /dev/null +++ b/rl_init.php @@ -0,0 +1,47 @@ +RapidLeech PlugMod (eqbal) rev. ' . $rev_num . ' ' . $dev_name . '
Credits to Pramode & Checkmate & Kloon

RapidleechHost Offical Hosting

'); + +require_once(CONFIG_DIR . 'setup.php'); + +// $options['download_dir'] should always end with a '/' +if (substr($options['download_dir'], - 1) != '/') $options['download_dir'] .= '/'; +define('DOWNLOAD_DIR', (substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir'])); +define('TEMPLATE_DIR', 'templates/' . $options['template_used'] . '/'); +define('IMAGE_DIR', TEMPLATE_DIR . 'images/'); +header('X-Frame-Options: SAMEORIGIN'); +if ($options['no_cache']) { + header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); + header('Last-Modified: ' . gmdate ("D, d M Y H:i:s") . 'GMT'); + header('Cache-Control: no-cache, must-revalidate, max-age=0'); + header('Pragma: no-cache'); +} +require_once(CLASS_DIR . 'other.php'); + + +?> \ No newline at end of file diff --git a/templates/.htaccess b/templates/.htaccess new file mode 100644 index 0000000..c468487 --- /dev/null +++ b/templates/.htaccess @@ -0,0 +1,2 @@ +order deny,allow +deny from all diff --git a/templates/neatblue/.htaccess b/templates/neatblue/.htaccess new file mode 100644 index 0000000..ad9b926 --- /dev/null +++ b/templates/neatblue/.htaccess @@ -0,0 +1,9 @@ +order deny,allow + + +deny from all + + + +deny from all + diff --git a/templates/neatblue/functions.php b/templates/neatblue/functions.php index 3d0d60f..0a4a434 100644 --- a/templates/neatblue/functions.php +++ b/templates/neatblue/functions.php @@ -21,7 +21,7 @@ function renderActions() { if (!$options['disable_mass_email']) $return .= ''; if (!$options['disable_split']) $return .= ''; if (!$options['disable_merge']) $return .= ''; - if (!$options['disable_md5']) $return .= ''; + if (!$options['disable_hashing']) $return .= '' . '' . ''; if (!$options['disable_md5_change']) $return .= ''; if ((file_exists ( CLASS_DIR . "pear.php" ) || file_exists ( CLASS_DIR . "tar.php" )) && !$options['disable_tar']) $return .= ''; diff --git a/templates/neatblue/images/.htaccess b/templates/neatblue/images/.htaccess index 10a8447..ad9b926 100644 --- a/templates/neatblue/images/.htaccess +++ b/templates/neatblue/images/.htaccess @@ -1,7 +1,9 @@ order deny,allow - + + deny from all + deny from all - \ No newline at end of file + diff --git a/templates/neatblue/images/index.html b/templates/neatblue/images/index.html deleted file mode 100644 index 21828fd..0000000 --- a/templates/neatblue/images/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - -RAPIDLEECH V2.2 - - - - - -
RAPIDLEECH V2.2 -

403: RapidLeech -> Forbidden


-You have reached this page in error, please use your back button to return to RapidLeech.

-
© Design : blacklizt
-
- - \ No newline at end of file diff --git a/templates/neatblue/styles/.htaccess b/templates/neatblue/styles/.htaccess new file mode 100644 index 0000000..ad9b926 --- /dev/null +++ b/templates/neatblue/styles/.htaccess @@ -0,0 +1,9 @@ +order deny,allow + + +deny from all + + + +deny from all + diff --git a/templates/plugmod/.htaccess b/templates/plugmod/.htaccess new file mode 100644 index 0000000..ad9b926 --- /dev/null +++ b/templates/plugmod/.htaccess @@ -0,0 +1,9 @@ +order deny,allow + + +deny from all + + + +deny from all + diff --git a/templates/plugmod/functions.php b/templates/plugmod/functions.php index 3d0d60f..0a4a434 100644 --- a/templates/plugmod/functions.php +++ b/templates/plugmod/functions.php @@ -21,7 +21,7 @@ function renderActions() { if (!$options['disable_mass_email']) $return .= ''; if (!$options['disable_split']) $return .= ''; if (!$options['disable_merge']) $return .= ''; - if (!$options['disable_md5']) $return .= ''; + if (!$options['disable_hashing']) $return .= '' . '' . ''; if (!$options['disable_md5_change']) $return .= ''; if ((file_exists ( CLASS_DIR . "pear.php" ) || file_exists ( CLASS_DIR . "tar.php" )) && !$options['disable_tar']) $return .= ''; diff --git a/templates/plugmod/images/.htaccess b/templates/plugmod/images/.htaccess index e30ae10..ad9b926 100644 --- a/templates/plugmod/images/.htaccess +++ b/templates/plugmod/images/.htaccess @@ -1,9 +1,9 @@ order deny,allow - + deny from all deny from all - \ No newline at end of file + diff --git a/templates/plugmod/images/index.html b/templates/plugmod/images/index.html deleted file mode 100644 index 365e763..0000000 --- a/templates/plugmod/images/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - -RAPIDLEECH V2.2 - - - - -
-RAPIDLEECH V2.2 -

403: RapidLeech -> Forbidden

-
-You have reached this page in error, please use -your back button to return to RapidLeech. -
- - diff --git a/templates/plugmod/main.php b/templates/plugmod/main.php index 3ec785c..83e0d8e 100644 --- a/templates/plugmod/main.php +++ b/templates/plugmod/main.php @@ -64,21 +64,15 @@ - - -
+ \n"; if (!$options['auto_upload_disable']) { -?> - - -
+ \n"; if (!$options['notes_disable']) { ?> [ .txt ] diff --git a/templates/plugmod/styles/.htaccess b/templates/plugmod/styles/.htaccess new file mode 100644 index 0000000..ad9b926 --- /dev/null +++ b/templates/plugmod/styles/.htaccess @@ -0,0 +1,9 @@ +order deny,allow + + +deny from all + + + +deny from all + diff --git a/upload.php b/upload.php index a278d39..fc11c4c 100644 --- a/upload.php +++ b/upload.php @@ -1,24 +1,11 @@ "; - echo ($download_link ? '
'.lang(68).':
'.lang(69).':
'.lang(70).':
'.lang(71).':
'.lang(72).':
'.lang(73).':
'.lang(74).':
Protect link:
'.lang(68).':
'.lang(69).':
'.lang(70).':
'.lang(71).':
'.lang(72).':
'.lang(73).':
'.lang(74).':
Protect link:
\n"; if(!file_exists(trim($lfile).".upload.html") && !isset($_GET['auul']) && !$options['upload_html_disable']) @@ -227,13 +216,13 @@ if (!$options['upload_html_disable']) { $html_content = '
'.$_REQUEST['uploaded'].' - '.date("Y-m-d H:i:s").'
'; write_file(trim($lfile).".upload.html", $html_content, 0); } @@ -247,17 +236,17 @@ if (isset($_GET['auul'])) { ?>