properly anchor regexes

duh
bug/bundler_fix
David Maloney 2015-03-03 19:15:29 -06:00
parent c8f23b2903
commit 75c075e32b
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
2 changed files with 2 additions and 2 deletions

View File

@ -210,7 +210,7 @@ class Metasploit::Framework::CredentialCollection
def private_type(private)
if private =~ /[0-9a-f]{32}:[0-9a-f]{32}/
:ntlm_hash
elsif private =~ /md5([a-f0-9]{32})/
elsif private =~ /^md5([a-f0-9]{32})$/
:postgres_md5
else
:password

View File

@ -63,7 +63,7 @@ class Connection
establish_connection(uri)
# Check if the password supplied is a Postgres-style md5 hash
md5_hash_match = password.match(/md5([a-f0-9]{32})/)
md5_hash_match = password.match(/^md5([a-f0-9]{32})$/)
@conn << StartupMessage.new(PROTO_VERSION, 'user' => user, 'database' => database).dump