Skip to content

Commit 368d14d

Browse files
committed
Removed usage of bootstrap and made other minor changes
1 parent 8eaede6 commit 368d14d

File tree

5 files changed

+77
-46
lines changed

5 files changed

+77
-46
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# PHPStorm
2+
.idea/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Simple-PHP-Web-Shell
2-
Tiny PHP Web shell for executing unix commands from web page.
3-
![alt text](https://raw.githubusercontent.com/ArtyumX/Simple-PHP-Web-Shell/master/screenshot.PNG "Screenshot")
2+
A really simple & tiny PHP Web shell for executing unix commands from web page.
3+
![alt text](https://raw.githubusercontent.com/artyuum/Simple-PHP-Web-Shell/master/screenshot.png "Screenshot")

index.php

Lines changed: 73 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,101 @@
44
}
55
?>
66
<!DOCTYPE html>
7-
<html>
7+
<html lang="en">
88
<!-- By Artyum (https://github.com/artyuum) -->
99
<head>
10-
1110
<meta charset="utf-8">
12-
1311
<meta http-equiv="X-UA-Compatible" content="IE=edge">
14-
1512
<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-
1913
<title>Web Shell</title>
20-
2114
<style>
22-
h2 {
15+
* {
16+
box-sizing: border-box;
17+
}
18+
19+
body {
20+
font-family: sans-serif;
2321
color: rgba(0, 0, 0, .75);
2422
}
2523

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;
3243
}
3344

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;
3676
}
3777
</style>
3878

3979
</head>
4080

4181
<body>
82+
<main>
83+
<h1>Web Shell</h1>
84+
<h2>Execute a command</h2>
4285

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>
5188
<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>
5491
</div>
55-
<button type="submit" class="btn btn-primary">Execute</button>
5692
</form>
5793

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>
73103
</body>
74-
75104
</html>

screenshot.PNG

-25.7 KB
Binary file not shown.

screenshot.png

19.9 KB
Loading

0 commit comments

Comments
 (0)