Advertisement
Th3-822

[rapidleech][u] letitbit.net_member.php

Feb 15th, 2012
9,958
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.23 KB | None | 0 0
  1. <?php
  2. ####### Account Info. ###########
  3. $upload_acc['letitbit_net']['user'] = ''; //Set your email
  4. $upload_acc['letitbit_net']['pass'] = ''; //Set your password
  5. ##############################
  6.  
  7. $_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
  8. $not_done = true;
  9.  
  10. if ($upload_acc['letitbit_net']['user'] && $upload_acc['letitbit_net']['pass']) {
  11.     $default_acc = true;
  12.     $_REQUEST['up_login'] = $upload_acc['letitbit_net']['user'];
  13.     $_REQUEST['up_pass'] = $upload_acc['letitbit_net']['pass'];
  14.     $_REQUEST['action'] = 'FORM';
  15.     echo "<b><center>Using Default Login.</center></b>\n";
  16. } else $default_acc = false;
  17.  
  18. if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
  19.     echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
  20.     <form method='POST'>
  21.     <input type='hidden' name='action' value='FORM' />
  22.     <tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
  23.     <tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
  24.     echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
  25.     echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
  26.     echo "</table>\n</form>\n";
  27. } else {
  28.     $login = $not_done = false;
  29.     $domain = 'letitbit.net';
  30.     $referer = "http://$domain/";
  31.  
  32.     // Login
  33.     echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";
  34.  
  35.     $cookie = array('lang' => 'en');
  36.     if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
  37.         if (!empty($_REQUEST['A_encrypted'])) {
  38.             $_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
  39.             $_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
  40.             unset($_REQUEST['A_encrypted']);
  41.         }
  42.         CookieLogin(strtolower($_REQUEST['up_login']), $_REQUEST['up_pass']);
  43.         $login = true;
  44.     } else html_error('Login failed: User/Password empty.');
  45.  
  46.     // Retrive upload ID
  47.     echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Preparing upload</div>\n";
  48.  
  49.     $page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
  50.     is_page($page);
  51.  
  52.     if (!preg_match("@\.server\s*=\s*'([^\']+)'\s*;@i",$page, $up)) html_error('Error: Cannot find upload server.', 0);
  53.     if (!($props = cut_str($page, '.props = {', '}'))) html_error('Error: Cannot find upload data.', 0);
  54.  
  55.     function rndStr($lg, $num = false){
  56.         if ($num) $str = "0123456789";
  57.         else {
  58.             $str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  59.             $str .= strtolower($str)."0123456789";
  60.         }
  61.         $str = str_split($str);
  62.         $ret = '';
  63.         for ($i = 1; $i <= $lg; $i++) $ret .= $str[array_rand($str)];
  64.         return $ret;
  65.     }
  66.  
  67.     $UID = strtoupper(base_convert(time().rndStr(3, true),10,16)).'_'.rndStr(40);
  68.  
  69.     $post = array();
  70.     //$post['MAX_FILE_SIZE'] = cut_str($page, 'name="MAX_FILE_SIZE" value="', '"');
  71.     $post['owner'] = cut_str($props, "username:'", "'");
  72.     $post['pin'] = cut_str($props, "pin:'", "'");
  73.     $post['base'] = cut_str($props, "base:'", "'");
  74.     $post['host'] = cut_str($props, "host:'", "'");
  75.     $post['source'] = cut_str($props, "source:'", "'");
  76.  
  77.     $up_url = "http://{$up[1]}/marker=$UID";
  78.     // Uploading
  79.     echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
  80.  
  81.     $url = parse_url($up_url);
  82.     $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'file0', '', $_GET['proxy'], $pauth);
  83.  
  84.     // Upload Finished
  85.     echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
  86.  
  87.     is_page($upfiles);
  88.  
  89.     if (preg_match('@"uids"\s*:\s*\["([\w\.\-]+)"\]@i', $upfiles, $uid)) {
  90.         $download_link = 'http://letitbit.net/download/'.$uid[1].'/'.str_replace(array(' ', '?'), '_', $lname).'.html';
  91.     } else {
  92.         html_error("Error: Download link not found.", 0);
  93.     }
  94. }
  95.  
  96. function Login($user, $pass) {
  97.     global $cookie, $domain, $referer, $pauth, $default_acc;
  98.     $post = array();
  99.     $post['act'] = 'login';
  100.     $post['login'] = urlencode($user);
  101.     $post['password'] = urlencode($pass);
  102.  
  103.     $page = geturl($domain, 80, '/ajax/auth.php', $referer, 'lang=en', $post, 0, $_GET['proxy'], $pauth);is_page($page);
  104.     is_present($page, 'Authorization data is invalid', 'Login failed: User/Password incorrect.');
  105.     is_notpresent($page, 'Set-Cookie: log=', 'Login failed: Cannot find login cookie.');
  106.     is_notpresent($page, 'Set-Cookie: pas=', 'Login failed: Cannot find paswword cookie.');
  107.     $cookie = GetCookiesArr($page);
  108.     $cookie['lang'] = 'en';
  109.  
  110.     SaveCookies($user, $pass);
  111.     return true;
  112. }
  113.  
  114. function IWillNameItLater($cookie, $decrypt=true) {
  115.     if (!is_array($cookie)) {
  116.         if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
  117.         return '';
  118.     }
  119.     if (count($cookie) < 1) return $cookie;
  120.     $keys = array_keys($cookie);
  121.     $values = array_values($cookie);
  122.     $keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
  123.     $values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
  124.     return array_combine($keys, $values);
  125. }
  126.  
  127. function CookieLogin($user, $pass) {
  128.     global $domain, $referer, $secretkey, $pauth;
  129.     if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
  130.     $user = strtolower($user);
  131.  
  132.     $filename = 'letitbit_ul.php';
  133.     if (!defined('DOWNLOAD_DIR')) {
  134.         if (substr($GLOBALS['options']['download_dir'], -1) != '/') $GLOBALS['options']['download_dir'] .= '/';
  135.         define('DOWNLOAD_DIR', (substr($GLOBALS['options']['download_dir'], 0, 6) == 'ftp://' ? '' : $GLOBALS['options']['download_dir']));
  136.     }
  137.     $filename = DOWNLOAD_DIR.basename($filename);
  138.     if (!file_exists($filename)) return Login($user, $pass);
  139.  
  140.     $file = file($filename);
  141.     $savedcookies = unserialize($file[1]);
  142.     unset($file);
  143.  
  144.     $hash = hash('crc32b', $user.':'.$pass);
  145.     if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
  146.         $_secretkey = $secretkey;
  147.         $secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
  148.         $testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? IWillNameItLater($savedcookies[$hash]['cookie']) : false;
  149.         $secretkey = $_secretkey;
  150.         if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return Login($user, $pass);
  151.  
  152.         $page = geturl($domain, 80, '/', $referer, $testCookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
  153.         if (stripos($page, 'title="Logout">Logout</a>') === false) return Login($user, $pass);
  154.         $GLOBALS['cookie'] = GetCookiesArr($page, $testCookie); // Update cookies
  155.         SaveCookies($user, $pass); // Update cookies file
  156.         return true;
  157.     }
  158.     return Login($user, $pass);
  159. }
  160.  
  161. function SaveCookies($user, $pass) {
  162.     global $secretkey;
  163.     $maxdays = 31; // Max days to keep cookies saved
  164.  
  165.     $filename = 'letitbit_ul.php';
  166.     $filename = DOWNLOAD_DIR.basename($filename);
  167.     if (file_exists($filename)) {
  168.         $file = file($filename);
  169.         $savedcookies = unserialize($file[1]);
  170.         unset($file);
  171.  
  172.         // Remove old cookies
  173.         foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 86400)) unset($savedcookies[$k]);
  174.     } else $savedcookies = array();
  175.     $hash = hash('crc32b', $user.':'.$pass);
  176.     $_secretkey = $secretkey;
  177.     $secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
  178.     $savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => IWillNameItLater($GLOBALS['cookie'], false));
  179.     $secretkey = $_secretkey;
  180.  
  181.     write_file($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies));
  182. }
  183.  
  184. //[01-1-2012] Written by Th3-822. // Happy New Year!
  185. //[16-2-2012] Added functions for save encrypted cookies in a file (Works with more than 1 login) and for keep the cookies saved for 3 days since the last login (can be changed). - Th3-822
  186. //[09-10-2014] Updated & Fixed upload. - Th3-822
  187.  
  188. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement