!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/dokan/script/vendor/enlightn/enlightn/src/Analyzers/Security/   drwxrwxrwx
Free 13.03 GB of 57.97 GB (22.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     CSRFAnalyzer.php (4.69 KB)      -rwxrwxrwx
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Enlightn\Enlightn\Analyzers\Security;

use 
Enlightn\Enlightn\Analyzers\Concerns\AnalyzesMiddleware;
use 
Illuminate\Contracts\Http\Kernel;
use 
Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use 
Illuminate\Routing\Router;
use 
Illuminate\Support\Str;

class 
CSRFAnalyzer extends SecurityAnalyzer
{
    use 
AnalyzesMiddleware;

    
/**
     * The title describing the analyzer.
     *
     * @var string|null
     */
    
public $title 'Your application includes middleware to protect against CSRF attacks.';

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

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

    
/**
     * The routes that are not protected from CSRF.
     *
     * @var \Illuminate\Support\Collection
     */
    
public $unprotectedRoutes;

    
/**
     * Create a new analyzer instance.
     *
     * @param  \Illuminate\Routing\Router  $router
     * @param  \Illuminate\Contracts\Http\Kernel  $kernel
     * @return void
     */
    
public function __construct(Router $routerKernel $kernel)
    {
        
$this->router $router;
        
$this->kernel $kernel;
    }

    
/**
     * Get the error message describing the analyzer insights.
     *
     * @return string
     */
    
public function errorMessage()
    {
        return 
"Your application is not adequately protected from CSRF attacks. There are {$this->unprotectedRoutes->count()} "
            
."unprotected routes, which include: {$this->formatUnprotectedRoutes()}. This can be very dangerous and you must "
            
."resolve this by adding CSRF middleware to your web routes.";
    }

    
/**
     * Execute the analyzer.
     *
     * @return void
     * @throws \ReflectionException
     */
    
public function handle()
    {
        if (
$this->webMiddlewareGroupIsProtected()
            || 
$this->appIsGloballyProtected()
            || 
$this->routesAreIndividuallyProtected()) {
            return;
        }

        
$this->markFailed();
    }

    
/**
     * Determine whether to skip the analyzer.
     *
     * @return bool
     * @throws \ReflectionException
     */
    
public function skip()
    {
        
// Skip this analyzer if the app is stateless or does not use cookies (app does not need CSRF protection).
        
return $this->appIsStateless() || ! $this->appUsesCookies();
    }

    
/**
     * Determine if the "web" middleware group is protected from CSRF.
     *
     * @return bool
     */
    
protected function webMiddlewareGroupIsProtected()
    {
        if (isset(
$this->kernel->getMiddlewareGroups()['web'])) {
            if (
collect($this->kernel->getMiddlewareGroups()['web'])->contains(function ($middleware) {
                return 
is_subclass_of($middlewareVerifyCsrfToken::class);
            })) {
                
// Analysis passed as the web middleware group has the VerifyCsrfToken middleware
                
return true;
            }
        }

        return 
false;
    }

    
/**
     * Determine if the application is globally protected from CSRF.
     *
     * @return bool
     * @throws \ReflectionException
     */
    
protected function appIsGloballyProtected()
    {
        if (
$this->appUsesGlobalMiddleware(VerifyCsrfToken::class)) {
            
// Analysis passed as the VerifyCsrfToken middleware is global
            
return true;
        }

        return 
false;
    }

    
/**
     * Determine if all routes are individually protected from CSRF.
     *
     * @return bool
     */
    
protected function routesAreIndividuallyProtected()
    {
        
$this->unprotectedRoutes collect($this->router->getRoutes())->filter(function ($route) {
            
// Exclude the whitelisted route methods that don't need protection
            
return collect($route->methods())->contains(function ($method) {
                return ! 
in_array($method, ['HEAD''GET''OPTIONS']);
            });
        })->
filter(function ($route) {
            
// Get the routes that don't apply the VerifyCsrfToken middleware
            
return ! $this->routeUsesMiddleware($routeVerifyCsrfToken::class);
        })->
filter(function ($route) {
            
// Exclude the routes that are API routes (do not need CSRF protection)
            
return ! Str::is('/api/*'$route->uri());
        })->
map(function ($route) {
            
// Prettify unprotected routes to display in error message
            
return '['.implode(','$route->methods()).'] '.$route->uri();
        });

        return 
$this->unprotectedRoutes->count() == 0;
    }

    
/**
     * @return string
     */
    
protected function formatUnprotectedRoutes()
    {
        return 
$this->unprotectedRoutes->join(', '' and ');
    }
}

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