Skip to content

Commit 7c4b86c

Browse files
committed
If an unsupported cred type is given to -t, show what is valid
1 parent e6f53eb commit 7c4b86c

File tree

1 file changed

+8
-1
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+8
-1
lines changed

lib/msf/ui/console/command_dispatcher/db.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ def deprecated_commands
6868
]
6969
end
7070

71+
def allowed_cred_types
72+
%w(password ntlm hash)
73+
end
74+
7175
#
7276
# Returns true if the db is connected, prints an error and returns
7377
# false if not.
@@ -676,7 +680,7 @@ def cmd_creds_help
676680
print_line " -p,--port <portspec> List creds with logins on services matching this port spec"
677681
print_line " -s <svc names> List creds matching comma-separated service names"
678682
print_line " -u,--user <regex> List users that match this regex"
679-
print_line " -t,--type <type> List creds that match the following types: (password,ntlm,hash)"
683+
print_line " -t,--type <type> List creds that match the following types: #{allowed_cred_types.join(',')}"
680684
print_line " -R,--rhosts Set RHOSTS from the results of the search"
681685

682686
print_line
@@ -838,6 +842,9 @@ def creds_search(*args)
838842
Metasploit::Credential::PasswordHash
839843
when 'ntlm'
840844
Metasploit::Credential::NTLMHash
845+
else
846+
print_error("Unrecognized credential type #{ptype} -- must be one of #{allowed_cred_types.join(',')}")
847+
return
841848
end
842849
end
843850

0 commit comments

Comments
 (0)