AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/mysql-test/t/initialize-sha256.test
--source include/big_test.inc
--source include/not_embedded.inc
--source include/have_no_undo_tablespaces.inc
--source include/have_ssl.inc
--source include/have_sha256_rsa_auth.inc


let BASEDIR= `select @@basedir`;
let DDIR=$MYSQL_TMP_DIR/installdb_test;
let MYSQLD_LOG=$MYSQL_TMP_DIR/server.log;
let extra_args=--no-defaults --console --log-syslog=0 --basedir=$BASEDIR --lc-messages-dir=$MYSQL_SHAREDIR;
let BOOTSTRAP_SQL=$MYSQL_TMP_DIR/tiny_bootstrap.sql;
let PASSWD_FILE=$MYSQL_TMP_DIR/password_file.txt;

--echo # We don't care about innodb warnings at this point
CALL mtr.add_suppression("InnoDB:");

--echo # Save the count of columns in mysql
--let $mysql_cnt=`SELECT COUNT(COLUMN_NAME) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='mysql'`

--echo # shut server down
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--echo # Server is down


--echo #
--echo # Try --initialize --default-authentication-plugin=sha256_password
--echo #

--echo # Run the server with --initialize --default-authentication-plugin=sha256_password
--exec $MYSQLD $extra_args --initialize --default-authentication-plugin=sha256_password --datadir=$DDIR > $MYSQLD_LOG 2>&1

--echo extract the root password
--perl
  use strict;
  my $log= $ENV{'MYSQLD_LOG'} or die;
  my $passwd_file= $ENV{'PASSWD_FILE'} or die;
  my $FILE;
  open(FILE, "$log") or die;
  while (my $row = <FILE>)
  {
    if ($row =~ m/.*A temporary password is generated for root.localhost: ([^ \n][^ \n]*)/)
    {
      my $passwd=$1;
      print "password found\n";
      my $OUT_FILE;
      open(OUT_FILE, "> $passwd_file");
      print OUT_FILE "delimiter lessprobability;\n";
      print OUT_FILE "let new_pwd=$passwd";
      print OUT_FILE "lessprobability\n";
      print OUT_FILE "--delimiter ;\n";
      close(OUT_FILE);
    }
  }
  close(FILE);
EOF

source $passwd_file;

--echo # Restart the server against DDIR
--exec echo "restart:--datadir=$DDIR --default-authentication-plugin=sha256_password " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc

--echo # connect as root
connect(root_con,localhost,root,$new_pwd,mysql);

--echo # must fail due to password expiration
--error ER_MUST_CHANGE_PASSWORD
SELECT 1;

--echo # reset the password
SET PASSWORD='';

--echo # Check the count of columns in mysql
--let $cnt=`SELECT COUNT(COLUMN_NAME) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='mysql';`
if ($cnt != $mysql_cnt)
{
--echo # Column count doesn't match. mtr=$mysql_cnt server=$cnt
--echo list columns in I_S.COLUMNS for the mysql db
SELECT TABLE_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_SCHEMA='mysql' ORDER BY TABLE_NAME,ORDINAL_POSITION;
}

--echo # check the user account
SELECT user, host, plugin, LENGTH(authentication_string) > 0
  FROM mysql.user ORDER BY user;

CREATE DATABASE test;

--echo # shut server down
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--shutdown_server
--source include/wait_until_disconnected.inc
--echo # Server is down

--echo # close the test connection
connection default;
disconnect root_con;

--echo # remove the password file
remove_file $PASSWD_FILE;

--echo # delete mysqld log
remove_file $MYSQLD_LOG;

--echo # delete datadir
--perl
use File::Path 'rmtree';
$DDIR=$ENV{"DDIR"};
rmtree([ "$DDIR" ]);
EOF


--echo #
--echo # Cleanup
--echo #
--echo # Restarting the server
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--enable_reconnect
--source include/wait_until_connected_again.inc

Anon7 - 2022
AnonSec Team