Skip to content

Commit

Permalink
Update for MySQL 5.7 and above
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
OsandaMalith committed Feb 8, 2018
1 parent ca4ad1d commit 00ead05
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/auxiliary/scanner/mysql/mysql_hashdump.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ def run_host(ip)
create_credential_login(login_data)

#Grabs the username and password hashes and stores them as loot
res = mysql_query("SELECT user,password from mysql.user")
version = mysql_get_variable("@@version")
if (5.6 < version[0..2].to_f)
res = mysql_query("SELECT user,authentication_string from mysql.user")
else
res = mysql_query("SELECT user,password from mysql.user")
end
if res.nil?
print_error("There was an error reading the MySQL User Table")
return
Expand Down

0 comments on commit 00ead05

Please sign in to comment.