Advertisement
Th3-822

[rapidleech][u] uptobox.com

Aug 6th, 2015
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.77 KB | None | 0 0
  1. <?php
  2.  
  3. if (!defined('RAPIDLEECH')) exit;
  4. $_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)
  5.  
  6. /* # Plugin's Settings # */
  7. $_T8['domain'] = 'uptobox.com'; // May require the www. (Check first if the site adds the www.).
  8. $_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
  9. $_T8['anonUploadLimit'] = 1024; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)
  10.  
  11. // Advanced Settings (Don't edit it unless you know what are you doing)
  12.     $_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
  13.     $_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
  14.     $_T8['path'] = '/'; // URL path to XFS script, default: '/'
  15.     $_T8['sslLogin'] = false; // Force https on login.
  16.     $_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
  17.     $_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)
  18.     $_T8['fw_sendLogin'] = 'SendLogin'; // Callable function
  19.  
  20. $acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)
  21.  
  22. /* # Account Info # */
  23. $upload_acc[$acc_key_name]['user'] = ''; //Set your login
  24. $upload_acc[$acc_key_name]['pass'] = ''; //Set your password
  25.  
  26. function SendLogin($post) {
  27.     global $_T8, $cookie, $pauth;
  28.     $page = geturl('login.uptobox.com', 443, '/logarithme', 'https://login.uptobox.com/', $cookie, $post, 0, 0, 0, 0, 'https'); // geturl doesn't support https proxy
  29.     is_page($page);
  30.     is_present($page, 'You are trying to log in from a different country', 'Login Failed: Login Blocked By IP, Check Account Email And Follow The Steps To Add IP to Whitelist.');
  31.     return $page;
  32. }
  33.  
  34. //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://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
  35. //require(HOST_DIR . 'upload/GenericXFSHost.inc.php');
  36.  
  37. // Quick and dirty modified GenericXFSHost for quick upload fix:
  38. /* # Default Settings # */
  39. $default = array();
  40. $default['port'] = 80; // Server's port, default: 80 | 443 = https.
  41. $default['path'] = '/'; // URL path to XFS script, default: '/'
  42. $default['xfsFree'] = false; // Change to true if the host is using XFS free.
  43. $default['sslLogin'] = false; // Force https on login.
  44. $default['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
  45. $default['anonUploadDisable'] = false; // Disallow non registered users upload. (XFS Pro)
  46. $default['anonUploadLimit'] = 0; // File-size limit for non registered users (MB) - 0 = Plugin's limit | (XFS Pro)
  47. $default['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)
  48.  
  49. $_T8 = array_merge($default, array_filter($_T8)); // Merge default settings with loader's settings
  50.  
  51. $_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
  52. $pauth = !empty($pauth) ? $pauth : false;
  53. $not_done = true;
  54.  
  55. if (!$_T8['xfsFree'] && !empty($upload_acc[$acc_key_name]['user']) && !empty($upload_acc[$acc_key_name]['pass'])) {
  56.     $_REQUEST['up_login'] = $upload_acc[$acc_key_name]['user'];
  57.     $_REQUEST['up_pass'] = $upload_acc[$acc_key_name]['pass'];
  58.     $_REQUEST['action'] = 'FORM';
  59.     echo "<b><center>Using Default Login.</center></b>\n";
  60. }
  61.  
  62. if (!$_T8['xfsFree'] && (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM')) {
  63.     echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='FORM' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
  64.     echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
  65.     echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".$page_upload[$_REQUEST['uploaded']]."</b></small></td></tr>\n";
  66.     echo "</form>\n</table>\n";
  67. } else {
  68.     $not_done = false;
  69.     if (substr($_T8['path'], 0, 1) != '/') $_T8['path'] = '/'.$_T8['path'];
  70.     if (substr($_T8['path'], -1) != '/') $_T8['path'] .= '/';
  71.     $_T8['port'] = (!empty($_T8['port']) && $_T8['port'] > 0 && $_T8['port'] < 65536) ? (int)$_T8['port'] : 80;
  72.     $scheme = ($_T8['port'] == 443) ? 'https' : 'http';
  73.     $referer = $scheme.'://'.$_T8['domain'].$_T8['path'];
  74.  
  75.     // Login
  76.     echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to ".str_ireplace('www.', '', $_T8['domain'])."</div>\n";
  77.  
  78.     $cookie = (!empty($cookie)) ? (is_array($cookie) ? $cookie : StrToCookies($cookie)) : array();
  79.     $cookie['lang'] = 'english';
  80.     if ($_T8['xfsFree']) $login = false;
  81.     elseif (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
  82.         $post = array();
  83.         $post['op'] = 'login';
  84.         $post['redirect'] = '';
  85.         $post['login'] = urlencode($_REQUEST['up_login']);
  86.         $post['password'] = urlencode($_REQUEST['up_pass']);
  87.  
  88.         if (empty($_T8['fw_sendLogin']) || !is_callable($_T8['fw_sendLogin'])) {
  89.             $page = geturl($_T8['domain'], $_T8['port'], $_T8['path'].'?op=login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, ($_T8['sslLogin'] ? 'https' : $scheme));is_page($page);
  90.         } else $page = call_user_func($_T8['fw_sendLogin'], $post);
  91.         $header = substr($page, 0, strpos($page, "\r\n\r\n"));
  92.         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']}'.");
  93.         if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.');
  94.         is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.');
  95.         is_present($page, 'Please%20enter%20your%20e-mail', "Login failed: Missing account's email, login at site and set the email.");
  96.         $cookie = GetCookiesArr($header, $cookie);
  97.         if (empty($cookie['xfss']) && empty($cookie['login'])) html_error('Error: Login cookies not found.');
  98.         $cookie['lang'] = 'english';
  99.         $login = true;
  100.     } else {
  101.         if ($_T8['anonUploadDisable']) html_error('Login failed: User/Password empty.');
  102.         echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
  103.         if ($_T8['anonUploadLimit'] > 0 && $fsize > $_T8['anonUploadLimit']*1024*1024) html_error('File is too big for anon upload');
  104.         $login = false;
  105.     }
  106.  
  107.     // Retrive upload ID
  108.     echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
  109.  
  110.     $page = geturl($_T8['domain'], $_T8['port'], $_T8['path'].'?op='.(empty($_T8['opUploadName']) ? 'upload' : $_T8['opUploadName']), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
  111.     if (substr($page, 9, 3) != '200') {
  112.         $page = geturl($_T8['domain'], $_T8['port'], $_T8['path'], $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
  113.     }
  114.     $header = substr($page, 0, strpos($page, "\r\n\r\n"));
  115.     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']}'.");
  116.  
  117.     if (!preg_match('@action=["\'](https?://www\d+\.uptobox\.com/upload\?(?:\w+=\w+&)*sess_id=)@i', $page, $up_url)) html_error('Upload Server Not Found.');
  118.     $up_url = $up_url[1];
  119.     if ($login) $up_url .= $cookie['xfss'];
  120.  
  121.     // Uploading
  122.     echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
  123.  
  124.     $url = parse_url($up_url);
  125.     $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, $cookie, array(), $lfile, $lname,
  126.     'files[]', '', $_GET['proxy'], $pauth, 0, $url['scheme']);
  127.  
  128.     // Upload Finished
  129.     echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
  130.  
  131.     is_page($upfiles);
  132.  
  133.     if (($pos = strpos($upfiles, "\r\n\r\n")) > 0) $reply = trim(substr($upfiles, $pos + 4));
  134.     $reply = json_decode(trim($reply), true);
  135.  
  136.     if (empty($reply['files'][0]['url'])) html_error('Download Link Not Found.');
  137.     $download_link = $reply['files'][0]['url'];
  138.     if (!empty($reply['files'][0]['deleteUrl'])) $delete_link = $reply['files'][0]['deleteUrl'];
  139. }
  140.  
  141. // Written by Th3-822
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement