yaklang/hack-skills/hash-attack-techniques
- community
Checking that the SKILL.md file is still in the repository.
Hash attack playbook. Use when exploiting length extension, MD5/SHA1 collisions, HMAC timing leaks, birthday attacks, or hash-based proof of work in CTF and authorized testing scenarios.
Install
npx vskill@latest install yaklang/hack-skills/hash-attack-techniquesSKILL.md
SKILL: Hash Attack Techniques — Expert Cryptanalysis Playbook
AI LOAD INSTRUCTION: Expert hash attack techniques for CTF and security assessments. Covers length extension attacks, MD5/SHA1 collision generation, meet-in-the-middle hash attacks, HMAC timing side channels, birthday attacks, and proof-of-work solving. Base models often incorrectly apply length extension to HMAC or SHA-3, or fail to distinguish between identical-prefix and chosen-prefix collisions.
0. RELATED ROUTING
- rsa-attack-techniques when hash weaknesses affect RSA signature schemes
- symmetric-cipher-attacks when hash is used in key derivation
- classical-cipher-analysis when analyzing hash-like constructions in classical ciphers
Quick attack selection
| Scenario | Attack | Tool | |||
|---|---|---|---|---|---|
| `H(secret \ | \ | msg)` known, extend message | Length extension | HashPump, hash_extender | |
| Need two files with same MD5 | Identical-prefix collision | fastcoll | |||
| Need specific MD5 prefix match | Chosen-prefix collision | hashclash | |||
| Byte-by-byte HMAC comparison | Timing attack | Custom script | |||
| Find any collision | Birthday attack | O(2^(n/2)) | |||
| Proof of work: find hash with leading zeros | Brute force | hashcat, Python |
1. LENGTH EXTENSION ATTACK
1.1 Vulnerable vs Non-Vulnerable
| Hash | Vulnerable | Why | |
|---|---|---|---|
| MD5 | Yes | Merkle-Damgard construction | |
| SHA-1 | Yes | Merkle-Damgard construction | |
| SHA-256 | Yes | Merkle-Damgard construction | |
| SHA-512 | Yes | Merkle-Damgard construction | |
| SHA-3 / Keccak | No | Sponge construction | |
| HMAC-* | No | Double hashing prevents extension | |
| SHA-256 truncated | No (if truncated) | Missing internal state bits | |
| BLAKE2 | No | Different construction |
1.2 Attack Mechanism
1.3 Padding Calculation (MD5/SHA)
1.4 Tool Usage
1.5 Python Implementation
2. MD5 COLLISION ATTACKS
2.1 Identical-Prefix Collision (fastcoll)
Two messages with same prefix but different content, producing identical MD5.
2.2 Chosen-Prefix Collision (hashclash)
Two messages with different chosen prefixes, appended with computed suffixes to collide.
2.3 UniColl (Single-Block Near-Collision)
Produces two messages differing in a single byte within one MD5 block, with same hash.
2.4 Collision Applications
| Application | Technique | Impact | |
|---|---|---|---|
| Certificate forgery | Chosen-prefix | Rogue CA certificate (proven in 2008) | |
| Binary substitution | Identical-prefix + conditional | Two executables, same MD5, different behavior | |
| PDF collision | UniColl | Two PDFs showing different content | |
| Git commit collision | Chosen-prefix (SHAttered for SHA1) | Two commits with same hash | |
| CTF: bypass MD5 check | fastcoll | Two different inputs accepted as same |
2.5 CTF MD5 Collision Tricks
3. SHA-1 COLLISION
3.1 SHAttered Attack (2017)
First practical SHA-1 collision: two PDF files with same SHA-1.
- Complexity: ~2^63 SHA-1 computations
- Cost: ~$110K on GPU clusters (2017 prices)
- Tool: shattered.io provides the collision PDFs
3.2 SHA-1 Chosen-Prefix Collision (2020)
- Complexity: ~2^63.4 computations
- Practical for attacking PGP/GnuPG key servers
- Demonstrates SHA-1 is broken for collision resistance
3.3 Impact
4. BIRTHDAY ATTACK
4.1 Generic Birthday Bound
4.2 Birthday Attack Implementation
5. HMAC TIMING ATTACK
5.1 Vulnerable Comparison
5.2 Attack Strategy
5.3 Constant-Time Comparison (Defense)
6. MEET-IN-THE-MIDDLE (HASH)
6.1 Concept
Split hash computation into two halves, precompute one, match against the other.
7. HASH PROOF-OF-WORK
7.1 Common CTF PoW Formats
7.2 GPU-Accelerated PoW
8. RAINBOW TABLES & SALTING
8.1 Rainbow Table Attack
8.2 Salt Defeats Rainbow Tables
8.3 Modern Password Hashing
| Algorithm | Salt | Iterations | Memory-Hard | Recommended | |
|---|---|---|---|---|---|
| MD5 | No | 1 | No | Never | |
| SHA-256 | No | 1 | No | Never for passwords | |
| bcrypt | Yes | Configurable | No | Yes | |
| scrypt | Yes | Configurable | Yes | Yes | |
| Argon2 | Yes | Configurable | Yes | Best choice | |
| PBKDF2 | Yes | Configurable | No | Acceptable |
9. DECISION TREE
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/hash-attack-techniques/SKILL.md
Popularity
- Installs
- 3
- Unique users
- 2
- Repository stars
- 349
- Repository forks
- 62
- 7-day trend score
- 33
Installs come from the vskill CLI. Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Apr 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/yaklang/hack-skills/hash-attack-techniques)