Skip to content

Commit 75c075e

Browse files
David MaloneyDavid Maloney
authored andcommitted
properly anchor regexes
duh
1 parent c8f23b2 commit 75c075e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/metasploit/framework/credential_collection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def each
210210
def private_type(private)
211211
if private =~ /[0-9a-f]{32}:[0-9a-f]{32}/
212212
:ntlm_hash
213-
elsif private =~ /md5([a-f0-9]{32})/
213+
elsif private =~ /^md5([a-f0-9]{32})$/
214214
:postgres_md5
215215
else
216216
:password

lib/postgres/postgres-pr/connection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def initialize(database, user, password=nil, uri = nil)
6363
establish_connection(uri)
6464

6565
# Check if the password supplied is a Postgres-style md5 hash
66-
md5_hash_match = password.match(/md5([a-f0-9]{32})/)
66+
md5_hash_match = password.match(/^md5([a-f0-9]{32})$/)
6767

6868
@conn << StartupMessage.new(PROTO_VERSION, 'user' => user, 'database' => database).dump
6969

0 commit comments

Comments
 (0)