Fix reporting
parent
93539ae4c6
commit
8e5b37ea6e
|
@ -80,7 +80,8 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
if domain_users.nil?
|
if domain_users.nil?
|
||||||
print_error("#{peer} - Sorry, no Windows domain accounts were found, or DC could not be contacted.")
|
print_error("#{peer} - Sorry, no Windows domain accounts were found, or DC could not be contacted.")
|
||||||
return
|
return
|
||||||
else
|
end
|
||||||
|
|
||||||
# Print number of objects found and write to a file
|
# Print number of objects found and write to a file
|
||||||
print_good("#{peer} - #{domain_users.length} user accounts, groups, and computer accounts were found.")
|
print_good("#{peer} - #{domain_users.length} user accounts, groups, and computer accounts were found.")
|
||||||
|
|
||||||
|
@ -101,20 +102,24 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
end
|
end
|
||||||
|
|
||||||
# Create output file
|
# Create output file
|
||||||
this_service = nil
|
|
||||||
if framework.db and framework.db.active
|
|
||||||
this_service = report_service(
|
this_service = report_service(
|
||||||
:host => rhost,
|
:host => rhost,
|
||||||
:port => rport,
|
:port => rport,
|
||||||
:name => 'mssql',
|
:name => 'mssql',
|
||||||
:proto => 'tcp'
|
:proto => 'tcp'
|
||||||
)
|
)
|
||||||
end
|
|
||||||
filename= "#{datastore['RHOST']}-#{datastore['RPORT']}_windows_domain_accounts.csv"
|
filename= "#{datastore['RHOST']}-#{datastore['RPORT']}_windows_domain_accounts.csv"
|
||||||
path = store_loot("windows_domain_accounts", "text/plain", datastore['RHOST'], windows_domain_login_table.to_csv, filename, "SQL Server query results",this_service)
|
path = store_loot(
|
||||||
|
'mssql.domain.accounts',
|
||||||
|
'text/plain',
|
||||||
|
datastore['RHOST'],
|
||||||
|
windows_domain_login_table.to_csv,
|
||||||
|
filename,
|
||||||
|
'SQL Server query results',
|
||||||
|
this_service
|
||||||
|
)
|
||||||
print_status("Query results have been saved to: #{path}")
|
print_status("Query results have been saved to: #{path}")
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def get_server_name
|
def get_server_name
|
||||||
|
|
||||||
|
@ -178,9 +183,7 @@ class Metasploit3 < Msf::Auxiliary
|
||||||
domain_sid = object_sid[0..47]
|
domain_sid = object_sid[0..47]
|
||||||
|
|
||||||
# Return if sid does not resolve for a domain
|
# Return if sid does not resolve for a domain
|
||||||
if domain_sid.length == 0
|
return nil if domain_sid.empty?
|
||||||
return nil
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
domain_sid = nil
|
domain_sid = nil
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue