Land #11742, username and password literal search

master
William Vu 2019-04-17 13:07:15 -05:00
commit 6be1d41e35
No known key found for this signature in database
GPG Key ID: 68BD00CE25866743
2 changed files with 4 additions and 6 deletions

View File

@ -28,13 +28,11 @@ module Msf::DBManager::Cred
end
if opts[:user].present?
# If we have a user regex, only include those that match
query = query.where('"metasploit_credential_publics"."username" ~* ?', opts[:user])
query = query.where('"metasploit_credential_publics"."username" = ?', opts[:user])
end
if opts[:pass].present?
# If we have a password regex, only include those that match
query = query.where('"metasploit_credential_privates"."data" ~* ?', opts[:pass])
query = query.where('"metasploit_credential_privates"."data" = ?', opts[:pass])
end
if opts[:host_ranges] || opts[:ports] || opts[:svcs]

View File

@ -172,10 +172,10 @@ class Creds
print_line " -d,--delete Delete one or more credentials"
print_line
print_line "Filter options for listing"
print_line " -P,--password <regex> List passwords that match this regex"
print_line " -P,--password <text> List passwords that match this text"
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 " -u,--user <regex> List users that match this regex"
print_line " -u,--user <text> List users that match this text"
print_line " -t,--type <type> List creds that match the following types: #{allowed_cred_types.join(',')}"
print_line " -O,--origins <IP> List creds that match these origins"
print_line " -R,--rhosts Set RHOSTS from the results of the search"