Credential Security & Hash Analysis
Hash identification, offline dictionary verification with John the Ripper, and authentication defenses.
Overview
Credential Security & Hash Analysis examines how authentication credentials are stored, protected, and verified. Cryptographic hash functions provide one-way verification of passwords without storing plaintext. In authorized testing and defensive audits, understanding hash types, entropy, and offline validation helps assess password policy strength.
Core Concepts
- One-Way Hashing vs Two-Way Encryption: Hashing is irreversible by mathematical design; encryption is reversible given the appropriate decryption key.
- Cryptographic Salts: Random data appended to a password before hashing to ensure identical passwords produce unique hash digests, defeating precomputed rainbow tables.
- Hash Algorithms:
- Legacy / Insecure: MD5, SHA-1 (vulnerable to collision attacks and extremely fast GPU computation).
- Secure / Modern: bcrypt, Argon2, PBKDF2 (computationally intensive, designed with configurable work factors to resist brute force).
- Offline vs Online Testing: Online attacks test credentials against live network services (limited by network latency and account lockout policies); offline testing computes candidate hashes locally against extracted digests.
Tools & Requirements
John the Ripper, Hash-Identifier (or hashid), and Hydra for authorized lab authentication verification.
$ sudo apt update && sudo apt install -y john hashid hydra
Commands & Practical Examples
1. Identifying Hash Algorithm Formats
Identify probable hash algorithms from an extracted digest string:
$ hashid "5f4dcc3b5aa765d61d8327deb882cf99" $ hash-identifier
2. Offline Verification with John the Ripper
Audit weak password usage in a test environment using a wordlist and raw hash format:
$ john --wordlist=/usr/share/wordlists/rockyou.txt --format=Raw-MD5 hashes.txt $ john --show --format=Raw-MD5 hashes.txt
3. Online Authentication Testing in Authorized Labs with Hydra
Test default administrative login parameters against an authorized lab HTTP form:
$ hydra -l admin -P wordlist.txt 192.168.1.50 http-post-form "/login.php:user=^USER^&pass=^PASS^:F=Login failed"
Practical Workflow
- Extract Hash Digest: Obtain test hash from authorized laboratory database export.
- Determine Hash Type: Use
hashidto identify bit length and algorithm family. - Configure Wordlist: Prepare test dictionary containing known common passwords.
- Execute Verification: Run John the Ripper with targeted format parameter.
- Review Policy: Identify weak passwords and recommend complexity and salting upgrades.
Common Mistakes & Troubleshooting
- Specifying Wrong Format: Passing an SHA-256 hash to an MD5 cracker yields immediate failure. Always verify format first.
- Triggering Lockouts: Online testing with Hydra against production environments locks out user accounts. Only test against designated lab targets.
Security Considerations & Scoping
Credential analysis must comply with privacy regulations. Extracted hashes from testing must be handled with strict confidentiality and securely deleted post-assessment.
Related Topics
- Module 05: Web Application Security Fundamentals
- Module 09: Controlled Exploitation & Post-Exploitation
- Module 14: Security Tools Command Index
Further Reading & TryHackMe Paths
- TryHackMe Rooms: John the Ripper, Hydra, Hashing - Crypto 101.