give the reported service a name

git-svn-id: file:///home/svn/framework3/trunk@8377 4d416f70-5f16-0410-b530-b9f4589650da
unstable
James Lee 2010-02-06 00:37:16 +00:00
parent 509b2aab3a
commit 9b59f0e3c2
1 changed files with 16 additions and 7 deletions

View File

@ -40,24 +40,33 @@ class Metasploit3 < Msf::Auxiliary
each_user_pass { |user, pass| each_user_pass { |user, pass|
do_login(user, pass, datastore['VERBOSE']) 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 end
def do_login(user='sa', pass='', verbose=false) def do_login(user='sa', pass='', verbose=false)
print_status("Trying username:'#{user}' with password:'#{pass}' against #{rhost}:#{rport}") if verbose print_status("Trying username:'#{user}' with password:'#{pass}' against #{rhost}:#{rport}") if verbose
begin begin
success = mssql_login(user, pass) success = mssql_login(user, pass)
if (success) if (success)
print_good("#{rhost}:#{rport} - successful login '#{user}' : '#{pass}'") print_good("#{rhost}:#{rport} - successful login '#{user}' : '#{pass}'")
report_auth_info( report_auth_info({
:host => rhost, :host => rhost,
:proto => 'mssql', :port => rport,
:user => user, :proto => 'tcp',
:pass => pass, :user => user,
:pass => pass,
:targ_host => rhost, :targ_host => rhost,
:targ_port => rport :targ_port => rport
) })
return :next_user return :next_user
else else
print_error("#{rhost}:#{rport} failed to login as '#{user}'") if verbose print_error("#{rhost}:#{rport} failed to login as '#{user}'") if verbose