CAPECattack pattern

CAPEC-55 Rainbow Table Password Cracking

Medium Official page ↗
Abstraction
Detailed
Status
Draft
Likelihood of attack
Medium
Typical severity
Medium
CAPEC version
3.9

Description

An attacker gets access to the database table where hashes of passwords are stored. They then use a rainbow table of pre-computed hash chains to attempt to look up the original password. Once the original password corresponding to the hash is obtained, the attacker uses the original password to gain access to the system.

Extended description

A password rainbow table stores hash chains for various passwords. A password chain is computed, starting from the original password, P, via a reduce(compression) function R and a hash function H. A recurrence relation exists where Xi+1 = R(H(Xi)), X0 = P. Then the hash chain of length n for the original password P can be formed: X1, X2, X3, ... , Xn-2, Xn-1, Xn, H(Xn). P and H(Xn) are then stored together in the rainbow table. Constructing the rainbow tables takes a very long time and is computationally expensive. A separate table needs to be constructed for the various hash algorithms (e.g. SHA1, MD5, etc.). However, once a rainbow table is computed, it can be very effective in cracking the passwords that have been hashed without the use of salt.

Execution flow

1. [Explore] [Determine application's/system's password policy] Determine the password policies of the target application/system. 2. [Explore] [Obtain password hashes] An attacker gets access to the database table storing hashes of passwords or potentially just discovers a hash of an individual password. 3. [Exploit] [Run rainbow table-based password cracking tool] An attacker finds or writes a password cracking tool that uses a previously computed rainbow table for the right hashing algorithm. It helps if the attacker knows what hashing algorithm was used by the password system.

Prerequisites

• Hash of the original password is available to the attacker. For a better chance of success, an attacker should have more than one hash of the original password, and ideally the whole table. • Salt was not used to create the hash of the original password. Otherwise the rainbow tables have to be re-computed, which is very expensive and will make the attack effectively infeasible (especially if salt was added in iterations). • The system uses one factor password based authentication.

Skills required

• [Low] A variety of password cracking tools are available that can leverage a rainbow table. The more difficult part is to obtain the password hash(es) in the first place.

Consequences

• Confidentiality, Access Control, Authorization: Gain Privileges

Mitigations

• Use salt when computing password hashes. That is, concatenate the salt (random bits) with the original password prior to hashing it.

Related

Att&ck technique · MITRE ATT&CK (1)

Can precede · CAPEC (5)

  • CAPEC-151 Identity Spoofing attack pattern
  • CAPEC-560 Use of Known Domain Credentials attack pattern
  • CAPEC-561 Windows Admin Shares with Stolen Credentials attack pattern
  • CAPEC-600 Credential Stuffing attack pattern
  • CAPEC-653 Use of Known Operating System Credentials attack pattern

Child of · CAPEC (1)

  • CAPEC-49 Password Brute Forcing attack pattern

Weakness · CWE (8)

  • CWE-261 Weak Encoding for Password weakness
  • CWE-262 Not Using Password Aging weakness
  • CWE-263 Password Aging with Long Expiration weakness
  • CWE-308 Use of Single-factor Authentication weakness
  • CWE-309 Use of Password System for Primary Authentication weakness
  • CWE-521 Weak Password Requirements weakness
  • CWE-654 Reliance on a Single Factor in a Security Decision weakness
  • CWE-916 Use of Password Hash With Insufficient Computational Effort weakness

Referenced by CWE · attack pattern (8)

  • CWE-261 Weak Encoding for Password weakness
  • CWE-262 Not Using Password Aging weakness
  • CWE-263 Password Aging with Long Expiration weakness
  • CWE-308 Use of Single-factor Authentication weakness
  • CWE-309 Use of Password System for Primary Authentication weakness
  • CWE-521 Weak Password Requirements weakness
  • CWE-654 Reliance on a Single Factor in a Security Decision weakness
  • CWE-916 Use of Password Hash With Insufficient Computational Effort weakness