Advertisement
Th3-822

[rapidleech][u] shared.com_member.php

Mar 9th, 2014
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.73 KB | None | 0 0
  1. <?php
  2. ######## Account Info ########
  3. $upload_acc['shared_com']['user'] = ''; //Set your login
  4. $upload_acc['shared_com']['pass'] = ''; //Set your password
  5. ########################
  6.  
  7. $_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
  8. $not_done = true;
  9.  
  10. if ($upload_acc['shared_com']['user'] && $upload_acc['shared_com']['pass']) {
  11.     $default_acc = true;
  12.     $_REQUEST['up_login'] = $upload_acc['shared_com']['user'];
  13.     $_REQUEST['up_pass'] = $upload_acc['shared_com']['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;Login*</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 = 'shared.com';
  30.     $referer = "https://$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();
  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.  
  43.         $page = geturl($domain, 80, '/login', $referer.'login', $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
  44.         $cookie = GetCookiesArr($page, $cookie);
  45.  
  46.         $post = array();
  47.         $post['utf8'] = urlencode(html_entity_decode(cut_str($page, 'name="utf8" type="hidden" value="', '"'), ENT_QUOTES, 'UTF-8'));
  48.         $post['authenticity_token'] = cut_str($page, 'name="authenticity_token" type="hidden" value="', '"');
  49.         if (empty($post['authenticity_token'])) html_error('CSRF token not found.');
  50.         $post['user%5Bemail%5D'] = urlencode($_REQUEST['up_login']);
  51.         $post['user%5Bpassword%5D'] = urlencode($_REQUEST['up_pass']);
  52.         $post['submit'] = 'Log+In';
  53.  
  54.         $page = geturl($domain, 80, '/login', $referer.'login', $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
  55.         $cookie = GetCookiesArr($page, $cookie);
  56.  
  57.         is_present($page, 'Login incorrect', 'Login Failed: Email/Password incorrect.');
  58.         if (!preg_match('@\nLocation: (?:https?://shared.com)?/u/([^\r\n]+)@i', $page, $uname)) html_error('Login Error: Login redirect not found.');
  59.         $login = true;
  60.     } else html_error('Login failed: User/Password empty.');
  61.  
  62.     // Retrive upload ID
  63.     echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";
  64.  
  65.     $page = geturl($domain, 80, '/u/'.$uname[1], $referer.'login', $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
  66.     $cookie = GetCookiesArr($page, $cookie);
  67.  
  68.     if (!preg_match('@action="((https?://(?:\w+\.)*shared\.com)?(/)?[^\s\'\"<>]+)"\s+class="no-files-selected"@i', $page, $up)) html_error('Error: Upload url not found.');
  69.  
  70.     $csrf = trim(cut_str($page, 'name="authenticity_token" type="hidden" value="', '"'));
  71.     if (empty($csrf)) html_error('Error: Upload CSRF token not found.');
  72.  
  73.     $post = array();
  74.     $post['status'] = '1';
  75.  
  76.     $ref = $referer.'u/'.$uname[1]."\r\nX-CSRF-Token: $csrf";
  77.  
  78.     $up_url = (empty($up[2]) ? "http://$domain".(empty($up[3]) ? '/' : '').$up[1] : $up[1]);
  79.  
  80.     // Uploading
  81.     echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
  82.  
  83.     $url = parse_url($up_url);
  84.     $upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $ref, $cookie, $post, $lfile, $lname, 'files[]', '', 0, 0, 0, $url['scheme']);
  85.  
  86.     // Upload Finished
  87.     echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
  88.  
  89.     is_page($upfiles);
  90.  
  91.     if (!preg_match('@"slug"\s*:\s*"([^"]+)",@i', $upfiles, $lnk)) html_error('Download link not found.', 0);
  92.     $download_link = 'http://shared.com/'.$lnk[1];
  93. }
  94.  
  95. //[09-3-2014]  Written by Th3-822.
  96. //[15-3-2014]  Fixed login redirect. - Th3-822
  97. //[26-5-2014]  Removed https, site is forcing http connections now. - Th3-822
  98.  
  99. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement