!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)

/var/www/html/main_file/vendor/laravel/framework/src/Illuminate/Foundation/Console/   drwxr-xr-x
Free 12.95 GB of 57.97 GB (22.34%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Illuminate\Foundation\Console;

use 
Exception;
use 
Illuminate\Console\Command;
use 
Illuminate\Encryption\Encrypter;
use 
Illuminate\Filesystem\Filesystem;
use 
Illuminate\Support\Str;
use 
Symfony\Component\Console\Attribute\AsCommand;

#[
AsCommand(name'env:encrypt')]
class 
EnvironmentEncryptCommand extends Command
{
    
/**
     * The name and signature of the console command.
     *
     * @var string
     */
    
protected $signature 'env:encrypt
                    {--key= : The encryption key}
                    {--cipher= : The encryption cipher}
                    {--env= : The environment to be encrypted}
                    {--force : Overwrite the existing encrypted environment file}'
;

    
/**
     * The name of the console command.
     *
     * This name is used to identify the command during lazy loading.
     *
     * @var string|null
     *
     * @deprecated
     */
    
protected static $defaultName 'env:encrypt';

    
/**
     * The console command description.
     *
     * @var string
     */
    
protected $description 'Encrypt an environment file';

    
/**
     * The filesystem instance.
     *
     * @var \Illuminate\Filesystem\Filesystem
     */
    
protected $files;

    
/**
     * Create a new command instance.
     *
     * @param  \Illuminate\Filesystem\Filesystem  $files
     * @return void
     */
    
public function __construct(Filesystem $files)
    {
        
parent::__construct();

        
$this->files $files;
    }

    
/**
     * Execute the console command.
     *
     * @return void
     */
    
public function handle()
    {
        
$cipher $this->option('cipher') ?: 'AES-256-CBC';

        
$key $this->option('key');

        
$keyPassed $key !== null;

        
$environmentFile $this->option('env')
                            ? 
base_path('.env').'.'.$this->option('env')
                            : 
$this->laravel->environmentFilePath();

        
$encryptedFile $environmentFile.'.encrypted';

        if (! 
$keyPassed) {
            
$key Encrypter::generateKey($cipher);
        }

        if (! 
$this->files->exists($environmentFile)) {
            
$this->components->error('Environment file not found.');

            return 
Command::FAILURE;
        }

        if (
$this->files->exists($encryptedFile) && ! $this->option('force')) {
            
$this->components->error('Encrypted environment file already exists.');

            return 
Command::FAILURE;
        }

        try {
            
$encrypter = new Encrypter($this->parseKey($key), $cipher);

            
$this->files->put(
                
$encryptedFile,
                
$encrypter->encrypt($this->files->get($environmentFile))
            );
        } catch (
Exception $e) {
            
$this->components->error($e->getMessage());

            return 
Command::FAILURE;
        }

        
$this->components->info('Environment successfully encrypted.');

        
$this->components->twoColumnDetail('Key', ($keyPassed $key 'base64:'.base64_encode($key)));
        
$this->components->twoColumnDetail('Cipher'$cipher);
        
$this->components->twoColumnDetail('Encrypted file'$encryptedFile);

        
$this->newLine();
    }

    
/**
     * Parse the encryption key.
     *
     * @param  string  $key
     * @return string
     */
    
protected function parseKey(string $key)
    {
        if (
Str::startsWith($key$prefix 'base64:')) {
            
$key base64_decode(Str::after($key$prefix));
        }

        return 
$key;
    }
}

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