OWASP Hunting
Configuration & Design

Weak Cryptography

Weak cryptographic implementations include use of broken algorithms (MD5, SHA1), hardcoded keys, ECB mode, and predictable IVs.

These payloads are for authorized testing only — systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.

What it is

Weak cryptography vulnerabilities arise from using broken or weak algorithms (MD5, SHA1, DES, RC4), incorrect cipher modes (ECB), short key sizes, hardcoded keys, predictable IVs, or improper random number generation. These flaws can allow attackers to crack passwords, decrypt encrypted data, forge signatures, or predict secrets.

Attack Vectors

  • Password hashing (MD5/SHA1 without salt)
  • Data encryption at rest and in transit
  • Token and session ID generation
  • Digital signature and certificate validation
  • Cryptographic random number generation

Testing Methodology

  1. Identify cryptographic algorithms used (examine source, error messages, cipher suites)
  2. Test TLS configuration with sslyze or testssl.sh
  3. Check for MD5/SHA1 in password hashes — crack with hashcat
  4. Identify ECB mode (identical blocks produce identical ciphertext)
  5. Test for predictable session tokens by collecting samples

Payloads

Reference payloads for authorized testing. Always verify you have permission before use.

Weak Hash Cracking
hashcat -a 0 -m 0 hash.txt wordlist.txt (MD5)hashcat -a 0 -m 100 hash.txt wordlist.txt (SHA1)john --format=md5crypt hash.txt (MD5 Unix)
ECB Mode Detection
Submit data with repeating 16-byte blocks; identical blocks in ciphertext reveal ECB mode
Broken TLS Config Tests
testssl.sh --vulnerable target.comsslyze --regular target.com

Indicators of Vulnerability

  • Password hashes cracked with common wordlists (MD5/SHA1)
  • Identical ciphertext blocks for identical plaintext (ECB mode)
  • TLS scanner reports SWEET32, POODLE, BEAST, CRIME vulnerabilities

Detection Guidance

Audit cryptographic library usage. Run TLS configuration scanners. Check password hashing algorithms in source code and database schemas.

Mitigation & Remediation

  • Use modern password hashing algorithms: bcrypt, Argon2, or scrypt
  • Use AES-GCM or ChaCha20-Poly1305 for symmetric encryption
  • Use RSA-2048+, ECDSA with P-256+, or Ed25519 for asymmetric operations
  • Configure TLS 1.2+ with strong cipher suites only
  • Use a cryptographically secure random number generator for all secrets

References

Responsible Use

All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.

  • Systems and applications you own
  • Authorized penetration testing engagements
  • Bug bounty programs with defined scope
  • Educational lab environments (DVWA, WebGoat, HackTheBox)