Land #11743, remove regex syntax from invalidate_login

master
James Barnett 2019-04-17 14:14:06 -05:00
commit 158e3d4ad3
No known key found for this signature in database
GPG Key ID: 647983861A4EC5EA
1 changed files with 3 additions and 5 deletions

View File

@ -35,10 +35,8 @@ module LoginDataProxy
# Search for an existing Metasploit::Credential::Core object. It requires specific attributes.
core_opts = {}
core_opts[:workspace] = opts[:workspace]
# The creds search uses regex for username and password lookup.
# Alter the search string to only look for exact matches to avoid updating unexpected entries.
core_opts[:user] = "^#{opts.fetch(:username)}$" if opts[:username]
core_opts[:pass] = "^#{opts.fetch(:private_data)}$" if opts[:private_data]
core_opts[:user] = opts.fetch(:username) if opts[:username]
core_opts[:pass] = opts.fetch(:private_data) if opts[:private_data]
core_opts[:ports] = [ opts.fetch(:port) ] if opts[:port]
core_opts[:host_ranges] = [ opts.fetch(:address) ] if opts[:address]
core_opts[:svcs] = [ opts.fetch(:service_name) ] if opts[:service_name]
@ -55,4 +53,4 @@ module LoginDataProxy
self.log_error(e, "Problem invalidating login")
end
end
end
end