Advertisement
Titeuf

[Rapidleech][UP] Ifile_ws.php

Nov 28th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.42 KB | None | 0 0
  1. <?php
  2. ####### Plugin's Settings #######
  3. $domain = 'www.ifile.ws'; // May require the www. (Check first if the site adds the www.)
  4. $IsXfsFree = false; // Change to true if the host is using XFS free.
  5. $_path = '/'; // URL path to XFS script, default: '/'
  6. $acc_key_name = 'ifile_ws';// (XFS Pro)
  7. $anonupload = false; // Allow non registered users upload. | (XFS Pro)
  8. $anonlimit = 100; // Filesize limit for non registered users (MB) - 0 = Plugin's limit | (XFS Pro)
  9. ########################
  10.  
  11. ######## Account Info ########
  12. $upload_acc[$acc_key_name]['user'] = 'your login'; //Set your login
  13. $upload_acc[$acc_key_name]['pass'] = 'your password'; //Set your password
  14. ########################
  15.  
  16. $_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
  17. $not_done = true;
  18.  
  19. if (!$IsXfsFree && !empty($upload_acc[$acc_key_name]['user']) && !empty($upload_acc[$acc_key_name]['pass'])) {
  20. $_REQUEST['up_login'] = $upload_acc[$acc_key_name]['user'];
  21. $_REQUEST['up_pass'] = $upload_acc[$acc_key_name]['pass'];
  22. $_REQUEST['action'] = 'FORM';
  23. echo "<b><center>Using Default Login Ifile.ws.</center></b>\n";
  24. }
  25.  
  26. if (!$IsXfsFree && (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM')) {
  27. echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
  28. <form method='POST'>
  29. <input type='hidden' name='action' value='FORM' />
  30. <tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
  31. <tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
  32. echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
  33. echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
  34. echo "</table>\n</form>\n";
  35. } else {
  36. $not_done = false;
  37. if (substr($_path, 0, 1) != '/') $_path = '/'.$_path;
  38. if (substr($_path, -1) != '/') $_path .= '/';
  39. $referer = "http://$domain$_path";
  40.  
  41. // Login
  42. echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to ".str_replace('www.', '', $domain)."</div>\n";
  43.  
  44. $cookie = array('lang' => 'english');
  45. if (!$IsXfsFree && !empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
  46. $post = array();
  47. $post['op'] = 'login';
  48. $post['redirect'] = '';
  49. $post['login'] = $_REQUEST['up_login'];
  50. $post['password'] = $_REQUEST['up_pass'];
  51.  
  52. $page = geturl($domain, 80, $_path.'?op=login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
  53. $header = substr($page, 0, strpos($page, "\r\n\r\n"));
  54. if (stripos($header, "\nLocation: ") !== false && preg_match('@\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'.");
  55. if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.');
  56. is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.');
  57. is_notpresent($header, 'Set-Cookie: xfss=', 'Error: Cannot find session cookie.');
  58. $cookie = GetCookiesArr($header);
  59. $cookie['lang'] = 'english';
  60. $login = true;
  61. } elseif ($IsXfsFree) $login = false;
  62. else {
  63. if (!$anonupload) html_error('Login failed: User/Password empty.');
  64. echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
  65. if ($anonlimit > 0 && $fsize > $anonlimit*1024*1024) html_error('File is too big for anon upload');
  66. $login = false;
  67. }
  68.  
  69. // Retrive upload ID
  70. 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";
  71.  
  72. $page = geturl($domain, 80, $_path.'?op=upload', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
  73. if (substr($page, 9, 3) != '200') {
  74. $page = geturl($domain, 80, $_path, $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
  75. }
  76. if (!$login) {
  77. $header = substr($page, 0, strpos($page, "\r\n\r\n"));
  78. if (stripos($header, "\nLocation: ") !== false && preg_match('@\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'.");
  79. }
  80. if (!preg_match('@action="((https?://[^/\"]+)?/[^\?\"]+upload\.cgi)\?@i',$page, $up)) html_error('Error: Cannot find upload server.', 0);
  81. $up[1] = (empty($up[2])) ? "http://$domain".$up[1] : $up[1];
  82.  
  83. $uid = '';for ($i = 0; $i < 12; $i++) $uid .= rand(0,9);
  84.  
  85. $post = array();
  86. $post['upload_type'] = 'file';
  87. $post['sess_id'] = cut_str($page, 'name="sess_id" value="', '"');
  88. $post['srv_tmp_url'] = cut_str($page, 'name="srv_tmp_url" value="', '"');
  89. $post['link_rcpt'] = '';
  90. $post['link_pass'] = '';
  91. $post['file_0_descr'] = 'Uploaded by Rapidleech Upload Plugin created by Titeuf.';
  92. $post['tos'] = 1;
  93. $post['submit_btn'] = ' Upload! ';
  94.  
  95. $up_url = $up[1]."?upload_id=$uid&js_on=1";
  96. if (!$IsXfsFree) $up_url .= '&utype='.cut_str($page, "var utype='", "'").'&upload_type=file';
  97.  
  98. // Uploading
  99. echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
  100.  
  101. $url = parse_url($up_url);
  102. $upfiles = upfile($url['host'], 80, $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'file_0', '', $_GET['proxy'], $pauth);
  103.  
  104. // Upload Finished
  105. echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
  106.  
  107. is_page($upfiles);
  108.  
  109. if (!$IsXfsFree) {
  110. $post = array();
  111. $post['op'] = 'upload_result';
  112. if (!preg_match('@name=[\'\"]fn[\'\"](?:(?:[\s\t]*>)|(?:[\s\t]*value=[\'\"]))([^\'\"<>]+)@i', $upfiles, $fn)) html_error('Error: fn value not found.');
  113. $post['fn'] = trim($fn[1]);
  114. $post['st'] = 'OK';
  115. } else {
  116. $page = cut_str($upfiles, '<Form name=\'F1\'', '</Form>');
  117. if (!preg_match_all('@<textarea [^<>]*name=\'([^\']+)\'[^<>]*>([^>]*)</textarea>@i', $page, $textareas)) html_error('upload_result data not found.');
  118. $post = array_map('urlencode', array_map('html_entity_decode', array_combine($textareas[1], $textareas[2])));
  119. }
  120.  
  121. $page = geturl($domain, 80, $_path, $up_url, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
  122. $half_rexexp = '@(https?://(?:www\.)?'.preg_quote(str_replace(array('www.'), array(''), $domain).$_path, '@');
  123.  
  124. if (preg_match($half_rexexp.'\w{12}(?:/[^\?/<>\"\'\r\n]+)?(?:\.html?)?)\?killcode=\w+@i', $page, $lnk)) {
  125. $download_link = $lnk[1];
  126. $delete_link = $lnk[0];
  127. } elseif (preg_match($half_rexexp.'del-(\w{12})-\w+/([^<>\"\'\r\n]+)@i', $page, $lnk)) { // Fixed line :D
  128. $download_link = substr($lnk[0], 0, (stripos($lnk[0], '/del-') + 1)) . $lnk[1] . '/' . $lnk[2];
  129. $delete_link = $lnk[0];
  130. } else html_error('Download link not found.', 0);
  131. }
  132.  
  133. //===================== You want more Plugin? So respect the copyright, thanks! =================================
  134. // Based on the code of Th3-822, thank you my friend!
  135. // Ifile.ws Upload Plugin created by Titeuf
  136. // Instructions :
  137. // Put your login and password to the line 12 & 13 and save
  138. // Edit the file and change the size ifile.ws.php max files
  139. // Upload these files hots / upload to your ftp
  140. //===============================================================================================================
  141.  
  142. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement