Skip to content

Commit

Permalink
Land #19017, add better logging for failed mssql logins
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Mar 28, 2024
2 parents 00b9ae3 + b5d96de commit 69660c3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion modules/auxiliary/admin/mssql/mssql_exec.rb
Expand Up @@ -41,7 +41,16 @@ def run
if session
set_session(session.client)
else
return unless mssql_login_datastore
unless mssql_login_datastore
print_error("Error with mssql_login call")
info = self.mssql_client.initial_connection_info
if info[:errors] && !info[:errors].empty?
info[:errors].each do |err|
print_error(err)
end
end
return
end
end

technique = datastore['TECHNIQUE']
Expand Down
11 changes: 10 additions & 1 deletion modules/auxiliary/admin/mssql/mssql_sql.rb
Expand Up @@ -42,7 +42,16 @@ def run
if session
set_session(session.client)
else
return unless mssql_login_datastore
unless mssql_login_datastore
print_error("Error with mssql_login call")
info = self.mssql_client.initial_connection_info
if info[:errors] && !info[:errors].empty?
info[:errors].each do |err|
print_error(err)
end
end
return
end
end

mssql_query(datastore['SQL'], true)
Expand Down

0 comments on commit 69660c3

Please sign in to comment.