!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_led/php/nucleo/lib/   drwxrwxr-x
Free 14.72 GB of 61.93 GB (23.77%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     toba_servicio_web_cliente_rest.php (3.01 KB)      -rwxrwxr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

class toba_servicio_web_cliente_rest extends toba_servicio_web_cliente
{
    const 
HEADER_VERSION 'API-Version';
    const 
VERIFY_PEER_VAR 'TOBA_REST_VERIFY_PEER';
    protected 
$guzzle;
    private 
$toba_verify_peer true;
    
    function 
__construct($opciones$id_servicio$proyecto null
    {
        
parent::__construct($opciones$id_servicio$proyecto);
        
$entorno getenv(self::VERIFY_PEER_VAR);
        if (
$entorno !== false) {
            
$this->toba_verify_peer = ($entorno == '1');
        }
    }

    static function 
conectar($id_servicio$opciones=array(), $proyecto null)
    {
        if (! isset(
$proyecto)) {
            
$proyecto toba_editor::activado() ? toba_editor::get_proyecto_cargado() : toba::proyecto()->get_id();
        }
        
self::get_modelo_proyecto($proyecto);
        
$ini toba_modelo_rest::get_ini_cliente(self::$modelo_proyecto$id_servicio);

        
$opciones_ini $ini->get_datos_entrada('conexion');

        
//Convierte todos los '1' de texto en true
        
foreach (array_keys($opciones_ini) as $id_opcion) {
            if (
$opciones_ini[$id_opcion] === '1' || $opciones_ini[$id_opcion] === 1) {
                
$opciones_ini[$id_opcion] = true;
            }
        }

        
//-- Mezcla con las opciones recibidas y crea el objeto
        
$opciones array_merge($opciones_ini$opciones);

        if (! isset(
$opciones['to'])) {
            throw new 
toba_error_def("Debe indicar la URL destino en el campo 'to'");
        }

        
toba::logger()->debug("Invocando servicio $id_servicio. Opciones:<br>"var_export($opcionestrue));

        
$servicio = new toba_servicio_web_cliente_rest($opciones$id_servicio);

        return 
$servicio;
    }
    
    
/**
     * @return GuzzleHttp\Client
     */
    
function guzzle()
    {
        if (! isset(
$this->guzzle)) {
            
$this->guzzle $client = new GuzzleHttp\Client(['base_url' => $this->opciones['to']]);            
            if (isset(
$this->opciones['auth_tipo'])) {
                if (
$this->opciones['auth_tipo'] != 'ssl') {
                    
$this->guzzle->setDefaultOption('auth',  array($this->opciones['auth_usuario'], $this->opciones['auth_password'], $this->opciones['auth_tipo']));
                } else {                    
                    if (isset(
$this->opciones['cert_file'])) {
                        if (isset(
$this->opciones['cert_pwd'])) {    
                            
$this->guzzle->setDefaultOption('cert', array(realpath($this->opciones['cert_file']), $this->opciones['cert_pwd']));
                        } else {                            
                            
$this->guzzle->setDefaultOption('cert'realpath($this->opciones['cert_file']));
                        }
                    }
                    if (isset(
$this->opciones['key_file'])) {
                        
$this->guzzle->setDefaultOption('ssl_key'realpath($this->opciones['key_file']));
                    }                    
                    
//Agrego el certificado de la CA para verificar el certificado del servidor
                    
if (isset($this->opciones['ca_cert'])) {
                        
$this->guzzle->setDefaultOption('verify', array($this->opciones['ca_cert']));
                    } else {
                        
$this->guzzle->setDefaultOption('verify'$this->toba_verify_peer);
                    }
                }
            }
        }
        return 
$this->guzzle;    
    }

    static function 
get_version_api($response)
    {        
        if (
$response->hasHeader(self::HEADER_VERSION)) {
            
$string_version $response->getHeader(self::HEADER_VERSION);
            return new 
toba_version($string_version);
        } else {
            return 
null;
        }
    }
}

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