class Metasploit::Credential::PostgresMD5

A {Metasploit::Credential::PasswordHash password hash} that can be {Metasploit::Credential::ReplayableHash replayed} to authenticate to PostgreSQL servers. It is composed of a hexadecimal string of 32 charachters prepended by the string 'md5'

Constants

DATA_REGEXP

Valid format for {Metasploit::Credential::Private#data}

Private Instance Methods

data_format() click to toggle source
# File app/models/metasploit/credential/postgres_md5.rb, line 35
def data_format
  unless DATA_REGEXP.match(data)
    errors.add(:data, 'is not in Postgres MD5 Hash format')
  end
end
normalize_data() click to toggle source

Normalizes {#data} by making it all lowercase so that the unique validation and index on ({Metasploit::Credential::Private#type}, {#data}) catches collision in a case-insensitive manner without the need to use case-insensitive comparisons.

# File app/models/metasploit/credential/postgres_md5.rb, line 29
def normalize_data
  if data
    self.data = data.downcase
  end
end