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.
A cryptanalysis playbook for attacking weaknesses in hash functions during CTF challenges and authorized security assessments. It documents length extension attacks against Merkle-Damgard constructions (MD5, SHA-1, SHA-256, SHA-512), collision generation for MD5 and SHA-1, HMAC timing side channels, birthday attacks, and proof-of-work solving. A recurring emphasis is knowing which attack applies where: length extension works against Merkle-Damgard hashes but not against HMAC, SHA-3/Keccak (a sponge construction), or BLAKE2, and the material carefully distinguishes identical-prefix collisions from chosen-prefix collisions.
The content is organized around a quick attack-selection table that maps a scenario to a technique and a tool. Length extension is covered with padding-calculation code, tool usage for HashPump and hash_extender, and a Python example using the hlextend library. Collision sections describe identical-prefix generation with fastcoll, chosen-prefix collisions with hashclash, UniColl single-block near-collisions, and real-world impacts such as rogue CA certificates and the 2017 SHAttered SHA-1 collision. Practical CTF tricks are included, such as PHP magic-hash comparisons (the '0e' type-juggling issue) and array-based bypasses of loose equality.
Reach for this material when a challenge or engagement involves a hash-based authentication scheme, a check that compares hashes, or a proof-of-work gate, and you need to decide whether the construction is exploitable. It also serves as a reference for the birthday bound, giving expected collision effort of roughly 2^(n/2) for an n-bit hash and noting how truncation lowers that cost. The routing section points to related skills for RSA signature weaknesses, symmetric-cipher key derivation, and classical cipher analysis when a hash weakness feeds a larger attack chain.
Merkle-Damgard hashes such as MD5, SHA-1, SHA-256, and SHA-512. HMAC, SHA-3/Keccak, BLAKE2, and truncated hashes are not, because of their different constructions.
fastcoll for identical-prefix collisions and hashclash for chosen-prefix collisions, with UniColl described for single-block near-collisions.
No. The material is explicitly scoped to CTF challenges and authorized security testing scenarios.
It describes magic '0e' hashes that PHP's loose == treats as equal, an array trick where md5 of an array returns NULL, and real fastcoll collision pairs.
About 2^(n/2) hashes for an n-bit output (2^64 for MD5), and correspondingly fewer attempts when the hash is truncated to k bits (about 2^(k/2)).
Quick Setup:
.claude/skills/Repository
yaklang/hack-skills