!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/enlightn/security-checker/src/   drwxr-xr-x
Free 13.24 GB of 57.97 GB (22.83%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Enlightn\SecurityChecker;

use 
RuntimeException;
use 
Symfony\Component\Process\ExecutableFinder;
use 
Symfony\Component\Process\Process;
use 
UnexpectedValueException;
use 
ZipArchive;

class 
ZipExtractor
{
    
/**
     * @param string $archivePath
     * @param string $extractPath
     */
    
public function extract($archivePath$extractPath)
    {
        if (
$this->unzipCommandExists()) {
            
$this->extractWithSystemUnzip($archivePath$extractPath);

            return;
        }

        if (
class_exists('ZipArchive')) {
            
$this->extractWithZipArchive($archivePath$extractPath);

            return;
        }

        throw new 
RuntimeException('The unzip command and zip php extension are both missing.');
    }

    
/**
     * @return bool
     */
    
public function unzipCommandExists()
    {
        
$finder = new ExecutableFinder;

        return (bool) 
$finder->find('unzip');
    }

    
/**
     * @param string $archivePath
     * @param string $extractPath
     */
    
public function extractWithSystemUnzip($archivePath$extractPath)
    {
        
$process = new Process(['unzip''-qq''-o'$archivePath'-d'$extractPath]);

        
$process->mustRun();
    }

    
/**
     * @param string $archivePath
     * @param string $extractPath
     */
    
public function extractWithZipArchive($archivePath$extractPath)
    {
        
$zip = new ZipArchive;
        
$openResult $zip->open($archivePath);

        if (
true === $openResult) {
            
$extractResult $zip->extractTo($extractPath);

            if (
true === $extractResult) {
                
$zip->close();
            } else {
                throw new 
RuntimeException('There was an error in extracting the ZIP file. It is either corrupted or using an invalid format.');
            }
        } else {
            throw new 
UnexpectedValueException($this->getErrorMessage($openResult$archivePath));
        }
    }

    
/**
     * Give a meaningful error message to the user.
     *
     * @param  int    $retval
     * @param  string $file
     * @return string
     */
    
protected function getErrorMessage($retval$file)
    {
        switch (
$retval) {
            case 
ZipArchive::ER_EXISTS:
                return 
sprintf("File '%s' already exists."$file);
            case 
ZipArchive::ER_INCONS:
                return 
sprintf("Zip archive '%s' is inconsistent."$file);
            case 
ZipArchive::ER_INVAL:
                return 
sprintf("Invalid argument (%s)"$file);
            case 
ZipArchive::ER_MEMORY:
                return 
sprintf("Malloc failure (%s)"$file);
            case 
ZipArchive::ER_NOENT:
                return 
sprintf("No such zip file: '%s'"$file);
            case 
ZipArchive::ER_NOZIP:
                return 
sprintf("'%s' is not a zip archive."$file);
            case 
ZipArchive::ER_OPEN:
                return 
sprintf("Can't open zip file: %s"$file);
            case 
ZipArchive::ER_READ:
                return 
sprintf("Zip read error (%s)"$file);
            case 
ZipArchive::ER_SEEK:
                return 
sprintf("Zip seek error (%s)"$file);
            default:
                return 
sprintf("'%s' is not a valid zip archive, got error code: %s"$file$retval);
        }
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0056 ]--