Fix reporting

bug/bundler_fix
jvazquez-r7 2014-11-25 13:20:31 -06:00
parent 93539ae4c6
commit 8e5b37ea6e
1 changed files with 39 additions and 36 deletions

View File

@ -80,7 +80,8 @@ class Metasploit3 < Msf::Auxiliary
if domain_users.nil?
print_error("#{peer} - Sorry, no Windows domain accounts were found, or DC could not be contacted.")
return
else
end
# Print number of objects found and write to a file
print_good("#{peer} - #{domain_users.length} user accounts, groups, and computer accounts were found.")
@ -101,20 +102,24 @@ class Metasploit3 < Msf::Auxiliary
end
# Create output file
this_service = nil
if framework.db and framework.db.active
this_service = report_service(
:host => rhost,
:port => rport,
:name => 'mssql',
:proto => 'tcp'
)
end
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}")
end
end
def get_server_name
@ -178,9 +183,7 @@ class Metasploit3 < Msf::Auxiliary
domain_sid = object_sid[0..47]
# Return if sid does not resolve for a domain
if domain_sid.length == 0
return nil
end
return nil if domain_sid.empty?
else
domain_sid = nil
end