!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

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

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/packages/Webkul/Installer/src/Http/Controllers/   drwxrwxrwx
Free 12.97 GB of 57.97 GB (22.37%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Webkul\Installer\Http\Controllers;

use 
Illuminate\Http\Response as IlluminateResponse;
use 
Illuminate\Support\Facades\Cache;

class 
ImageCacheController
{
    
/**
     * Cache template
     *
     * @var string
     */
    
protected $template;

    
/**
     * Logo
     *
     * @var string
     */
    
const KRAYIN_LOGO 'https://updates.krayincrm.com/krayin.png';

    
/**
     * Get HTTP response of template applied image file
     *
     * @param  string  $filename
     * @return Illuminate\Http\Response
     */
    
public function getImage($filename)
    {
        try {
            
$content Cache::remember('krayin-logo'10080, function () {
                return 
$this->getImageFromUrl(self::KRAYIN_LOGO);
            });
        } catch (
\Exception $e) {
            
$content '';
        }

        return 
$this->buildResponse($content);
    }

    
/**
     * Init from given URL
     *
     * @param  string  $url
     * @return \Intervention\Image\Image
     */
    
public function getImageFromUrl($url)
    {
        
$domain config('app.url');

        
$options = [
            
'http' => [
                
'method'           => 'GET',
                
'protocol_version' => 1.1// force use HTTP 1.1 for service mesh environment with envoy
                
'header'           => "Accept-language: en\r\n".
                
"Domain: $domain\r\n".
                
"User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36\r\n",
            ],
        ];

        
$context stream_context_create($options);

        if (
$data = @file_get_contents($urlfalse$context)) {
            return 
$data;
        }

        throw new 
\Exception(
            
'Unable to init from given url ('.$url.').'
        
);
    }

    
/**
     * Builds HTTP response from given image data
     *
     * @param  string  $content
     * @return Illuminate\Http\Response
     */
    
protected function buildResponse($content)
    {
        
/**
         * Define mime type
         */
        
$mime finfo_buffer(finfo_open(FILEINFO_MIME_TYPE), $content);

        
/**
         * Respond with 304 not modified if browser has the image cached
         */
        
$eTag md5($content);

        
$notModified = isset($_SERVER['HTTP_IF_NONE_MATCH']) && $_SERVER['HTTP_IF_NONE_MATCH'] == $eTag;

        
$content $notModified null $content;

        
$statusCode $notModified 304 200;

        
/**
         * Return http response
         */
        
return new IlluminateResponse($content$statusCode, [
            
'Content-Type'   => $mime,
            
'Cache-Control'  => 'max-age=10080, public',
            
'Content-Length' => strlen($content),
            
'Etag'           => $eTag,
        ]);
    }
}

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