If an unsupported cred type is given to -t, show what is valid

bug/bundler_fix
Jon Hart 2015-01-08 18:42:25 -08:00
parent e6f53ebcbc
commit 7c4b86ca4c
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
1 changed files with 8 additions and 1 deletions

View File

@ -68,6 +68,10 @@ class Db
] ]
end end
def allowed_cred_types
%w(password ntlm hash)
end
# #
# Returns true if the db is connected, prints an error and returns # Returns true if the db is connected, prints an error and returns
# false if not. # false if not.
@ -676,7 +680,7 @@ class Db
print_line " -p,--port <portspec> List creds with logins on services matching this port spec" print_line " -p,--port <portspec> List creds with logins on services matching this port spec"
print_line " -s <svc names> List creds matching comma-separated service names" print_line " -s <svc names> List creds matching comma-separated service names"
print_line " -u,--user <regex> List users that match this regex" print_line " -u,--user <regex> List users that match this regex"
print_line " -t,--type <type> List creds that match the following types: (password,ntlm,hash)" print_line " -t,--type <type> List creds that match the following types: #{allowed_cred_types.join(',')}"
print_line " -R,--rhosts Set RHOSTS from the results of the search" print_line " -R,--rhosts Set RHOSTS from the results of the search"
print_line print_line
@ -838,6 +842,9 @@ class Db
Metasploit::Credential::PasswordHash Metasploit::Credential::PasswordHash
when 'ntlm' when 'ntlm'
Metasploit::Credential::NTLMHash Metasploit::Credential::NTLMHash
else
print_error("Unrecognized credential type #{ptype} -- must be one of #{allowed_cred_types.join(',')}")
return
end end
end end