☢️ NUKEIT.SITE

THE NUCLEAR OPTION - PUBLIC ARSENAL

⚠️ WARNING: THIS TOOL CAN PERMANENTLY DELETE DATA. FOR DEVELOPMENT USE ONLY ⚠️

📥 DOWNLOAD THE ARSENAL

This is a single-file PHP tool that gives you a web-based interface to clear caches, logs, and even your entire database. Everything is self-contained.

GET THE TOOL

⬇ DOWNLOAD NUKEIT.PHP

Right-click and "Save link as..." if download doesn't start

📋 Code Preview (Copy & Paste)

<?php
/**
 * NUKEIT.SITE - The Nuclear Option
 * A single-file development environment reset tool
 * 
 * VERSION: 1.0.0
 * LICENSE: MIT
 * 
 * ⚠️ WARNING: THIS TOOL CAN DELETE DATA PERMANENTLY ⚠️
 * ONLY USE IN DEVELOPMENT/STAGING ENVIRONMENTS
 * NEVER DEPLOY TO PRODUCTION WITHOUT PROTECTION
 */

// ==================== DETERMINE MODE ====================
// If any tool action is requested, run the tool. Otherwise, show distribution page.
if (isset($_GET['action']) || $_SERVER['REQUEST_METHOD'] === 'POST') {
    
    // ==================== TOOL CONFIGURATION ====================
    define('NUKEIT_PASSWORD', 'CHANGE_THIS_TO_A_SECURE_PASSWORD'); // CHANGE IMMEDIATELY!
    define('NUKEIT_SESSION_NAME', 'NUKEIT_SESSION');
    define('NUKEIT_VERSION', '1.0.0');

    // Database config (optional - leave empty to disable DB nuke)
    define('DB_HOST', 'localhost');
    define('DB_NAME', '');
    define('DB_USER', '');
    define('DB_PASS', '');

    // Target directories for nuking
    $nukeDirectories = [
        'cache' => __DIR__ . '/cache',
        'logs' => __DIR__ . '/logs',
        'temp' => sys_get_temp_dir() . '/nukeit'
    ];

    // ==================== SECURITY & CORE ====================
    session_name(NUKEIT_SESSION_NAME);
    session_start();

    function generateCSRFToken() {
        if (empty($_SESSION['csrf_token'])) {
            $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
        }
        return $_SESSION['csrf_token'];
    }

    function validateCSRFToken($token) {
        return hash_equals($_SESSION['csrf_token'] ?? '', $token);
    }

    function isAuthenticated() {
        return $_SESSION['authenticated'] ?? false;
    }

    function requireAuth() {
        if (!isAuthenticated()) {
            header('Location: ?action=login');
            exit;
        }
    }

    function authenticate($password) {
        return $password === NUKEIT_PASSWORD;
    }

    function logAction($action, $details = '') {
        $logFile = __DIR__ . '/nukeit-audit.log';
        $timestamp = date('Y-m-d H:i:s');
        $ip = $_SERVER['REMOTE_ADDR'];
        $user = $_SESSION['user'] ?? 'unknown';
        $entry = "[$timestamp] [$ip] [$user] ACTION: $action | $details" . PHP_EOL;
        @file_put_contents($logFile, $entry, FILE_APPEND | LOCK_EX);
    }

    // ==================== NUKE FUNCTIONS ====================
    function clearOpcache() {
        if (function_exists('opcache_reset')) {
            opcache_reset();
            return ['success' => true, 'message' => 'OPcache reset successful.'];
        }
        return ['success' => false, 'message' => 'OPcache unavailable.'];
    }

    function clearDirectory($path, $pattern = '*') {
        if (!is_dir($path)) {
            return ['success' => false, 'message' => "Directory not found: " . basename($path)];
        }
        
        $deleted = 0; $errors = 0;
        foreach (glob($path . '/' . $pattern) as $file) {
            if (is_file($file) && @unlink($file)) $deleted++;
            elseif (is_dir($file)) {
                $result = nukeDirectory($file);
                $deleted += $result['deleted']; $errors += $result['errors'];
            }
        }
        
        return [
            'success' => $errors === 0,
            'message' => "Deleted $deleted items" . ($errors ? ", $errors errors" : ""),
            'deleted' => $deleted, 'errors' => $errors
        ];
    }

    function nukeDirectory($dir) {
        if (!is_dir($dir)) return ['deleted' => 0, 'errors' => 0];
        $items = array_diff(scandir($dir), ['.', '..']);
        $deleted = 0; $errors = 0;
        
        foreach ($items as $item) {
            $path = "$dir/$item";
            if (is_dir($path)) {
                $result = nukeDirectory($path);
                $deleted += $result['deleted']; $errors += $result['errors'];
                if (@rmdir($path)) $deleted++; else $errors++;
            } else {
                if (@unlink($path)) $deleted++; else $errors++;
            }
        }
        return ['deleted' => $deleted, 'errors' => $errors];
    }

    function getDirSize($path) {
        if (!is_dir($path)) return 0;
        $size = 0;
        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $file) {
            $size += $file->getSize();
        }
        return $size;
    }

    function formatBytes($bytes) {
        $units = ['B', 'KB', 'MB', 'GB'];
        $i = floor(log($bytes, 1024));
        return round($bytes / (1024 ** $i), 2) . ' ' . $units[$i];
    }

    function getSystemInfo() {
        return [
            'php' => PHP_VERSION,
            'memory' => memory_get_usage(true),
            'disk_free' => disk_free_space(__DIR__),
            'opcache' => function_exists('opcache_get_status') ? opcache_get_status()['opcache_enabled'] : false,
            'server' => $_SERVER['SERVER_SOFTWARE'] ?? 'Unknown'
        ];
    }

    function nukeDatabase() {
        if (!DB_NAME) {
            return ['success' => false, 'message' => 'Database not configured.'];
        }
        
        try {
            $pdo = new PDO(
                "mysql:host=" . DB_HOST . ";dbname=" . DB_NAME,
                DB_USER, DB_PASS,
                [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
            );
            
            $tables = $pdo->query("SHOW TABLES")->fetchAll(PDO::FETCH_COLUMN);
            if (empty($tables)) {
                return ['success' => true, 'message' => 'Database already empty.'];
            }
            
            $pdo->exec("SET FOREIGN_KEY_CHECKS = 0");
            $dropped = 0;
            foreach ($tables as $table) {
                $pdo->exec("DROP TABLE IF EXISTS `$table`");
                $dropped++;
            }
            $pdo->exec("SET FOREIGN_KEY_CHECKS = 1");
            
            return [
                'success' => true,
                'message' => "NUCLEAR STRIKE COMPLETE! $dropped tables vaporized.",
                'tables' => $dropped
            ];
        } catch (PDOException $e) {
            return ['success' => false, 'message' => 'Strike failed: ' . $e->getMessage()];
        }
    }

    // ==================== ROUTING ====================
    $action = $_GET['action'] ?? 'dashboard';
    $message = ''; $messageType = '';

    // ==================== LOGIN ====================
    if ($action === 'login') {
        if ($_SERVER['REQUEST_METHOD'] === 'POST') {
            $pass = $_POST['password'] ?? '';
            if (authenticate($pass)) {
                $_SESSION['authenticated'] = true;
                $_SESSION['user'] = 'admin';
                logAction('LOGIN', 'Success');
                header('Location: ?action=dashboard');
                exit;
            } else {
                $message = 'ACCESS DENIED. INVALID AUTHORIZATION CODE.';
                $messageType = 'error';
                logAction('LOGIN_FAILED', $_SERVER['REMOTE_ADDR']);
            }
        }
        ?>
        <!DOCTYPE html>
        <html>
        <head>
            <title>NUKEIT.SITE - AUTHORIZE</title>
            <style>
                * { margin: 0; padding: 0; box-sizing: border-box; }
                body { background: #0a0a0a; color: #ff0000; font-family: 'Courier New', monospace; display: flex; justify-content: center; align-items: center; height: 100vh; }
                .login-container { background: #1a1a1a; border: 2px solid #ff0000; padding: 40px; box-shadow: 0 0 30px #ff0000; text-align: center; max-width: 400px; }
                h1 { font-size: 32px; margin-bottom: 20px; text-shadow: 0 0 10px #ff0000; }
                input[type="password"] { width: 100%; padding: 10px; margin: 20px 0; background: #000; border: 1px solid #ff0000; color: #fff; font-size: 16px; }
                button { width: 100%; padding: 12px; background: #ff0000; color: #000; border: none; font-weight: bold; cursor: pointer; font-size: 16px; text-transform: uppercase; }
                button:hover { background: #ff6666; }
                .error { color: #ff6666; margin-top: 15px; }
            </style>
        </head>
        <body>
            <div class="login-container">
                <h1>☢️ NUKEIT.SITE ☢️</h1>
                <p style="color: #fff; margin-bottom: 20px;">AUTHORIZATION CODE REQUIRED</p>
                <?php if ($message): ?>
                    <div class="error"><?= htmlspecialchars($message) ?></div>
                <?php endif; ?>
                <form method="POST">
                    <input type="password" name="password" placeholder="Enter Authorization Code" autofocus>
                    <button type="submit">INITIATE SEQUENCE</button>
                </form>
            </div>
        </body>
        </html>
        <?php
        exit;
    }

    // ==================== LOGOUT ====================
    if ($action === 'logout') {
        logAction('LOGOUT', 'User logged out');
        session_destroy();
        header('Location: ?action=login');
        exit;
    }

    // ==================== DASHBOARD ====================
    requireAuth();
    $csrfToken = generateCSRFToken();

    // Handle nuke actions
    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['nuke_action'])) {
        if (!validateCSRFToken($_POST['csrf_token'] ?? '')) {
            $message = 'CSRF ATTACK DETECTED. SEQUENCE ABORTED.';
            $messageType = 'error';
            logAction('CSRF_ATTACK', 'Invalid token');
        } else {
            $nukeAction = $_POST['nuke_action'];
            $result = null;
            
            switch ($nukeAction) {
                case 'opcache': $result = clearOpcache(); break;
                case 'cache': $result = clearDirectory($nukeDirectories['cache']); break;
                case 'logs': $result = clearDirectory($nukeDirectories['logs']); break;
                case 'temp': $result = clearDirectory($nukeDirectories['temp']); break;
                case 'database':
                    if ($_POST['confirm'] === 'YES-NUKE-DB') {
                        $result = nukeDatabase();
                    } else {
                        $result = ['success' => false, 'message' => 'Confirmation phrase incorrect.'];
                    }
                    break;
            }
            
            if ($result) {
                $message = $result['message'];
                $messageType = $result['success'] ? 'success' : 'error';
                logAction($nukeAction, $message);
            }
        }
    }

    $systemInfo = getSystemInfo();
    $dirInfo = [];
    foreach ($nukeDirectories as $key => $path) {
        $dirInfo[$key] = ['path' => $path, 'exists' => is_dir($path), 'size' => is_dir($path) ? getDirSize($path) : 0];
    }
    ?>
    <!DOCTYPE html>
    <html>
    <head>
        <title>NUKEIT.SITE - Control Panel</title>
        <style>
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }

            body {
                font-family: 'Courier New', monospace;
                background-color: #0a0a0a;
                color: #e0e0e0;
                line-height: 1.7;
                font-size: 15px;
                overflow-x: hidden;
            }

            .container {
                max-width: 1200px;
                margin: 0 auto;
                padding: 20px;
            }

            header {
                background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
                border-bottom: 3px solid #ff0000;
                padding: 20px 0;
                margin-bottom: 30px;
            }

            h1 {
                color: #ff0000;
                text-shadow: 0 0 15px #ff0000;
                font-size: 36px;
                text-align: center;
            }

            .subtitle {
                text-align: center;
                color: #ff6666;
                margin-top: 10px;
            }

            .nav {
                text-align: right;
                margin-top: -40px;
                margin-right: 20px;
            }

            .nav a {
                color: #ff0000;
                text-decoration: none;
                margin-left: 20px;
            }

            .grid {
                display: grid;
                grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
                gap: 20px;
                margin-top: 30px;
            }

            .card {
                background: #1a1a1a;
                border: 1px solid #333;
                padding: 20px;
                border-radius: 5px;
                transition: all 0.3s;
            }

            .card:hover {
                border-color: #ff0000;
                box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
            }

            .card h3 {
                color: #ff0000;
                margin-bottom: 15px;
                font-size: 20px;
            }

            .card p {
                color: #aaa;
                margin-bottom: 15px;
                font-size: 14px;
            }

            .info-box {
                background: #000;
                padding: 10px;
                margin: 10px 0;
                border-left: 3px solid #ff0000;
                font-size: 12px;
            }

            button {
                background: #ff0000;
                color: #000;
                border: none;
                padding: 12px 20px;
                font-weight: bold;
                cursor: pointer;
                text-transform: uppercase;
                width: 100%;
                margin-top: 10px;
                transition: all 0.3s;
            }

            button:hover {
                background: #ff6666;
                box-shadow: 0 0 10px #ff0000;
            }

            button.danger {
                background: #ff0000;
            }

            input[type="text"] {
                width: 100%;
                padding: 8px;
                margin-top: 10px;
                background: #000;
                border: 1px solid #333;
                color: #fff;
            }

            .message {
                padding: 15px;
                margin: 20px 0;
                border-radius: 5px;
            }

            .message.success {
                background: #003300;
                border: 1px solid #00ff00;
                color: #00ff00;
            }

            .message.error {
                background: #330000;
                border: 1px solid #ff0000;
                color: #ff0000;
            }

            .system-info {
                background: #0a0a0a;
                border: 1px solid #333;
                padding: 15px;
                margin-bottom: 20px;
            }

            .system-info h3 {
                color: #ff0000;
                margin-bottom: 10px;
            }

            .info-row {
                display: flex;
                justify-content: space-between;
                padding: 5px 0;
                border-bottom: 1px solid #222;
            }

            .status-online {
                color: #00ff00;
            }

            .status-offline {
                color: #ff0000;
            }

            footer {
                text-align: center;
                margin-top: 50px;
                padding: 20px;
                color: #666;
                border-top: 1px solid #333;
            }
        </style>
    </head>
    <body>
        <header>
            <div class="container">
                <h1>☢️ NUKEIT.SITE</h1>
                <p class="subtitle">THE NUCLEAR OPTION - DEVELOPMENT ENVIRONMENT RESET TOOL</p>
                <div class="nav">
                    <a href="?action=dashboard">Dashboard</a>
                    <a href="?action=logout">Logout</a>
                </div>
            </div>
        </header>

        <div class="container">
            <?php if ($message): ?>
                <div class="message <?= $messageType ?>">
                    <strong>SYSTEM ALERT:</strong> <?= htmlspecialchars($message) ?>
                </div>
            <?php endif; ?>

            <div class="system-info">
                <h3>📊 BATTLE STATION STATUS</h3>
                <div class="info-row">
                    <span>PHP Version:</span>
                    <span><?= $systemInfo['php'] ?></span>
                </div>
                <div class="info-row">
                    <span>OPcache:</span>
                    <span class="<?= $systemInfo['opcache'] ? 'status-online' : 'status-offline' ?>">
                        <?= $systemInfo['opcache'] ? 'ONLINE' : 'OFFLINE' ?>
                    </span>
                </div>
                <div class="info-row">
                    <span>Memory:</span>
                    <span><?= formatBytes($systemInfo['memory']) ?></span>
                </div>
                <div class="info-row">
                    <span>Disk Free:</span>
                    <span><?= formatBytes($systemInfo['disk_free']) ?></span>
                </div>
            </div>

            <div class="grid">
                <!-- OPCACHE -->
                <div class="card">
                    <h3>☢️ NUKE OPCACHE</h3>
                    <p>Clear PHP OPcache when code changes don't reflect.</p>
                    <div class="info-box">Status: <?= $systemInfo['opcache'] ? 'Active' : 'Inactive' ?></div>
                    <form method="POST">
                        <input type="hidden" name="csrf_token" value="<?= $csrfToken ?>">
                        <button type="submit" name="nuke_action" value="opcache">EXECUTE</button>
                    </form>
                </div>

                <!-- CACHE DIR -->
                <div class="card">
                    <h3>☢️ NUKE CACHE</h3>
                    <p>Delete all files in cache directory.</p>
                    <div class="info-box">
                        Path: <?= basename($dirInfo['cache']['path']) ?><br>
                        Size: <?= formatBytes($dirInfo['cache']['size']) ?>
                    </div>
                    <form method="POST">
                        <input type="hidden" name="csrf_token" value="<?= $csrfToken ?>">
                        <button type="submit" name="nuke_action" value="cache">EXECUTE</button>
                    </form>
                </div>

                <!-- LOGS -->
                <div class="card">
                    <h3>☢️ NUKE LOGS</h3>
                    <p>Clear log files to free disk space.</p>
                    <div class="info-box">
                        Path: <?= basename($dirInfo['logs']['path']) ?><br>
                        Size: <?= formatBytes($dirInfo['logs']['size']) ?>
                    </div>
                    <form method="POST">
                        <input type="hidden" name="csrf_token" value="<?= $csrfToken ?>">
                        <button type="submit" name="nuke_action" value="logs">EXECUTE</button>
                    </form>
                </div>

                <!-- TEMP -->
                <div class="card">
                    <h3>☢️ NUKE TEMP</h3>
                    <p>Clear temporary files.</p>
                    <div class="info-box">
                        Size: <?= formatBytes($dirInfo['temp']['size']) ?>
                    </div>
                    <form method="POST">
                        <input type="hidden" name="csrf_token" value="<?= $csrfToken ?>">
                        <button type="submit" name="nuke_action" value="temp">EXECUTE</button>
                    </form>
                </div>

                <!-- DATABASE NUKE -->
                <div class="card">
                    <h3>💀 TOTAL ANNIHILATION</h3>
                    <p><strong>WARNING:</strong> Drops ALL tables in database. Irreversible.</p>
                    <div class="info-box" style="border-color: #ff0000;">
                        DB: <?= DB_NAME ?: 'Not Configured' ?>
                    </div>
                    <form method="POST">
                        <input type="hidden" name="csrf_token" value="<?= $csrfToken ?>">
                        <input type="text" name="confirm" placeholder="Type YES-NUKE-DB">
                        <button type="submit" name="nuke_action" value="database" class="danger">
                            AUTHORIZE STRIKE
                        </button>
                    </form>
                </div>
            </div>
        </div>

        <footer>
            <p>NUKEIT.SITE v<?= NUKEIT_VERSION ?> - AUTHORIZED PERSONNEL ONLY</p>
            <p>ALL ACTIONS LOGGED</p>
        </footer>
    </body>
    </html>
    <?php
    exit;
}

// ========== PUBLIC DISTRIBUTION PAGE (NO LOGIN) ==========
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NUKEIT.SITE - Public Arsenal</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Courier New', monospace;
            background-color: #0a0a0a;
            color: #e0e0e0;
            line-height: 1.7;
            font-size: 15px;
            overflow-x: hidden;
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }

        header {
            background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
            border-bottom: 3px solid #ff0000;
            padding: 40px 0;
            margin-bottom: 40px;
            box-shadow: 0 4px 15px rgba(255, 0, 0, 0.2);
        }

        h1 {
            color: #ff0000;
            text-shadow: 0 0 25px #ff0000;
            font-size: 3.5rem;
            text-align: center;
            letter-spacing: 3px;
            margin-bottom: 10px;
        }

        .subtitle {
            text-align: center;
            color: #ff6666;
            font-size: 0.95rem;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .warning-banner {
            background: #ff0000;
            color: #000;
            padding: 15px;
            text-align: center;
            font-weight: bold;
            margin-bottom: 30px;
            border: 2px solid #ff6666;
            border-radius: 5px;
            font-size: 1rem;
        }

        .section {
            background: #1a1a1a;
            border: 1px solid #2a2a2a;
            padding: 30px;
            margin-bottom: 30px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        }

        .section h2 {
            color: #ff0000;
            font-size: 1.8rem;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid #ff0000;
        }

        .section h3 {
            color: #ff6666;
            font-size: 1.3rem;
            margin: 25px 0 12px 0;
        }

        .section p {
            margin-bottom: 15px;
            color: #ccc;
        }

        .download-box {
            background: #000;
            border: 2px dashed #ff0000;
            padding: 40px;
            text-align: center;
            margin: 25px 0;
            border-radius: 5px;
        }

        .download-btn {
            display: inline-block;
            background: #ff0000;
            color: #000;
            padding: 15px 40px;
            font-size: 1.2rem;
            font-weight: bold;
            text-decoration: none;
            text-transform: uppercase;
            border-radius: 5px;
            transition: all 0.3s ease;
            margin: 10px;
        }

        .download-btn:hover {
            background: #ff6666;
            box-shadow: 0 0 20px #ff0000;
            transform: translateY(-2px);
        }

        .code-container {
            background: #000;
            border: 1px solid #333;
            padding: 20px;
            margin: 20px 0;
            border-radius: 5px;
            position: relative;
        }

        pre {
            color: #00ff00;
            font-size: 12px;
            line-height: 1.5;
            white-space: pre-wrap;
            word-wrap: break-word;
            max-height: 500px;
            overflow-y: auto;
            padding-right: 10px;
        }

        pre::-webkit-scrollbar {
            width: 8px;
        }

        pre::-webkit-scrollbar-track {
            background: #1a1a1a;
        }

        pre::-webkit-scrollbar-thumb {
            background: #ff0000;
        }

        .copy-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: #ff0000;
            color: #000;
            border: none;
            padding: 8px 20px;
            font-weight: bold;
            cursor: pointer;
            border-radius: 3px;
            font-size: 0.9rem;
        }

        .copy-btn:hover {
            background: #ff6666;
        }

        .instructions {
            background: #0f0f0f;
            border-left: 4px solid #ff0000;
            padding: 20px;
            margin: 15px 0;
            border-radius: 0 5px 5px 0;
        }

        .instructions ul,
        .instructions ol {
            margin-left: 25px;
            margin-top: 12px;
        }

        .instructions li {
            margin-bottom: 8px;
            color: #bbb;
        }

        .instructions pre {
            background: #000;
            padding: 12px;
            margin: 10px 0;
            border: 1px solid #222;
            border-radius: 3px;
            font-size: 11px;
        }

        .danger-box {
            background: #330000;
            border: 2px solid #ff0000;
            padding: 20px;
            margin: 20px 0;
            border-radius: 5px;
        }

        .danger-box h4 {
            color: #ff0000;
            margin-bottom: 12px;
            font-size: 1.1rem;
        }

        table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin: 20px 0;
            border-radius: 5px;
            overflow: hidden;
        }

        th {
            background: #ff0000;
            color: #000;
            padding: 14px;
            font-weight: bold;
            text-align: left;
        }

        td {
            padding: 12px 14px;
            border-bottom: 1px solid #2a2a2a;
        }

        tr:nth-child(even) {
            background: #141414;
        }

        tr:hover {
            background: #1f1f1f;
        }

        footer {
            text-align: center;
            margin-top: 50px;
            padding: 30px;
            border-top: 1px solid #333;
            color: #666;
        }

        .highlight {
            color: #00ff00;
            background: #000;
            padding: 2px 6px;
            border-radius: 3px;
            font-weight: bold;
        }

        @media (max-width: 768px) {
            h1 {
                font-size: 2.2rem;
            }

            .section {
                padding: 20px;
            }

            .download-btn {
                padding: 12px 25px;
                font-size: 1rem;
            }

            pre {
                font-size: 11px;
            }
        }
    </style>
</head>
<body>
    <header>
        <div class="container">
            <h1>☢️ NUKEIT.SITE</h1>
            <p class="subtitle">THE NUCLEAR OPTION - PUBLIC ARSENAL</p>
        </div>
    </header>

    <div class="container">
        <div class="warning-banner">
            ⚠️ WARNING: THIS TOOL CAN PERMANENTLY DELETE DATA. FOR DEVELOPMENT USE ONLY ⚠️
        </div>

        <div class="section">
            <h2>📥 DOWNLOAD THE ARSENAL</h2>
            <p>This is a single-file PHP tool that gives you a web-based interface to clear caches, logs, and even your entire database. Everything is self-contained.</p>
            
            <div class="download-box">
                <h3 style="color: #ff0000; margin-bottom: 20px;">GET THE TOOL</h3>
                <a href="data:text/plain;charset=utf-8;base64,<?php echo base64_encode(file_get_contents(__FILE__)); ?>" 
                   class="download-btn" download="nukeit.php">
                    ⬇ DOWNLOAD NUKEIT.PHP
                </a>
                <p style="margin-top: 15px; color: #888;">Right-click and "Save link as..." if download doesn't start</p>
            </div>

            <h3>📋 Code Preview (Copy & Paste)</h3>
            <div class="code-container">
                <button class="copy-btn" onclick="copyCode()">COPY CODE</button>
                <pre id="codeBlock"><?php echo htmlspecialchars(file_get_contents(__FILE__)); ?></pre>
            </div>
        </div>

        <div class="section">
            <h2>🚀 SETUP INSTRUCTIONS</h2>
            
            <div class="instructions">
                <h3>Step 1: Download & Save</h3>
                <ul>
                    <li>Save the file above as <span class="highlight">nukeit.php</span></li>
                    <li>Upload to your <strong>development server</strong> (never production)</li>
                    <li>Place it in your project root or a protected directory</li>
                </ul>

                <h3>Step 2: Configure Password</h3>
                <p>Open <span class="highlight">nukeit.php</span> and change line 17:</p>
                <pre>define('NUKEIT_PASSWORD', 'YOUR_SECRET_PASSWORD');</pre>
                
                <p><strong>For production security</strong>, generate a proper hash:</p>
                <pre>// Run this in PHP:
echo password_hash('your-secret-password', PASSWORD_DEFAULT);
// Output: $2y$10$...

// Then change line 17 to:
define('NUKEIT_PASSWORD', '$2y$10$...your-hash...');

// AND modify the authenticate() function to:
return password_verify($password, NUKEIT_PASSWORD);</pre>

                <h3>Step 3: Configure Targets</h3>
                <p>Edit the <span class="highlight">$nukeDirectories</span> array to match your folders:</p>
                <pre>$nukeDirectories = [
    'cache' => __DIR__ . '/var/cache',
    'logs' => __DIR__ . '/storage/logs',
    'temp' => sys_get_temp_dir()
];</pre>

                <h3>Step 4: Database Setup (Optional)</h3>
                <p>For the "Total Annihilation" feature, fill in:</p>
                <pre>define('DB_HOST', 'localhost');
define('DB_NAME', 'your_dev_db');
define('DB_USER', 'dev_user');
define('DB_PASS', 'dev_password');</pre>
                <p class="danger-box"><strong>⚠️ Only grant DROP privileges to this database user!</strong></p>

                <h3>Step 5: Create Directories</h3>
                <pre>mkdir cache logs
chmod 755 cache logs
touch nukeit-audit.log
chmod 644 nukeit-audit.log</pre>
            </div>
        </div>

        <div class="section">
            <h2>🔒 MANDATORY SECURITY LOCKDOWN</h2>
            <p>You MUST protect this file or risk unauthorized access.</p>

            <h3>Method 1: Apache (.htaccess)</h3>
            <div class="instructions">
                <p>Create <span class="highlight">.htaccess</span> in the same directory:</p>
                <pre>&lt;Files "nukeit.php"&gt;
    AuthType Basic
    AuthName "Nuclear Arsenal"
    AuthUserFile /path/to/.htpasswd
    Require valid-user
    
    # Optional: IP restriction
    Order deny,allow
    Deny from all
    Allow from 192.168.1.100
&lt;/Files&gt;</pre>
            </div>

            <h3>Method 2: Nginx</h3>
            <div class="instructions">
                <pre>location /nukeit.php {
    auth_basic "Nuclear Arsenal";
    auth_basic_user_file /etc/nginx/.htpasswd;
    
    # Allow only your IP
    allow 192.168.1.100;
    deny all;
}</pre>
            </div>

            <h3>Method 3: PHP IP Whitelist</h3>
            <div class="instructions">
                <p>Add this at the top of the file (after <span class="highlight">&lt;?php</span>):</p>
                <pre>$allowedIPs = ['192.168.1.100', '::1'];
if (!in_array($_SERVER['REMOTE_ADDR'], $allowedIPs)) {
    http_response_code(403);
    die('ACCESS DENIED');
}</pre>
            </div>
        </div>

        <div class="section">
            <h2>📖 USAGE GUIDE</h2>
            
            <h3>Access the Control Panel</h3>
            <p>Navigate to: <span class="highlight">https://your-dev-site.com/nukeit.php?action=login</span></p>

            <h3>Execute a Strike</h3>
            <div class="instructions">
                <ol>
                    <li><strong>Login</strong> with your authorization code</li>
                    <li><strong>Review</strong> the target status on the dashboard</li>
                    <li><strong>Click EXECUTE</strong> on any card to nuke that target</li>
                    <li><strong>For Database:</strong> Type <span class="highlight">YES-NUKE-DB</span> to confirm</li>
                </ol>
            </div>

            <h3>What Each Option Does</h3>
            <table>
                <thead>
                    <tr>
                        <th>Option</th>
                        <th>Effect</th>
                        <th>When to Use</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td><strong>Nuke OPcache</strong></td>
                        <td>Clears PHP bytecode cache</td>
                        <td>Code changes not showing up</td>
                    </tr>
                    <tr>
                        <td><strong>Nuke Cache</strong></td>
                        <td>Deletes all files in cache folder</td>
                        <td>Stale cache poisoning data</td>
                    </tr>
                    <tr>
                        <td><strong>Nuke Logs</strong></td>
                        <td>Empties log files</td>
                        <td>Disk space running low</td>
                    </tr>
                    <tr>
                        <td><strong>Nuke Temp</strong></td>
                        <td>Clears temp directory</td>
                        <td>Leftover temp files accumulating</td>
                    </tr>
                    <tr>
                        <td><strong>Total Annihilation</strong></td>
                        <td><span style="color: #ff0000;">Drops all database tables</span></td>
                        <td>Reset dev database to ground zero</td>
                    </tr>
                </tbody>
            </table>

            <h3>Audit Trail</h3>
            <p>All actions are logged to <span class="highlight">nukeit-audit.log</span>:</p>
            <pre>[2025-01-08 14:30:15] [192.168.1.100] [admin] ACTION: cache | Deleted 247 items
[2025-01-08 14:31:22] [192.168.1.100] [admin] ACTION: database | NUCLEAR STRIKE COMPLETE! 12 tables vaporized.</pre>
        </div>

        <div class="section">
            <h2>⚠️ WARNINGS & DISCLAIMERS</h2>
            
            <div class="danger-box">
                <h4>☠️ DANGER ZONE</h4>
                <ul>
                    <li><strong>NEVER</strong> use this on a production server</li>
                    <li><strong>ALWAYS</strong> have backups before using</li>
                    <li><strong>DATABASE NUKE</strong> is <strong>IRREVERSIBLE</strong></li>
                    <li><strong>CONFIRM</strong> you're in the right environment</li>
                    <li><strong>LOGS</strong> record your IP and actions</li>
                </ul>
            </div>

            <h3>Intended Use Cases</h3>
            <div class="instructions">
                <ul>
                    <li><strong>Local development</strong> environment resets</li>
                    <li><strong>Staging server</strong> cleanup between tests</li>
                    <li><strong>CI/CD pipelines</strong> that need a clean slate</li>
                    <li><strong>Docker containers</strong> where you need a reset script</li>
                </ul>
            </div>

            <h3>Prohibited Use</h3>
            <div class="instructions">
                <ul>
                    <li>Any production system</li>
                    <li>Shared hosting environments</li>
                    <li>Systems with critical data</li>
                    <li>Without proper authorization</li>
                </ul>
            </div>

            <h3>Legal Disclaimer</h3>
            <p class="danger-box">
                By downloading and using this tool, you accept full responsibility for any data loss, system damage, or other consequences. The authors provide this tool <strong>AS-IS</strong> with no warranty. Use at your own risk.
            </p>
        </div>

        <div class="section">
            <h2>🛠️ TROUBLESHOOTING</h2>
            
            <h3>"Access Denied"</h3>
            <div class="instructions">
                <ul>
                    <li>Check your password hash is correct</li>
                    <li>Verify .htaccess/Nginx auth is configured</li>
                    <li>Confirm your IP is whitelisted</li>
                </ul>
            </div>

            <h3>"Directory not found"</h3>
            <div class="instructions">
                <ul>
                    <li>Create the directories manually (Step 5)</li>
                    <li>Update paths in $nukeDirectories array</li>
                </ul>
            </div>

            <h3>Database connection fails</h3>
            <div class="instructions">
                <ul>
                    <li>Verify credentials in config</li>
                    <li>Ensure PDO MySQL extension is installed</li>
                    <li>Check user has DROP privileges</li>
                </ul>
            </div>

            <h3>CSRF errors</h3>
            <div class="instructions">
                <ul>
                    <li>Clear browser cookies/session</li>
                    <li>Ensure you're not accessing via multiple tabs</li>
                </ul>
            </div>
        </div>

        <div class="section">
            <h2>📄 LICENSE & SOURCE</h2>
            <p><strong>MIT License</strong> - Use freely, but responsibly.</p>
            <p>Latest Version: <span class="highlight">1.0.0</span></p>
            <p>PHP Requirements: <span class="highlight">7.4+</span> (for password_hash)</p>
            <p>Last Updated: <span class="highlight">2025-01-08</span></p>
        </div>
    </div>

    <footer>
        <p style="color: #ff0000; font-size: 12px; margin-top: 20px;">
            ☢️ REMEMBER: WITH GREAT POWER COMES GREAT RESPONSIBILITY ☢️
        </p>
        <p style="margin-top: 10px;">NUKEIT.SITE - THE NUCLEAR OPTION</p>
    </footer>

    <script>
        function copyCode() {
            const codeBlock = document.getElementById('codeBlock');
            const textArea = document.createElement('textarea');
            textArea.value = codeBlock.textContent;
            document.body.appendChild(textArea);
            textArea.select();
            document.execCommand('copy');
            document.body.removeChild(textArea);
            
            const btn = document.querySelector('.copy-btn');
            const originalText = btn.textContent;
            btn.textContent = 'COPIED!';
            btn.style.background = '#00ff00';
            btn.style.color = '#000';
            setTimeout(() => {
                btn.textContent = originalText;
                btn.style.background = '#ff0000';
                btn.style.color = '#000';
            }, 2000);
        }
    </script>
</body>
</html>
<?php exit; ?>

🚀 SETUP INSTRUCTIONS

Step 1: Download & Save

  • Save the file above as nukeit.php
  • Upload to your development server (never production)
  • Place it in your project root or a protected directory

Step 2: Configure Password

Open nukeit.php and change line 17:

define('NUKEIT_PASSWORD', 'YOUR_SECRET_PASSWORD');

For production security, generate a proper hash:

// Run this in PHP:
echo password_hash('your-secret-password', PASSWORD_DEFAULT);
// Output: $2y$10$...

// Then change line 17 to:
define('NUKEIT_PASSWORD', '$2y$10$...your-hash...');

// AND modify the authenticate() function to:
return password_verify($password, NUKEIT_PASSWORD);

Step 3: Configure Targets

Edit the $nukeDirectories array to match your folders:

$nukeDirectories = [
    'cache' => __DIR__ . '/var/cache',
    'logs' => __DIR__ . '/storage/logs',
    'temp' => sys_get_temp_dir()
];

Step 4: Database Setup (Optional)

For the "Total Annihilation" feature, fill in:

define('DB_HOST', 'localhost');
define('DB_NAME', 'your_dev_db');
define('DB_USER', 'dev_user');
define('DB_PASS', 'dev_password');

⚠️ Only grant DROP privileges to this database user!

Step 5: Create Directories

mkdir cache logs
chmod 755 cache logs
touch nukeit-audit.log
chmod 644 nukeit-audit.log

🔒 MANDATORY SECURITY LOCKDOWN

You MUST protect this file or risk unauthorized access.

Method 1: Apache (.htaccess)

Create .htaccess in the same directory:

<Files "nukeit.php">
    AuthType Basic
    AuthName "Nuclear Arsenal"
    AuthUserFile /path/to/.htpasswd
    Require valid-user
    
    # Optional: IP restriction
    Order deny,allow
    Deny from all
    Allow from 192.168.1.100
</Files>

Method 2: Nginx

location /nukeit.php {
    auth_basic "Nuclear Arsenal";
    auth_basic_user_file /etc/nginx/.htpasswd;
    
    # Allow only your IP
    allow 192.168.1.100;
    deny all;
}

Method 3: PHP IP Whitelist

Add this at the top of the file (after <?php):

$allowedIPs = ['192.168.1.100', '::1'];
if (!in_array($_SERVER['REMOTE_ADDR'], $allowedIPs)) {
    http_response_code(403);
    die('ACCESS DENIED');
}

📖 USAGE GUIDE

Access the Control Panel

Navigate to: https://your-dev-site.com/nukeit.php?action=login

Execute a Strike

  1. Login with your authorization code
  2. Review the target status on the dashboard
  3. Click EXECUTE on any card to nuke that target
  4. For Database: Type YES-NUKE-DB to confirm

What Each Option Does

Option Effect When to Use
Nuke OPcache Clears PHP bytecode cache Code changes not showing up
Nuke Cache Deletes all files in cache folder Stale cache poisoning data
Nuke Logs Empties log files Disk space running low
Nuke Temp Clears temp directory Leftover temp files accumulating
Total Annihilation Drops all database tables Reset dev database to ground zero

Audit Trail

All actions are logged to nukeit-audit.log:

[2025-01-08 14:30:15] [192.168.1.100] [admin] ACTION: cache | Deleted 247 items
[2025-01-08 14:31:22] [192.168.1.100] [admin] ACTION: database | NUCLEAR STRIKE COMPLETE! 12 tables vaporized.

⚠️ WARNINGS & DISCLAIMERS

☠️ DANGER ZONE

  • NEVER use this on a production server
  • ALWAYS have backups before using
  • DATABASE NUKE is IRREVERSIBLE
  • CONFIRM you're in the right environment
  • LOGS record your IP and actions

Intended Use Cases

  • Local development environment resets
  • Staging server cleanup between tests
  • CI/CD pipelines that need a clean slate
  • Docker containers where you need a reset script

Prohibited Use

  • Any production system
  • Shared hosting environments
  • Systems with critical data
  • Without proper authorization

Legal Disclaimer

By downloading and using this tool, you accept full responsibility for any data loss, system damage, or other consequences. The authors provide this tool AS-IS with no warranty. Use at your own risk.

🛠️ TROUBLESHOOTING

"Access Denied"

  • Check your password hash is correct
  • Verify .htaccess/Nginx auth is configured
  • Confirm your IP is whitelisted

"Directory not found"

  • Create the directories manually (Step 5)
  • Update paths in $nukeDirectories array

Database connection fails

  • Verify credentials in config
  • Ensure PDO MySQL extension is installed
  • Check user has DROP privileges

CSRF errors

  • Clear browser cookies/session
  • Ensure you're not accessing via multiple tabs

📄 LICENSE & SOURCE

MIT License - Use freely, but responsibly.

Latest Version: 1.0.0

PHP Requirements: 7.4+ (for password_hash)

Last Updated: 2025-01-08