Skip to content

Commit 00ead05

Browse files
authored
Update for MySQL 5.7 and above
Starting from MySQL 5.7 the password column was changed to authentication_string. I've added a check to determine the version. Tested on both MySQL 5.6 and 5.7.
1 parent ca4ad1d commit 00ead05

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/auxiliary/scanner/mysql/mysql_hashdump.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ def run_host(ip)
5757
create_credential_login(login_data)
5858

5959
#Grabs the username and password hashes and stores them as loot
60-
res = mysql_query("SELECT user,password from mysql.user")
60+
version = mysql_get_variable("@@version")
61+
if (5.6 < version[0..2].to_f)
62+
res = mysql_query("SELECT user,authentication_string from mysql.user")
63+
else
64+
res = mysql_query("SELECT user,password from mysql.user")
65+
end
6166
if res.nil?
6267
print_error("There was an error reading the MySQL User Table")
6368
return

0 commit comments

Comments
 (0)