Linux ns1.utparral.edu.mx 6.8.0-79-generic #79~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 15 16:54:53 UTC 2 x86_64
Apache/2.4.58 (Unix) OpenSSL/1.1.1w PHP/8.2.12 mod_perl/2.0.12 Perl/v5.34.1
: 10.10.1.9 | : 10.10.1.254
Cant Read [ /etc/named.conf ]
daemon
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
README
+ Create Folder
+ Create File
/
opt /
lampp /
htdocs /
phpMyAdmin /
libraries /
[ HOME SHELL ]
Name
Size
Permission
Action
certs
[ DIR ]
drwxrwxr-x
config
[ DIR ]
drwxrwxr-x
controllers
[ DIR ]
drwxrwxr-x
dbi
[ DIR ]
drwxrwxr-x
di
[ DIR ]
drwxrwxr-x
engines
[ DIR ]
drwxrwxr-x
gis
[ DIR ]
drwxrwxr-x
navigation
[ DIR ]
drwxrwxr-x
plugins
[ DIR ]
drwxrwxr-x
properties
[ DIR ]
drwxrwxr-x
rte
[ DIR ]
drwxrwxr-x
.1724597954
0
B
-rwxrwxr-x
.1724621370
0
B
-rwxrwxr-x
.1724621595
0
B
-rwxrwxr-x
.1724693108
0
B
-rwxrwxr-x
.1724693161
0
B
-rwxrwxr-x
.1724693163
0
B
-rwxrwxr-x
.1724716554
0
B
-rwxrwxr-x
.1724716619
0
B
-rwxrwxr-x
.1724995546
0
B
-rwxrwxr-x
.1725018452
0
B
-rwxrwxr-x
.1725018571
0
B
-rwxrwxr-x
.1725018746
0
B
-rwxrwxr-x
.1725030833
0
B
-rwxrwxr-x
.1725030838
0
B
-rwxrwxr-x
.1725030897
0
B
-rwxrwxr-x
.1725030901
0
B
-rwxrwxr-x
advisor.lib.php
1.58
KB
-rwxrwxr-x
Advisor.php
16.32
KB
-rwxrwxr-x
advisory_rules.txt
25.94
KB
-rwxrwxr-x
Bookmark.php
9.76
KB
-rwxrwxr-x
browse_foreigners.lib.php
9.63
KB
-rwxrwxr-x
central_columns.lib.php
49.24
KB
-rwxrwxr-x
Charsets.php
22.67
KB
-rwxrwxr-x
check_user_privileges.lib.php
11
KB
-rwxrwxr-x
common.inc.php
29.21
KB
-rwxrwxr-x
config.default.php
65.5
KB
-rwxrwxr-x
Config.php
55.12
KB
-rwxrwxr-x
config.values.php
10.24
KB
-rwxrwxr-x
Console.php
3.38
KB
-rwxrwxr-x
core.lib.php
29.45
KB
-rwxrwxr-x
create_addfield.lib.php
15.7
KB
-rwxrwxr-x
database_interface.inc.php
2.63
KB
-rwxrwxr-x
DatabaseInterface.php
95.6
KB
-rwxrwxr-x
db_common.inc.php
3.04
KB
-rwxrwxr-x
db_designer.lib.php
10.77
KB
-rwxrwxr-x
DbList.php
1.91
KB
-rwxrwxr-x
DbQbe.php
68.78
KB
-rwxrwxr-x
DbSearch.php
17.06
KB
-rwxrwxr-x
display_change_password.lib.php
6.15
KB
-rwxrwxr-x
display_create_table.lib.php
1.53
KB
-rwxrwxr-x
display_export.lib.php
35.53
KB
-rwxrwxr-x
display_git_revision.lib.php
2.88
KB
-rwxrwxr-x
display_import_ajax.lib.php
3.13
KB
-rwxrwxr-x
display_import.lib.php
24.38
KB
-rwxrwxr-x
DisplayResults.php
206.87
KB
-rwxrwxr-x
Encoding.php
8.93
KB
-rwxrwxr-x
ErrorHandler.php
16.41
KB
-rwxrwxr-x
error.inc.php
1.27
KB
-rwxrwxr-x
Error.php
12.87
KB
-rwxrwxr-x
error_report.lib.php
9.25
KB
-rwxrwxr-x
file_listing.lib.php
2.37
KB
-rwxrwxr-x
File.php
20.62
KB
-rwxrwxr-x
Font.php
4.24
KB
-rwxrwxr-x
Footer.php
10.29
KB
-rwxrwxr-x
Header.php
25.21
KB
-rwxrwxr-x
import.lib.php
49.9
KB
-rwxrwxr-x
inc.php
30.99
KB
-rwxrwxr-x
IndexColumn.php
4.46
KB
-rwxrwxr-x
index.lib.php
1.13
KB
-rwxrwxr-x
Index.php
23.38
KB
-rwxrwxr-x
information_schema_relations.lib.php
10.95
KB
-rwxrwxr-x
insert_edit.lib.php
112.42
KB
-rwxrwxr-x
ip_allow_deny.lib.php
8.09
KB
-rwxrwxr-x
LanguageManager.php
22.63
KB
-rwxrwxr-x
Language.php
4.21
KB
-rwxrwxr-x
language_stats.inc.php
1.5
KB
-rwxrwxr-x
Linter.php
5.09
KB
-rwxrwxr-x
ListAbstract.php
3.15
KB
-rwxrwxr-x
ListDatabase.php
4.63
KB
-rwxrwxr-x
Logging.php
1023
B
-rwxrwxr-x
Menu.php
21.36
KB
-rwxrwxr-x
Message.php
19.14
KB
-rwxrwxr-x
mime.lib.php
704
B
-rwxrwxr-x
mult_submits.inc.php
10.46
KB
-rwxrwxr-x
mult_submits.lib.php
20.45
KB
-rwxrwxr-x
normalization.lib.php
33.97
KB
-rwxrwxr-x
OpenDocument.php
8.52
KB
-rwxrwxr-x
operations.lib.php
71.3
KB
-rwxrwxr-x
OutputBuffering.php
3.59
KB
-rwxrwxr-x
parse_analyze.lib.php
2.18
KB
-rwxrwxr-x
Partition.php
9
KB
-rwxrwxr-x
PDF.php
3.92
KB
-rwxrwxr-x
plugin_interface.lib.php
19.69
KB
-rwxrwxr-x
pmd_common.php
24.1
KB
-rwxrwxr-x
RecentFavoriteTable.php
11.79
KB
-rwxrwxr-x
relation_cleanup.lib.php
13.84
KB
-rwxrwxr-x
relation.lib.php
68.74
KB
-rwxrwxr-x
replication_gui.lib.php
37.24
KB
-rwxrwxr-x
replication.inc.php
9.33
KB
-rwxrwxr-x
Response.php
12.05
KB
-rwxrwxr-x
Sanitize.php
14.1
KB
-rwxrwxr-x
SavedSearches.php
11.67
KB
-rwxrwxr-x
Scripts.php
6.59
KB
-rwxrwxr-x
select_server.lib.php
3.52
KB
-rwxrwxr-x
server_common.inc.php
1.24
KB
-rwxrwxr-x
server_common.lib.php
1.92
KB
-rwxrwxr-x
server_privileges.lib.php
171.6
KB
-rwxrwxr-x
server_status_advisor.lib.php
1.89
KB
-rwxrwxr-x
ServerStatusData.php
15.7
KB
-rwxrwxr-x
server_status.lib.php
9.84
KB
-rwxrwxr-x
server_status_monitor.lib.php
26.31
KB
-rwxrwxr-x
server_status_processes.lib.php
9.4
KB
-rwxrwxr-x
server_status_queries.lib.php
4.9
KB
-rwxrwxr-x
server_status_variables.lib.php
28.85
KB
-rwxrwxr-x
server_user_groups.lib.php
12.71
KB
-rwxrwxr-x
server_users.lib.php
1.32
KB
-rwxrwxr-x
session.lib.php
1.11
KB
-rwxrwxr-x
special_schema_links.lib.php
17.51
KB
-rwxrwxr-x
sql.lib.php
77.55
KB
-rwxrwxr-x
sql_query_form.lib.php
15.78
KB
-rwxrwxr-x
StorageEngine.php
13.51
KB
-rwxrwxr-x
string.lib.php
800
B
-rwxrwxr-x
stringMb.lib.php
1.85
KB
-rwxrwxr-x
stringNative.lib.php
6.82
KB
-rwxrwxr-x
SubPartition.php
3.52
KB
-rwxrwxr-x
sysinfo.lib.php
1.35
KB
-rwxrwxr-x
SysInfoLinux.php
1.92
KB
-rwxrwxr-x
SysInfo.php
800
B
-rwxrwxr-x
SysInfoSunOS.php
1.86
KB
-rwxrwxr-x
SysInfoWINNT.php
3.08
KB
-rwxrwxr-x
SystemDatabase.php
3.66
KB
-rwxrwxr-x
Table.php
86.78
KB
-rwxrwxr-x
tbl_columns_definition_form.inc.php
13.84
KB
-rwxrwxr-x
tbl_common.inc.php
1.71
KB
-rwxrwxr-x
tbl_info.inc.php
3.54
KB
-rwxrwxr-x
Template.php
4.42
KB
-rwxrwxr-x
ThemeManager.php
12.25
KB
-rwxrwxr-x
Theme.php
12.68
KB
-rwxrwxr-x
Tracker.php
28.76
KB
-rwxrwxr-x
tracking.lib.php
54.52
KB
-rwxrwxr-x
tracking.php
393
B
-rwxrwxr-x
transformations.lib.php
14.62
KB
-rwxrwxr-x
TypesMySQL.php
17.26
KB
-rwxrwxr-x
Types.php
6.08
KB
-rwxrwxr-x
URL.php
8.42
KB
-rwxrwxr-x
user_preferences.inc.php
2.41
KB
-rwxrwxr-x
user_preferences.lib.php
8.28
KB
-rwxrwxr-x
util.lib.php
749
B
-rwxrwxr-x
Util.php
169.69
KB
-rwxrwxr-x
vendor_config.php
2.07
KB
-rwxrwxr-x
VersionInformation.php
6.34
KB
-rwxrwxr-x
zip_extension.lib.php
5.81
KB
-rwxrwxr-x
ZipFile.php
6.63
KB
-rwxrwxr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : Advisor.php
<?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * A simple rules engine, that parses and executes the rules in advisory_rules.txt. * Adjusted to phpMyAdmin. * * @package PhpMyAdmin */ namespace PMA\libraries; use \Exception; use PMA\libraries\URL; require_once 'libraries/advisor.lib.php'; /** * Advisor class * * @package PhpMyAdmin */ class Advisor { protected $variables; protected $parseResult; protected $runResult; /** * Get variables * * @return mixed */ public function getVariables() { return $this->variables; } /** * Set variables * * @param array $variables Variables * * @return Advisor */ public function setVariables($variables) { $this->variables = $variables; return $this; } /** * Set a variable and its value * * @param string|int $variable Variable to set * @param mixed $value Value to set * * @return $this */ public function setVariable($variable, $value) { $this->variables[$variable] = $value; return $this; } /** * Get parseResult * * @return mixed */ public function getParseResult() { return $this->parseResult; } /** * Set parseResult * * @param array $parseResult Parse result * * @return Advisor */ public function setParseResult($parseResult) { $this->parseResult = $parseResult; return $this; } /** * Get runResult * * @return mixed */ public function getRunResult() { return $this->runResult; } /** * Set runResult * * @param array $runResult Run result * * @return Advisor */ public function setRunResult($runResult) { $this->runResult = $runResult; return $this; } /** * Parses and executes advisor rules * * @return array with run and parse results */ public function run() { // HowTo: A simple Advisory system in 3 easy steps. // Step 1: Get some variables to evaluate on $this->setVariables( array_merge( $GLOBALS['dbi']->fetchResult('SHOW GLOBAL STATUS', 0, 1), $GLOBALS['dbi']->fetchResult('SHOW GLOBAL VARIABLES', 0, 1) ) ); // Add total memory to variables as well include_once 'libraries/sysinfo.lib.php'; $sysinfo = PMA_getSysInfo(); $memory = $sysinfo->memory(); $this->variables['system_memory'] = isset($memory['MemTotal']) ? $memory['MemTotal'] : 0; $this->variables['PMA_MYSQL_INT_VERSION'] = PMA_MYSQL_INT_VERSION; // Step 2: Read and parse the list of rules $this->setParseResult(static::parseRulesFile()); // Step 3: Feed the variables to the rules and let them fire. Sets // $runResult $this->runRules(); return array( 'parse' => array('errors' => $this->parseResult['errors']), 'run' => $this->runResult ); } /** * Stores current error in run results. * * @param string $description description of an error. * @param Exception $exception exception raised * * @return void */ public function storeError($description, $exception) { $this->runResult['errors'][] = $description . ' ' . sprintf( __('PHP threw following error: %s'), $exception->getMessage() ); } /** * Executes advisor rules * * @return boolean */ public function runRules() { $this->setRunResult( array( 'fired' => array(), 'notfired' => array(), 'unchecked' => array(), 'errors' => array(), ) ); foreach ($this->parseResult['rules'] as $rule) { $this->variables['value'] = 0; $precond = true; if (isset($rule['precondition'])) { try { $precond = $this->ruleExprEvaluate($rule['precondition']); } catch (Exception $e) { $this->storeError( sprintf( __('Failed evaluating precondition for rule \'%s\'.'), $rule['name'] ), $e ); continue; } } if (! $precond) { $this->addRule('unchecked', $rule); } else { try { $value = $this->ruleExprEvaluate($rule['formula']); } catch (Exception $e) { $this->storeError( sprintf( __('Failed calculating value for rule \'%s\'.'), $rule['name'] ), $e ); continue; } $this->variables['value'] = $value; try { if ($this->ruleExprEvaluate($rule['test'])) { $this->addRule('fired', $rule); } else { $this->addRule('notfired', $rule); } } catch (Exception $e) { $this->storeError( sprintf( __('Failed running test for rule \'%s\'.'), $rule['name'] ), $e ); } } } return true; } /** * Escapes percent string to be used in format string. * * @param string $str string to escape * * @return string */ public static function escapePercent($str) { return preg_replace('/%( |,|\.|$|\(|\)|<|>)/', '%%\1', $str); } /** * Wrapper function for translating. * * @param string $str the string * @param string $param the parameters * * @return string */ public function translate($str, $param = null) { $string = _gettext(self::escapePercent($str)); if (! is_null($param)) { $params = $this->ruleExprEvaluate('array(' . $param . ')'); } else { $params = array(); } return vsprintf($string, $params); } /** * Splits justification to text and formula. * * @param array $rule the rule * * @return string[] */ public static function splitJustification($rule) { $jst = preg_split('/\s*\|\s*/', $rule['justification'], 2); if (count($jst) > 1) { return array($jst[0], $jst[1]); } return array($rule['justification']); } /** * Adds a rule to the result list * * @param string $type type of rule * @param array $rule rule itself * * @return void */ public function addRule($type, $rule) { switch ($type) { case 'notfired': case 'fired': $jst = self::splitJustification($rule); if (count($jst) > 1) { try { /* Translate */ $str = $this->translate($jst[0], $jst[1]); } catch (Exception $e) { $this->storeError( sprintf( __('Failed formatting string for rule \'%s\'.'), $rule['name'] ), $e ); return; } $rule['justification'] = $str; } else { $rule['justification'] = $this->translate($rule['justification']); } $rule['id'] = $rule['name']; $rule['name'] = $this->translate($rule['name']); $rule['issue'] = $this->translate($rule['issue']); // Replaces {server_variable} with 'server_variable' // linking to server_variables.php $rule['recommendation'] = preg_replace_callback( '/\{([a-z_0-9]+)\}/Ui', array($this, 'replaceVariable'), $this->translate($rule['recommendation']) ); // Replaces external Links with PMA_linkURL() generated links $rule['recommendation'] = preg_replace_callback( '#href=("|\')(https?://[^\1]+)\1#i', array($this, 'replaceLinkURL'), $rule['recommendation'] ); break; } $this->runResult[$type][] = $rule; } /** * Callback for wrapping links with PMA_linkURL * * @param array $matches List of matched elements form preg_replace_callback * * @return string Replacement value */ private function replaceLinkURL($matches) { return 'href="' . PMA_linkURL($matches[2]) . '" target="_blank" rel="noopener noreferrer"'; } /** * Callback for wrapping variable edit links * * @param array $matches List of matched elements form preg_replace_callback * * @return string Replacement value */ private function replaceVariable($matches) { return '<a href="server_variables.php' . URL::getCommon(array('filter' => $matches[1])) . '">' . htmlspecialchars($matches[1]). '</a>'; } /** * Callback for evaluating fired() condition. * * @param array $matches List of matched elements form preg_replace_callback * * @return string Replacement value */ private function ruleExprEvaluateFired($matches) { // No list of fired rules if (!isset($this->runResult['fired'])) { return '0'; } // Did matching rule fire? foreach ($this->runResult['fired'] as $rule) { if ($rule['id'] == $matches[2]) { return '1'; } } return '0'; } /** * Callback for evaluating variables in expression. * * @param array $matches List of matched elements form preg_replace_callback * * @return string Replacement value */ private function ruleExprEvaluateVariable($matches) { $match = $matches[1]; /* Numbers */ if (is_numeric($match)) { return $match; } /* Functions */ $functions = array( 'round', 'substr', 'preg_match', 'array', 'ADVISOR_bytime', 'ADVISOR_timespanFormat', 'ADVISOR_formatByteDown' ); if (in_array($match, $functions)) { return $match; } /* Unknown variable */ if (! isset($this->variables[$match])) { return $match; } /* Variable value */ if (is_numeric($this->variables[$match])) { return $this->variables[$match]; } else { return '\'' . addslashes($this->variables[$match]) . '\''; } } /** * Runs a code expression, replacing variable names with their respective * values * * @param string $expr expression to evaluate * * @return integer result of evaluated expression * * @throws Exception */ public function ruleExprEvaluate($expr) { // Evaluate fired() conditions $expr = preg_replace_callback( '/fired\s*\(\s*(\'|")(.*)\1\s*\)/Ui', array($this, 'ruleExprEvaluateFired'), $expr ); // Evaluate variables $expr = preg_replace_callback( '/\b(\w+)\b/', array($this, 'ruleExprEvaluateVariable'), $expr ); $value = 0; $err = 0; // Actually evaluate the code ob_start(); try { // TODO: replace by using symfony/expression-language eval('$value = ' . $expr . ';'); $err = ob_get_contents(); } catch (Exception $e) { // In normal operation, there is just output in the buffer, // but when running under phpunit, error in eval raises exception $err = $e->getMessage(); } ob_end_clean(); // Error handling if ($err) { // Remove PHP 7.2 and newer notice (it's not really interesting for user) throw new Exception( str_replace( ' (this will throw an Error in a future version of PHP)', '', strip_tags($err) ) . '<br />Executed code: $value = ' . htmlspecialchars($expr) . ';' ); } return $value; } /** * Reads the rule file into an array, throwing errors messages on syntax * errors. * * @return array with parsed data */ public static function parseRulesFile() { $filename = 'libraries/advisory_rules.txt'; $file = file($filename, FILE_IGNORE_NEW_LINES); $errors = array(); $rules = array(); $lines = array(); if ($file === FALSE) { $errors[] = sprintf( __('Error in reading file: The file \'%s\' does not exist or is not readable!'), $filename ); return array('rules' => $rules, 'lines' => $lines, 'errors' => $errors); } $ruleSyntax = array( 'name', 'formula', 'test', 'issue', 'recommendation', 'justification' ); $numRules = count($ruleSyntax); $numLines = count($file); $ruleNo = -1; $ruleLine = -1; for ($i = 0; $i < $numLines; $i++) { $line = $file[$i]; if ($line == "" || $line[0] == '#') { continue; } // Reading new rule if (substr($line, 0, 4) == 'rule') { if ($ruleLine > 0) { $errors[] = sprintf( __( 'Invalid rule declaration on line %1$s, expected line ' . '%2$s of previous rule.' ), $i + 1, $ruleSyntax[$ruleLine++] ); continue; } if (preg_match("/rule\s'(.*)'( \[(.*)\])?$/", $line, $match)) { $ruleLine = 1; $ruleNo++; $rules[$ruleNo] = array('name' => $match[1]); $lines[$ruleNo] = array('name' => $i + 1); if (isset($match[3])) { $rules[$ruleNo]['precondition'] = $match[3]; $lines[$ruleNo]['precondition'] = $i + 1; } } else { $errors[] = sprintf( __('Invalid rule declaration on line %s.'), $i + 1 ); } continue; } else { if ($ruleLine == -1) { $errors[] = sprintf( __('Unexpected characters on line %s.'), $i + 1 ); } } // Reading rule lines if ($ruleLine > 0) { if (!isset($line[0])) { continue; // Empty lines are ok } // Non tabbed lines are not if ($line[0] != "\t") { $errors[] = sprintf( __( 'Unexpected character on line %1$s. Expected tab, but ' . 'found "%2$s".' ), $i + 1, $line[0] ); continue; } $rules[$ruleNo][$ruleSyntax[$ruleLine]] = chop( mb_substr($line, 1) ); $lines[$ruleNo][$ruleSyntax[$ruleLine]] = $i + 1; ++$ruleLine; } // Rule complete if ($ruleLine == $numRules) { $ruleLine = -1; } } return array('rules' => $rules, 'lines' => $lines, 'errors' => $errors); } }
Close