Support filtering creds by realm

This commit is contained in:
Spencer McIntyre
2021-08-30 11:13:12 -04:00
parent 0e4374245e
commit 877ea86aaf
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -31,6 +31,10 @@ module Msf::DBManager::Cred
query = query.where(Mdm::Service[:port].in(opts[:ports]))
end
if opts[:realm].present?
query = query.where('"metasploit_credential_realms"."value" = ?', opts[:realm])
end
if opts[:user].present?
query = query.where('"metasploit_credential_publics"."username" = ?', opts[:user])
end
@@ -149,6 +149,7 @@ class Creds
print_line " -u,--user <text> List users that match this text"
print_line " -t,--type <type> List creds of the specified type: password, ntlm, hash or any valid JtR format"
print_line " -O,--origins <IP> List creds that match these origins"
print_line " --realm List creds that match this realm"
print_line " -R,--rhosts Set RHOSTS from the results of the search"
print_line " -v,--verbose Don't truncate long password hashes"
@@ -387,6 +388,8 @@ class Creds
opts[:search_term] = search_term
when '-v', '--verbose'
truncate = false
when '--realm'
opts[:realm] = args.shift
else
# Anything that wasn't an option is a host to search for
unless (arg_host_range(arg, host_ranges))