!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/PhpMyAdmin/SqlParser/Statements/   drwxr-xr-x
Free 83.37 GB of 96.73 GB (86.19%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     InsertStatement.php (7.28 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
 * `INSERT` statement.
 */

declare(strict_types=1);

namespace 
PhpMyAdmin\SqlParser\Statements;

use 
PhpMyAdmin\SqlParser\Components\Array2d;
use 
PhpMyAdmin\SqlParser\Components\ArrayObj;
use 
PhpMyAdmin\SqlParser\Components\IntoKeyword;
use 
PhpMyAdmin\SqlParser\Components\OptionsArray;
use 
PhpMyAdmin\SqlParser\Components\SetOperation;
use 
PhpMyAdmin\SqlParser\Parser;
use 
PhpMyAdmin\SqlParser\Statement;
use 
PhpMyAdmin\SqlParser\Token;
use 
PhpMyAdmin\SqlParser\TokensList;
use function 
count;
use function 
strlen;
use function 
trim;

/**
 * `INSERT` statement.
 *
 * INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
 *     [INTO] tbl_name
 *     [PARTITION (partition_name,...)]
 *     [(col_name,...)]
 *     {VALUES | VALUE} ({expr | DEFAULT},...),(...),...
 *     [ ON DUPLICATE KEY UPDATE
 *       col_name=expr
 *         [, col_name=expr] ... ]
 *
 * or
 *
 * INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
 *     [INTO] tbl_name
 *     [PARTITION (partition_name,...)]
 *     SET col_name={expr | DEFAULT}, ...
 *     [ ON DUPLICATE KEY UPDATE
 *       col_name=expr
 *         [, col_name=expr] ... ]
 *
 * or
 *
 * INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE]
 *     [INTO] tbl_name
 *     [PARTITION (partition_name,...)]
 *     [(col_name,...)]
 *     SELECT ...
 *     [ ON DUPLICATE KEY UPDATE
 *       col_name=expr
 *         [, col_name=expr] ... ]
 */
class InsertStatement extends Statement
{
    
/**
     * Options for `INSERT` statements.
     *
     * @var array
     */
    
public static $OPTIONS = [
        
'LOW_PRIORITY' => 1,
        
'DELAYED' => 2,
        
'HIGH_PRIORITY' => 3,
        
'IGNORE' => 4,
    ];

    
/**
     * Tables used as target for this statement.
     *
     * @var IntoKeyword
     */
    
public $into;

    
/**
     * Values to be inserted.
     *
     * @var ArrayObj[]|null
     */
    
public $values;

    
/**
     * If SET clause is present
     * holds the SetOperation.
     *
     * @var SetOperation[]
     */
    
public $set;

    
/**
     * If SELECT clause is present
     * holds the SelectStatement.
     *
     * @var SelectStatement
     */
    
public $select;

    
/**
     * If ON DUPLICATE KEY UPDATE clause is present
     * holds the SetOperation.
     *
     * @var SetOperation[]
     */
    
public $onDuplicateSet;

    
/**
     * @return string
     */
    
public function build()
    {
        
$ret 'INSERT ' $this->options;
        
$ret trim($ret) . ' INTO ' $this->into;

        if (
$this->values !== null && count($this->values) > 0) {
            
$ret .= ' VALUES ' Array2d::build($this->values);
        } elseif (
$this->set !== null && count($this->set) > 0) {
            
$ret .= ' SET ' SetOperation::build($this->set);
        } elseif (
$this->select !== null && strlen((string) $this->select) > 0) {
            
$ret .= ' ' $this->select->build();
        }

        if (
$this->onDuplicateSet !== null && count($this->onDuplicateSet) > 0) {
            
$ret .= ' ON DUPLICATE KEY UPDATE ' SetOperation::build($this->onDuplicateSet);
        }

        return 
$ret;
    }

    
/**
     * @param Parser     $parser the instance that requests parsing
     * @param TokensList $list   the list of tokens to be parsed
     */
    
public function parse(Parser $parserTokensList $list)
    {
        ++
$list->idx// Skipping `INSERT`.

        // parse any options if provided
        
$this->options OptionsArray::parse(
            
$parser,
            
$list,
            static::
$OPTIONS
        
);
        ++
$list->idx;

        
/**
         * The state of the parser.
         *
         * Below are the states of the parser.
         *
         *      0 ---------------------------------[ INTO ]----------------------------------> 1
         *
         *      1 -------------------------[ VALUES/VALUE/SET/SELECT ]-----------------------> 2
         *
         *      2 -------------------------[ ON DUPLICATE KEY UPDATE ]-----------------------> 3
         *
         * @var int
         */
        
$state 0;

        
/**
         * For keeping track of semi-states on encountering
         * ON DUPLICATE KEY UPDATE ...
         */
        
$miniState 0;

        for (; 
$list->idx $list->count; ++$list->idx) {
            
/**
             * Token parsed at this moment.
             *
             * @var Token
             */
            
$token $list->tokens[$list->idx];

            
// End of statement.
            
if ($token->type === Token::TYPE_DELIMITER) {
                break;
            }

            
// Skipping whitespaces and comments.
            
if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) {
                continue;
            }

            if (
$state === 0) {
                if (
$token->type === Token::TYPE_KEYWORD
                    
&& $token->keyword !== 'INTO'
                
) {
                    
$parser->error('Unexpected keyword.'$token);
                    break;
                }

                ++
$list->idx;
                
$this->into IntoKeyword::parse(
                    
$parser,
                    
$list,
                    [
'fromInsert' => true]
                );

                
$state 1;
            } elseif (
$state === 1) {
                if (
$token->type === Token::TYPE_KEYWORD) {
                    if (
$token->keyword === 'VALUE'
                        
|| $token->keyword === 'VALUES'
                    
) {
                        ++
$list->idx// skip VALUES

                        
$this->values Array2d::parse($parser$list);
                    } elseif (
$token->keyword === 'SET') {
                        ++
$list->idx// skip SET

                        
$this->set SetOperation::parse($parser$list);
                    } elseif (
$token->keyword === 'SELECT') {
                        
$this->select = new SelectStatement($parser$list);
                    } else {
                        
$parser->error(
                            
'Unexpected keyword.',
                            
$token
                        
);
                        break;
                    }

                    
$state 2;
                    
$miniState 1;
                } else {
                    
$parser->error(
                        
'Unexpected token.',
                        
$token
                    
);
                    break;
                }
            } elseif (
$state === 2) {
                
$lastCount $miniState;

                if (
$miniState === && $token->keyword === 'ON') {
                    ++
$miniState;
                } elseif (
$miniState === && $token->keyword === 'DUPLICATE') {
                    ++
$miniState;
                } elseif (
$miniState === && $token->keyword === 'KEY') {
                    ++
$miniState;
                } elseif (
$miniState === && $token->keyword === 'UPDATE') {
                    ++
$miniState;
                }

                if (
$lastCount === $miniState) {
                    
$parser->error(
                        
'Unexpected token.',
                        
$token
                    
);
                    break;
                }

                if (
$miniState === 5) {
                    ++
$list->idx;
                    
$this->onDuplicateSet SetOperation::parse($parser$list);
                    
$state 3;
                }
            }
        }

        --
$list->idx;
    }
}

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