File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
modules/auxiliary/admin/mysql Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -111,10 +111,17 @@ def run
111
111
query = "use mysql"
112
112
mysql_query ( query )
113
113
114
+ # Starting from MySQL 5.7, the 'password' column was changed to 'authentication_string'.
115
+ if vparm [ 'version' ] [ 0 ..2 ] . to_f > 5.6
116
+ password_field = 'authentication_string'
117
+ else
118
+ password_field = 'password'
119
+ end
120
+
114
121
# Account Enumeration
115
122
# Enumerate all accounts with their password hashes
116
123
print_status ( "Enumerating Accounts:" )
117
- query = "select user, host, password from mysql.user"
124
+ query = "select user, host, #{ password_field } from mysql.user"
118
125
res = mysql_query ( query )
119
126
if res and res . size > 0
120
127
print_status ( "\t List of Accounts with Password Hashes:" )
@@ -229,7 +236,7 @@ def run
229
236
end
230
237
231
238
# Blank Password Check
232
- queryblankpass = "select user, host, password from mysql.user where length(password ) = 0 or password is null"
239
+ queryblankpass = "select user, host, #{ password_field } from mysql.user where length(#{ password_field } ) = 0 or #{ password_field } is null"
233
240
res = mysql_query ( queryblankpass )
234
241
if res and res . size > 0
235
242
print_status ( "\t The following accounts have empty passwords:" )
You can’t perform that action at this time.
0 commit comments