!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/enlightn/src/Analyzers/Security/   drwxr-xr-x
Free 13.08 GB of 57.97 GB (22.56%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Enlightn\Enlightn\Analyzers\Security;

use 
Illuminate\Support\Str;

class 
FilePermissionsAnalyzer extends SecurityAnalyzer
{
    
/**
     * The title describing the analyzer.
     *
     * @var string|null
     */
    
public $title 'Your project files and directories use safe permissions.';

    
/**
     * The severity of the analyzer.
     *
     * @var string|null
     */
    
public $severity self::SEVERITY_CRITICAL;

    
/**
     * The time to fix in minutes.
     *
     * @var int|null
     */
    
public $timeToFix 60;

    
/**
     * @var string
     */
    
protected $unsafeFilesOrDirs;

    
/**
     * Get the error message describing the analyzer insights.
     *
     * @return string
     */
    
public function errorMessage()
    {
        return 
"Your application's project directory permissions are not setup in a secure manner. This may "
            
."expose your application to be compromised if another account on the same server is vulnerable. "
            
."This can be even more dangerous if you used shared hosting. All project directories in Laravel "
            
."should be setup with a max of 775 permissions and most app files should be provided 664 (except "
            
."executables such as Artisan or your deployment scripts which should be provided 775 permissions). "
            
."These are the max level of permissions in order to be secure. Your unsafe files or directories "
            
."include: {$this->unsafeFilesOrDirs}.";
    }

    
/**
     * Execute the analyzer.
     *
     * @return void
     */
    
public function handle()
    {
        
$filesOrDirectoriesToCheck config('enlightn.allowed_permissions', [
            
base_path() => '775',
            
app_path() => '775',
            
resource_path() => '775',
            
storage_path() => '775',
            
public_path() => '775',
            
config_path() => '775',
            
database_path() => '775',
            
base_path('routes') => '775',
            
app()->bootstrapPath() => '775',
            
app()->bootstrapPath('cache') => '775',
            
app()->bootstrapPath('app.php') => '664',
            
base_path('artisan') => '775',
            
public_path('index.php') => '664',
            
public_path('server.php') => '664',
        ]);

        
$this->unsafeFilesOrDirs collect($filesOrDirectoriesToCheck)->filter(function ($allowedPermission$path) {
            return 
file_exists($path) && ($allowedPermission decoct(fileperms($path) & 0777));
        })->
keys()->map(function ($path) {
            return 
Str::contains($pathbase_path())
                ? (
'['.trim(Str::after($pathbase_path()), '/').']') : '['.$path.']';
        })->
join(', '' and ');

        if (! empty(
$this->unsafeFilesOrDirs)) {
            
$this->markFailed();
        }
    }
}

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