You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
infoprint "Skipped due to unsupported feature for MySQL 8.0+";
2258
-
return;
2259
-
}
2260
2256
2261
2257
#exit 0;
2262
2258
if ( $opt{skippassword} eq 1 ) {
@@ -2377,15 +2373,17 @@ sub security_recommendations {
2377
2373
}
2378
2374
2379
2375
# Looking for User with user/ uppercase /capitalise user as password
2380
-
@mysqlstatlist = select_array
2376
+
if ( !mysql_version_ge(8) ) {
2377
+
@mysqlstatlist = select_array
2381
2378
"SELECT CONCAT(QUOTE(user), '\@', QUOTE(host)) FROM mysql.user WHERE user != '' AND (CAST($PASS_COLUMN_NAME as Binary) = PASSWORD(user) OR CAST($PASS_COLUMN_NAME as Binary) = PASSWORD(UPPER(user)) OR CAST($PASS_COLUMN_NAME as Binary) = PASSWORD(CONCAT(UPPER(LEFT(User, 1)), SUBSTRING(User, 2, LENGTH(User)))))";
2382
-
if (@mysqlstatlist) {
2383
-
foreachmy$line ( sort@mysqlstatlist ) {
2384
-
chomp($line);
2385
-
badprint "User " . $line . " has user name as password.";
2386
-
push( @generalrec,
2379
+
if (@mysqlstatlist) {
2380
+
foreachmy$line ( sort@mysqlstatlist ) {
2381
+
chomp($line);
2382
+
badprint "User " . $line . " has user name as password.";
2383
+
push( @generalrec,
2387
2384
"Set up a Secure Password for $line user: SET PASSWORD FOR $line = PASSWORD('secure_password');"
2388
-
);
2385
+
);
2386
+
}
2389
2387
}
2390
2388
}
2391
2389
@@ -2419,44 +2417,46 @@ sub security_recommendations {
2419
2417
my$nbins = 0;
2420
2418
my$passreq;
2421
2419
if (@passwords) {
2422
-
my$nbInterPass = 0;
2423
-
foreachmy$pass (@passwords) {
2424
-
$nbInterPass++;
2425
-
2426
-
$pass =~ s/\s//g;
2427
-
$pass =~ s/\'/\\\'/g;
2428
-
chomp($pass);
2429
-
2430
-
# Looking for User with user/ uppercase /capitalise weak password
2431
-
@mysqlstatlist =
2432
-
select_array
2420
+
if ( !mysql_version_ge(8) ) {
2421
+
my$nbInterPass = 0;
2422
+
foreachmy$pass (@passwords) {
2423
+
$nbInterPass++;
2424
+
2425
+
$pass =~ s/\s//g;
2426
+
$pass =~ s/\'/\\\'/g;
2427
+
chomp($pass);
2428
+
2429
+
# Looking for User with user/ uppercase /capitalise weak password
2430
+
@mysqlstatlist =
2431
+
select_array
2433
2432
"SELECT CONCAT(user, '\@', host) FROM mysql.user WHERE $PASS_COLUMN_NAME = PASSWORD('"
2434
-
. $pass
2435
-
. "') OR $PASS_COLUMN_NAME = PASSWORD(UPPER('"
2436
-
. $pass
2437
-
. "')) OR $PASS_COLUMN_NAME = PASSWORD(CONCAT(UPPER(LEFT('"
2438
-
. $pass
2439
-
. "', 1)), SUBSTRING('"
2440
-
. $pass
2441
-
. "', 2, LENGTH('"
2442
-
. $pass . "'))))";
2443
-
debugprint "There are " . scalar(@mysqlstatlist) . " items.";
2444
-
if (@mysqlstatlist) {
2445
-
foreachmy$line (@mysqlstatlist) {
2446
-
chomp($line);
2447
-
badprint "User '" . $line
2448
-
. "' is using weak password: $pass in a lower, upper or capitalize derivative version.";
2433
+
. $pass
2434
+
. "') OR $PASS_COLUMN_NAME = PASSWORD(UPPER('"
2435
+
. $pass
2436
+
. "')) OR $PASS_COLUMN_NAME = PASSWORD(CONCAT(UPPER(LEFT('"
2437
+
. $pass
2438
+
. "', 1)), SUBSTRING('"
2439
+
. $pass
2440
+
. "', 2, LENGTH('"
2441
+
. $pass . "'))))";
2442
+
debugprint "There are " . scalar(@mysqlstatlist) . " items.";
2443
+
if (@mysqlstatlist) {
2444
+
foreachmy$line (@mysqlstatlist) {
2445
+
chomp($line);
2446
+
badprint "User '" . $line
2447
+
. "' is using weak password: $pass in a lower, upper or capitalize derivative version.";
2449
2448
2450
-
push( @generalrec,
2449
+
push( @generalrec,
2451
2450
"Set up a Secure Password for $line user: SET PASSWORD FOR '"
0 commit comments