!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/php/lib/rest/seguridad/   drwxr-xr-x
Free 14.57 GB of 61.93 GB (23.53%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

namespace rest\seguridad;

use 
rest\seguridad\autenticacion\rest_error_autenticacion;
use 
rest\seguridad\autorizacion\rest_error_autorizacion;

/**
 * Parte del esquema inspirado en symfony
 * http://symfony.com/doc/current/book/security.html
 *
 * El firewall, si captura una ruta, se encarga de la autenticacion
 * @package rest\seguridad
 */
class firewall
{

    protected 
$authentication;
    protected 
$authorization;
    protected 
$path_pattern;

    function 
__construct(proveedor_autenticacion $authenproveedor_autorizacion $author$pattern)
    {
        
$this->authentication $authen;
        
$this->authorization $author;
        
$this->path_pattern $pattern;
    }

    public function 
maneja_ruta($ruta)
    {
        return 
preg_match($this->path_pattern$ruta) == 1;
    }

    
/**
     * @param $ruta
     * @param $request
     * @throws autenticacion\rest_error_autenticacion
     * @throws autorizacion\rest_error_autorizacion
     * @return rest_usuario
     */
    
public function manejar($ruta$request)
    {
        
/* RFC:
          401 Unauthorized:
              If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials.
          403 Forbidden:
              The server understood the request, but is refusing to fulfill it.
         */

        
$usuario $this->authentication->get_usuario($request);

        if (!
$this->authorization->tiene_acceso($usuario$ruta)) {
            if (
NULL === $usuario) {
                throw new 
rest_error_autenticacion($this->authentication);
            } else {
                throw new 
rest_error_autorizacion();
            }
        }
        return 
$usuario;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.6007 ]--