!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/sms.picotech.app/public_html/vendor/barryvdh/laravel-debugbar/src/Support/   drwxr-xr-x
Free 28.81 GB of 117.98 GB (24.42%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Barryvdh\Debugbar\Support;

use 
Exception;
use 
Illuminate\Database\ConnectionInterface;
use 
Illuminate\Database\QueryException;
use 
Illuminate\Support\Facades\DB;
use 
Illuminate\Support\Facades\Http;

class 
Explain
{
    public function 
isVisualExplainSupported(string $connection): bool
    
{
        
$driver DB::connection($connection)->getDriverName();
        if (
$driver === 'pgsql') {
            return 
true;
        }
        if (
$driver === 'mysql') {
            
// Laravel 11 added a new MariaDB database driver but older Laravel versions handle MySQL and MariaDB with
            // the same driver - and even with new versions you can use the MySQL driver while connection to a MariaDB
            // database. This query uses a feature implemented only in MariaDB to differentiate them.
            
try {
                
DB::connection($connection)->select('SELECT * FROM seq_1_to_1');

                return 
false;
            } catch (
QueryException) {
                
// This exception is expected when using MySQL as sequence tables are only available with MariaDB. So
                // the exception gets silenced as the check for MySQL has succeeded.
                
return true;
            }
        }

        return 
false;
    }

    public function 
confirmVisualExplain(string $connection): ?string
    
{
        return match (
DB::connection($connection)->getDriverName()) {
            
'mysql' => 'The query and EXPLAIN output is sent to mysqlexplain.com. Do you want to continue?',
            
'pgsql' => 'The query and EXPLAIN output is sent to explain.dalibo.com. Do you want to continue?',
            default => 
null,
        };
    }

    public function 
hash(string $connectionstring $sql, array $bindings): string
    
{
        
$bindings json_encode($bindings);

        return match (
DB::connection($connection)->getDriverName()) {
            
'mariadb''mysql''pgsql' => hash_hmac('sha256'"{$connection}::{$sql}::{$bindings}"config('app.key')),
            default => 
null,
        };
    }

    private function 
verify(string $connectionstring $sql, array $bindingsstring $hash): void
    
{
        if (!
hash_equals($this->hash($connection$sql$bindings), $hash)) {
            throw new 
Exception('Query to execute could not be verified.');
        }
    }

    public function 
generateRawExplain(string $connectionstring $sql, array $bindingsstring $hash): array
    {
        
$this->verify($connection$sql$bindings$hash);

        
$connection DB::connection($connection);

        return match (
$driver $connection->getDriverName()) {
            
'mariadb''mysql' => $connection->select("EXPLAIN {$sql}"$bindings),
            
'pgsql' => array_column($connection->select("EXPLAIN {$sql}"$bindings), 'QUERY PLAN'),
            default => throw new 
Exception("Visual explain not available for driver '{$driver}'."),
        };
    }

    public function 
generateVisualExplain(string $connectionstring $sql, array $bindingsstring $hash): string
    
{
        
$this->verify($connection$sql$bindings$hash);
        if (!
$this->isVisualExplainSupported($connection)) {
            throw new 
Exception('Visual explain not available for this connection.');
        }

        
$connection DB::connection($connection);

        return match (
$connection->getDriverName()) {
            
'mysql' => $this->generateVisualExplainMysql($connection$sql$bindings),
            
'pgsql' => $this->generateVisualExplainPgsql($connection$sql$bindings),
        };
    }

    private function 
generateVisualExplainMysql(ConnectionInterface $connectionstring $query, array $bindings): string
    
{
        return 
Http::withHeaders([
            
'User-Agent' => 'barryvdh/laravel-debugbar',
        ])->
post('https://api.mysqlexplain.com/v2/explains', [
            
'query' => $query,
            
'bindings' => $bindings,
            
'version' => $connection->selectOne("SELECT VERSION()")->{'VERSION()'},
            
'explain_json' => $connection->selectOne("EXPLAIN FORMAT=JSON {$query}"$bindings)->EXPLAIN,
            
'explain_tree' => rescue(fn () => $connection->selectOne("EXPLAIN FORMAT=TREE {$query}"$bindings)->EXPLAINreportfalse),
        ])->
throw()->json('url');
    }

    private function 
generateVisualExplainPgsql(ConnectionInterface $connectionstring $query, array $bindings): string
    
{
        return (string) 
Http::asForm()->post('https://explain.dalibo.com/new', [
            
'query' => $query,
            
'plan' => $connection->selectOne("EXPLAIN (FORMAT JSON) {$query}"$bindings)->{'QUERY PLAN'},
            
'title' => '',
        ])->
effectiveUri();
    }
}

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