!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/Script/Composer/   drwxr-xr-x
Free 28.77 GB of 117.98 GB (24.38%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

use 
Composer\Script\Event;
use 
Symfony\Component\Filesystem\Exception\IOException;
use 
Symfony\Component\Filesystem\Filesystem;

class 
Composer
{
    public static function 
removeUnusedServices(
        
Event      $event,
        
Filesystem $filesystem null
    
)
    {
        
$composer $event->getComposer();
        
$extra $composer->getPackage()->getExtra();
        
$listedServices = isset($extra['aws/aws-sdk-php'])
            ? 
$extra['aws/aws-sdk-php']
            : [];

        if (
$listedServices) {
            
$serviceMapping self::buildServiceMapping();
            
self::verifyListedServices($serviceMapping$listedServices);
            
$filesystem $filesystem ?: new Filesystem();
            
$vendorPath $composer->getConfig()->get('vendor-dir');
            
self::removeServiceDirs(
                
$event,
                
$filesystem,
                
$serviceMapping,
                
$listedServices,
                
$vendorPath
            
);
        } else {
            throw new 
\InvalidArgumentException(
                
'There are no services listed. Did you intend to use this script?'
            
);
        }
    }

    public static function 
buildServiceMapping()
    {
        
$serviceMapping = [];
        
$manifest = require(__DIR__ '/../../data/manifest.json.php');

        foreach (
$manifest as $service => $attributes) {
            
$serviceMapping[$attributes['namespace']] = $service;
        }

        return 
$serviceMapping;
    }

    private static function 
verifyListedServices($serviceMapping$listedServices)
    {
        foreach (
$listedServices as $serviceToKeep) {
            if (!isset(
$serviceMapping[$serviceToKeep])) {
                throw new 
\InvalidArgumentException(
                    
"'$serviceToKeep' is not a valid AWS service namespace. Please check spelling and casing."
                
);
            }
        }
    }

    private static function 
removeServiceDirs(
        
$event,
        
$filesystem,
        
$serviceMapping,
        
$listedServices,
        
$vendorPath
    
) {
        
$unsafeForDeletion = ['Kms''S3''SSO''SSOOIDC''Sts'];
        if (
in_array('DynamoDbStreams'$listedServices)) {
            
$unsafeForDeletion[] = 'DynamoDb';
        }

        
$clientPath $vendorPath '/aws/aws-sdk-php/src/';
        
$modelPath $clientPath 'data/';
        
$deleteCount 0;

        foreach (
$serviceMapping as $clientName => $modelName) {
            if (!
in_array($clientName$listedServices) &&
                !
in_array($clientName$unsafeForDeletion)
            ) {
                
$clientDir $clientPath $clientName;
                
$modelDir $modelPath $modelName;

                if (
$filesystem->exists([$clientDir$modelDir])) {
                    
$attempts 3;
                    
$delay 2;

                    while (
$attempts) {
                        try {
                            
$filesystem->remove([$clientDir$modelDir]);
                            
$deleteCount++;
                            break;
                        } catch (
IOException $e) {
                            
$attempts--;

                            if (!
$attempts) {
                                throw new 
IOException(
                                    
"Removal failed after several attempts. Last error: " $e->getMessage()
                                );
                            } else {
                                
sleep($delay);
                                
$event->getIO()->write(
                                    
"Error encountered: " $e->getMessage() . ". Retrying..."
                                
);
                                
$delay += 2;
                            }
                    }
                }

                }
            }
        }
        
$event->getIO()->write(
            
"Removed $deleteCount AWS service" . ($deleteCount === '' 's')
        );
    }
}

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