Ejemplo n.º 1
0
function extra_page()
{
    info_disabled_check();
    heading();
    $sys = get_sysinfo();
    $ini_loader = scan_inis_for_loader();
    $ini_loader_path = $ini_loader['location'];
    $loader_path = find_loader(true);
    $ldinf = get_loaderinfo();
    $self = get_self();
    echo "<h4>Additional Information</h4>";
    echo "<table>";
    $lines = array();
    if (is_string($loader_path)) {
        $lines['Loader is at'] = $loader_path;
        $loader_system = loader_system($loader_path);
        if (!empty($loader_system)) {
            $lines['Loader OS code'] = $loader_system['oscode'];
            $lines['Loader architecture'] = $loader_system['arch'];
            $lines['Loader word size'] = $loader_system['wordsize'];
            $lines['Loader PHP version'] = $loader_system['php_version'];
            $lines['Loader thread safety'] = $loader_system['thread_safe'] ? 'Yes' : 'No';
            $lines['Loader compiler'] = $loader_system['compiler'];
            $lines['Loader version'] = $loader_system['loader_version'];
            $lines['File size is'] = filesize($loader_path) . " bytes.";
            $lines['MD5 sum is'] = md5_file($loader_path);
        }
        $lines['Loader file'] = "<a href=\"{$self}?page=loaderbin\">Download loader file</a>";
    } else {
        $lines['Loader file'] = "Loader cannot be found.";
    }
    $lines['Loader found in ini file'] = empty($ini_loader_path) ? "No" : "Yes";
    if (!empty($ini_loader_path) && (!is_string($loader_path) || $ini_loader_path != $loader_path)) {
        $lines['Loader location found in ini file'] = $ini_loader_path;
        $loader_system = loader_system($ini_loader_path);
        if (!empty($loader_system)) {
            $lines['Ini Loader OS code'] = $loader_system['oscode'];
            $lines['Ini Loader architecture'] = $loader_system['arch'];
            $lines['Ini Loader word size'] = $loader_system['wordsize'];
            $lines['Ini Loader PHP version'] = $loader_system['php_version'];
            $lines['Ini Loader thread safety'] = $loader_system['thread_safe'] ? 'Yes' : 'No';
            $lines['Ini Loader compiler'] = $loader_system['compiler'];
            $lines['Ini Loader version'] = $loader_system['loader_version'];
        }
    }
    $lines["OS extra security"] = selinux_is_enabled() || possibly_selinux() ? "SELinux" : (grsecurity_is_enabled() ? "Grsecurity" : "None");
    $lines['PHPRC is'] = $sys['PHPRC'];
    $lines['INI DIR is'] = $sys['PHP_INI_DIR'];
    $lines['Additional INI files'] = $sys['PHP_INI_ADDITIONAL'];
    $stype = get_request_parameter('stype');
    $server_type = find_server_type($stype);
    $lines['Server type is'] = server_type_string();
    $lines["PHP uname"] = $ldinf['uname'];
    $lines['Server word size is'] = $ldinf['wordsize'];
    $lines['Disabled functions'] = ini_get('disable_functions');
    $writeable_dirs = writeable_directories();
    $lines['Writeable loader locations'] = empty($writeable_dirs) ? "<em>None</em>" : join(", ", $writeable_dirs);
    if (!empty($_SESSION['hostprovider'])) {
        $lines['Hosting provider'] = $_SESSION['hostprovider'];
        $lines['Provider URL'] = $_SESSION['hosturl'];
    }
    foreach ($lines as $h => $i) {
        $v = empty($i) ? '<em>EMPTY</em>' : $i;
        echo '<tr><th>' . $h . ':</th>' . '<td>' . $v . '</td></tr>';
    }
    echo "</table>";
    footer(true);
}
Ejemplo n.º 2
0
function phpini_page()
{
    if (empty($loader_dir)) {
        $loader_dir = get_default_loader_dir();
    }
    $loader_name = get_loader_name();
    $loader_loc = $loader_dir . "/" . $loader_name;
    $loader_loc = get_loader_location(get_request_parameter('ldpath'));
    header('Content-Type: text/plain');
    header('Content-Disposition: attachment; filename=' . ini_file_name());
    echo php_ini_contents($loader_loc);
}
Ejemplo n.º 3
0
function phpconfig_page()
{
    $sys = get_sysinfo();
    if (isset($sys['PHP_INI']) && file_exists($sys['PHP_INI'])) {
        $download = get_request_parameter('download');
        if (!empty($download)) {
            $ini_file_name = ini_file_name();
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename=' . $ini_file_name);
        } else {
            header('Content-Type: text/plain');
        }
        $prepend = get_request_parameter('prepend');
        if (!empty($prepend)) {
            $server_type = find_server_type();
            $loader_dir = loader_install_dir($server_type);
            $zend_lines = zend_extension_lines($loader_dir);
            echo join(PHP_EOL,$zend_lines);
            echo PHP_EOL;
        }
        @readfile($sys['PHP_INI']);
    } else {
        echo "php.ini file could not be read.";
    }
}