!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/site/ipanel/app/system/   drwxr-xr-x
Free 9.26 GB of 93.48 GB (9.9%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     FileUpload.php (11.02 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
 
//header("Content-type: image/jpeg");
 
if(!class_exists('Util'))
    require_once(
APP_PATH."/util/Util.php");

/**
 * Description of Upload
 *
 * @author Cledson
 */
class FileUpload {

    public 
$targetUpload "../../uploads/";
    public 
$type "image";                // file - image
    
public $width 400;
    public 
$height 300;
    public 
$resize false;


    
/**
     * Retorna o tipo do arquivo
     *
     * @return String
     */
    
public function getType() {
        return 
$this->type;
    }

    
/**
     * Seta o tipo do arquivo
     * @param String $type    Tipo do arquivo
     *
     * @return void
     */
    
public function setType($type) {
        
$this->type $type;
    }


    
/**
     * Efetua o upload do arquivo<br>
     * Caso seja uma imagem, verifica se esta deve ser redimensionada
     *
     * @param String  $folder        Pasta de destino do arquivo
     * @param Integer $id            Identificador do registro
     * @param String  $filename      Nome do arquivo
     * @param ByteArray $bytes       Array de bytes do arquivo vindo do flex
     * 
     * @return boolean
     * */
    
public function upload($file$folder$id$filename) {
        
$util = new Util();
        if (!
is_dir($this->targetUpload "/")){
            
mkdir($this->targetUpload "/"0777);
        }
        if (!
is_dir($this->targetUpload $folder "/")){
            
mkdir($this->targetUpload $folder "/"0777);
        }
        if (!
is_dir($this->targetUpload $folder "/" $id "/")){
            
mkdir($this->targetUpload $folder "/" $id "/"0777);
        }
        
        if(
move_uploaded_file($file$this->targetUpload.$folder."/".$id."/".$util->nameForWeb($filename))){
            if (
$this->type == "image" && $this->resize){
                
$this->imageResize($util->nameForWeb($filename), $folder."/".$id);
            }
            return 
true;
        }
        else
            return 
false;
    }

    
/**
     * Upload files!
     *
     * @param FileVO $file
     * @return string
     * */
    
public function deleteFolder($folder$id) {
        @
$OpenDir opendir($this->targetUpload $folder "/" $id);
        while (
false !== ($file = @readdir($OpenDir))) {
            if ((
$file != ".") && ($file != "..") && ($file != ""))
                @
unlink($this->targetUpload $folder "/" $id "/" $file);
        }
        @
closedir($OpenDir);
        @
rmdir($this->targetUpload $folder "/" $id);
        return 
true;
    }

    
    
    
    
/**
     * Redimensiona a imagem de acordo com o tamanho pré estabelecido
     *
     * @param String $image         Imagem a ser redimensionada
     * @param String $folder        Pasta de destino do arquivo
     * 
     * @return void
     * */
    
public function imageResize($image$folder$prefix=""$gallery=false) {
        
$originalExtension strrchr($image".");
        
$extension strtolower($originalExtension);
        
$imageTmp $this->targetUpload $folder $image;
        if(
$prefix == "" && !$gallery){
            
$prefix str_replace($originalExtension""$image);
        }
        if(
$gallery){
            
$prefix $prefix.str_replace($originalExtension""$image);
        }
        if (
$extension == ".jpg" || $extension == ".jpeg") {
            
$img imagecreatefromjpeg($imageTmp);
            
$x imagesx($img);
            
$y imagesy($img);
            if(
$x $this->width){
                
$this->width $x;
            }
            if(
$y $this->height){
                
$this->height $y;
            }
            
$lowerSide = ($this->width $this->height) ? $this->width $this->height;
            
$biggerSide = ($this->width $this->height) ? $this->width $this->height;
            
$widthJPG  $x $y $lowerSide $biggerSide;
            
$heightJPG $x $y $lowerSide $biggerSide;
            
            
$finalImage imagecreatetruecolor($widthJPG$heightJPG);
            
imagecopyresampled($finalImage$img0000$widthJPG$heightJPG$x$y);
            
imagejpeg($finalImage$this->targetUpload.$folder."/".$prefix.$extension90);
        }
        if (
$extension == ".gif") {
            
$img imagecreatefromgif($imageTmp);
            
$widthGIF $this->width;
            
$heightGIF $this->height;
            
$x imagesx($img);
            
$y imagesy($img);
            if(
$x $this->width){
                
$this->width $x;
            }
            if(
$y $this->height){
                
$this->height $y;
            }
            
$lowerSide = ($this->width $this->height) ? $this->width $this->height;
            
$biggerSide = ($this->width $this->height) ? $this->width $this->height;
            
$widthGIF  $x $y $lowerSide $biggerSide;
            
$heightGIF $x $y $lowerSide $biggerSide;
            
$finalImage imagecreatetruecolor($widthGIF$heightGIF);
            
imagecopyresampled($finalImage$img0000$widthGIF$heightGIF$x$y);
            
imagegif($finalImage$this->targetUpload.$folder."/".$prefix.$extension90);
        }
        if (
$extension == ".png") {
            
$img imageCreateFromPng($imageTmp);
            
$x imagesx($img);
            
$y imagesy($img);
            if(
$x $this->width){
                
$this->width $x;
            }
            if(
$y $this->height){
                
$this->height $y;
            }
            
$lowerSide = ($this->width $this->height) ? $this->width $this->height;
            
$biggerSide = ($this->width $this->height) ? $this->width $this->height;
            
$widthPNG  $x $y $lowerSide $biggerSide;
            
$heightPNG $x $y $lowerSide $biggerSide;
            
$finalImage imagecreatetruecolor($widthPNG$heightPNG);
            
imagecopyresampled($finalImage$img0000$widthPNG$heightPNG$x$y);
            
imagepng($finalImage$this->targetUpload.$folder."/".$prefix.$extension9);
        }
    }
    
    
/**
     * Recorta a imagem de acordo com o tamanho e a posição pré estabelecida
     *
     * @param String $image         Imagem a ser redimensionada
     * @param String $folder        Pasta de destino do arquivo
     * 
     * @return void
     * */
    
public function imageCrop($image$folder$width$height$posX$posY$prefix) {
    
$imageTmp $this->targetUpload $folder $image;
        
$extension strtolower(strrchr($image"."));
        if (
$extension == ".jpg" || $extension == ".jpeg") {
            
$imgTemp imagecreatefromjpeg($imageTmp);
            
$baseTemp imagecreatetruecolor($width$height);
            
imagecopyresampled($baseTemp$imgTemp00$posX$posY$width$height$width$height);
            
imagejpeg($baseTemp$this->targetUpload $folder.$prefix.$extension100);
    }
        if (
$extension == ".gif") {
            
$imgTemp imagecreatefromgif($imageTmp);
            
$baseTemp imagecreatetruecolor($width$height);
            
imagecopyresampled($baseTemp$imgTemp00$posX$posY$width$height$width$height);
            
imagegif($baseTemp$this->targetUpload $folder.$prefix.$extension100);
        }
        if (
$extension == ".png") {
            
$imgTemp imageCreateFromPng($imageTmp);
            
$baseTemp imagecreatetruecolor($width$height);
            
imagecopyresampled($baseTemp$imgTemp00$posX$posY$width$height$width$height);
            
imagepng($baseTemp$this->targetUpload $folder.$prefix.$extension9);
        }
    }


    
/**
     * Une 2 imagens com a opção de adicionar um texto á marca d'agua
     *
     * @param String $image         Imagem a ser redimensionada
     * @param String $folder        Pasta de destino do arquivo
     *
     * @return void
     * */
    
public function imageMerge($image$folder$text="") {
        
$extension strtolower(strrchr($image"."));
        
$imageTmp $this->targetUpload $folder "/" $image;
        
imagecopyresampled($image_p$image0000$new_width$new_height$width$height);

        if (
$extension == ".jpg") {
            
$imgJPG imagecreatefromjpeg($imageTmp);
            
$x imagesx($imgJPG);
            
$y imagesy($imgJPG);
            if(
$x $this->width){
                
$this->width $x;
            }
            if(
$y $this->height){
                
$this->height $y;
            }
            
$lowerSide = ($this->width $this->height) ? $this->width $this->height;
            
$biggerSide = ($this->width $this->height) ? $this->width $this->height;
            
$widthJPG  $x $y $lowerSide $biggerSide;
            
$heightJPG $x $y $lowerSide $biggerSide;

            
$finalImage imagecreatetruecolor($widthJPG$heightJPG);
            
imagecopyresampled($finalImage$imgJPG0000$widthJPG$heightJPG$x$y);
            
imagejpeg($finalImage$this->targetUpload.$folder."/".$prefix.str_replace("temp_"""$image), 90);
        }
        if (
$extension == ".gif") {
            
$imgGIF imagecreatefromgif($imagemTmp);
            
$widthGIF $this->width;
            
$heightGIF $this->height;
            
$x imagesx($imgGIF);
            
$y imagesy($imgGIF);
            if(
$x $this->width){
                
$this->width $x;
            }
            if(
$y $this->height){
                
$this->height $y;
            }
            
$lowerSide = ($this->width $this->height) ? $this->width $this->height;
            
$biggerSide = ($this->width $this->height) ? $this->width $this->height;
            
$widthGIF  $x $y $lowerSide $biggerSide;
            
$heightGIF $x $y $lowerSide $biggerSide;
            
$finalImage imagecreatetruecolor($widthGIF$heightGIF);
            
imagecopyresampled($finalImage$imgGIF0000$widthGIF$heightGIF$x$y);
            
imagegif($finalImage$this->targetUpload.$folder."/".$prefix.$image90);
        }
        if (
$extension == ".png") {
            
$imgPNG imagecreatefrompng($imagemTmp);
            
$widthPNG $this->width;
            
$heightPNG $this->height;
            
$x imagesx($imgPNG);
            
$y imagesy($imgPNG);
            if(
$x $this->width){
                
$this->width $x;
            }
            if(
$y $this->height){
                
$this->height $y;
            }
            
$lowerSide = ($this->width $this->height) ? $this->width $this->height;
            
$biggerSide = ($this->width $this->height) ? $this->width $this->height;
            
$widthPNG  $x $y $lowerSide $biggerSide;
            
$heightPNG $x $y $lowerSide $biggerSide;
            
$finalImage imagecreatetruecolor($widthPNG$heightPNG);
            
imagecopyresampled($finalImage$imgPNG0000$widthPNG$heightPNG$x$y);
            
imagepng($finalImage$this->targetUpload.$folder."/".$prefix.$image90);
        }
    }
    


}

?>

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