From 9b59f0e3c2c4055659d80d64065f425af15090e4 Mon Sep 17 00:00:00 2001 From: James Lee Date: Sat, 6 Feb 2010 00:37:16 +0000 Subject: [PATCH] give the reported service a name git-svn-id: file:///home/svn/framework3/trunk@8377 4d416f70-5f16-0410-b530-b9f4589650da --- .../auxiliary/scanner/mssql/mssql_login.rb | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/modules/auxiliary/scanner/mssql/mssql_login.rb b/modules/auxiliary/scanner/mssql/mssql_login.rb index 62e06981ba..1afb61225b 100644 --- a/modules/auxiliary/scanner/mssql/mssql_login.rb +++ b/modules/auxiliary/scanner/mssql/mssql_login.rb @@ -40,24 +40,33 @@ class Metasploit3 < Msf::Auxiliary each_user_pass { |user, pass| do_login(user, pass, datastore['VERBOSE']) } + # The service should already be reported at this point courtesy of + # report_auth_info, but this is currently the only way to give it a + # name. + report_service({ + :host => rhost, + :port => rport, + :proto => 'tcp', + :name => 'mssql' + }) end def do_login(user='sa', pass='', verbose=false) - print_status("Trying username:'#{user}' with password:'#{pass}' against #{rhost}:#{rport}") if verbose begin success = mssql_login(user, pass) if (success) print_good("#{rhost}:#{rport} - successful login '#{user}' : '#{pass}'") - report_auth_info( - :host => rhost, - :proto => 'mssql', - :user => user, - :pass => pass, + report_auth_info({ + :host => rhost, + :port => rport, + :proto => 'tcp', + :user => user, + :pass => pass, :targ_host => rhost, :targ_port => rport - ) + }) return :next_user else print_error("#{rhost}:#{rport} failed to login as '#{user}'") if verbose