Drill Pack 04 — Passwords & Hashes¶
Deep, timed practice for the "what is the password of user X?" / "crack this hash" Practical family. Prereq: generate the challenge-lab (
../challenge-lab/setup-challenges.sh→~/ceh-practical-challenges/) andgunzip -k /usr/share/wordlists/rockyou.txt.gz. Recipes:../challenge-playbooks.md; theory: Module 06 — System Hacking. Online/shadow box: Metasploitable2192.168.56.20(msfadmin/msfadmin). Crack only hashes from your own lab.
Set these once, then the loop never changes: get the hash → name it (hashid) → pick the mode → crack. The mode is everything: the right -m cracks in seconds, the wrong one "runs" forever and finds nothing.
C=~/ceh-practical-challenges # challenge-lab output | -m tells:
T=192.168.56.20 # Metasploitable2 | 0 MD5(32hex) 100 SHA1(40) 1400 SHA256(64)
W=/usr/share/wordlists/rockyou.txt # | 500 md5crypt($1$) 1800 sha512crypt($6$)
R=/usr/share/hashcat/rules/best64.rule# | 3200 bcrypt($2) 1000 NTLM 5600 NetNTLMv2 17200 zip
Score yourself: ✅ under target / ⚠️ over time / ❌ needed the solution. Re-drill anything not ✅.
Drill 1 — Identify a mystery hash, then crack it ⏱️ 4 min¶
Q: The first line of $C/hashes/hashes.txt is a bare 32-hex string with no prefix. What type is it, and what is the plaintext?
Solution
grep md5 $C/hashes/hashes.txt # -> md5: f25a2fc72690b780b2a14e140ef6a9e0
hashid 'f25a2fc72690b780b2a14e140ef6a9e0' # candidates: MD5, NTLM, ...
echo 'f25a2fc72690b780b2a14e140ef6a9e0' > md5.txt
hashcat -m 0 -a 0 md5.txt $W
Drill 2 — Crack the SHA-1 ⏱️ 3 min¶
Q: Crack the sha1: line in $C/hashes/hashes.txt. What is the plaintext?
Solution
grep sha1 $C/hashes/hashes.txt | awk '{print $2}' > sha1.txt # 40 hex chars
hashid "$(cat sha1.txt)" # -> SHA-1
hashcat -m 100 -a 0 sha1.txt $W
Drill 3 — Crack the SHA-256 ⏱️ 3 min¶
Q: Crack the sha256: line. Note the correct mode — it's not -m 0.
Solution
grep sha256 $C/hashes/hashes.txt | awk '{print $2}' > sha256.txt # 64 hex chars
hashcat -m 1400 -a 0 sha256.txt $W
Drill 4 — Crack the sha512crypt ($6$) shadow-style hash ⏱️ 6 min¶
Q: Crack the sha512crypt: line. Which mode, and why is this one slower than drills 1–3?
Solution
grep sha512crypt $C/hashes/hashes.txt | cut -d' ' -f2 > s512.txt # starts with $6$
hashid "$(cat s512.txt)" # -> sha512crypt
hashcat -m 1800 -a 0 s512.txt $W
# or let John auto-detect:
john --format=sha512crypt s512.txt --wordlist=$W ; john --show s512.txt
Drill 5 — Crack the bcrypt ($2) hash ⏱️ 8 min¶
Q: Crack the bcrypt: line. What is the plaintext, and what's the mode?
Solution
grep bcrypt $C/hashes/hashes.txt | cut -d' ' -f2 > bcrypt.txt
cat bcrypt.txt # must start with $2a$ / $2b$ / $2y$
hashcat -m 3200 -a 0 bcrypt.txt $W
Drill 6 — Crack the NTLM ⏱️ 3 min¶
Q: Crack the ntlm: line — another bare 32-hex string. Why is the mode different from drill 1's MD5?
Solution
grep ntlm $C/hashes/hashes.txt | awk '{print $2}' > ntlm.txt
hashid "$(cat ntlm.txt)" # MD5 / NTLM — same 32 hex ambiguity as drill 1
hashcat -m 1000 -a 0 ntlm.txt $W
# John equivalent: john --format=nt ntlm.txt --wordlist=$W
Drill 7 — Crack /etc/shadow with unshadow + John ⏱️ 8 min¶
Q: What is msfadmin's login password, cracked from 192.168.56.20's /etc/shadow?
Solution
# On the box (msfadmin can sudo), grab both files and copy back to Kali:
sudo grep msfadmin /etc/passwd > passwd.txt
sudo grep msfadmin /etc/shadow > shadow.txt
hashid "$(cut -d: -f2 shadow.txt)" # $1$ -> md5crypt
unshadow passwd.txt shadow.txt > crackme.txt # merge so John has the username
john --wordlist=$W crackme.txt
john --show crackme.txt
Drill 8 — Crack the password-protected secret.zip ⏱️ 6 min¶
Q: $C/archives/secret.zip is encrypted. Recover the archive password and read the flag inside.
Solution
zip2john $C/archives/secret.zip > z.hash # extract the crackable hash
cat z.hash # note the $pkzip2$... / $zip2$ format
john z.hash --wordlist=$W ; john --show z.hash
# hashcat route — PKZIP is mode 17200:
hashcat -m 17200 -a 0 z.hash $W
# then open it with the recovered password:
unzip -P letmein $C/archives/secret.zip -d /tmp/zc && cat /tmp/zc/.flag.txt
Drill 9 — Online SSH brute force with Hydra ⏱️ 6 min¶
Q: What is the SSH password of msfadmin on 192.168.56.20 — cracked online against the live service?
Solution
hydra -l msfadmin -P $W ssh://$T -t 4 -f
Drill 10 — Crack a NetNTLMv2 capture ⏱️ 6 min¶
Q: You captured a NetNTLMv2 authentication (e.g. from Responder). Save this hash to net.txt and crack it. What mode, and what is the plaintext?
admin::N46iSNekpT:08ca45b7d7ea58ee:88dcbe4446168966a153a0064958dac6:5c7830315c7830310000000000000b45c67103d07d7b95acd12ffa11230e0000000052920b85f78d013c31cdb3b92f5d765c783030
Solution
# (the hash above is the official hashcat example for mode 5600)
hashcat -m 5600 -a 0 net.txt $W
Drill 11 — Rules: crack a mangled password with best64 ⏱️ 7 min¶
Q: An admin "hardened" their password by reversing a common word. Generate md5(namrepus), then crack it — plain rockyou fails, but a rule set succeeds. Which rule mattered?
Solution
printf 'namrepus' | md5sum | cut -d' ' -f1 > mangled.txt # -> cc3dac1c2d5bda29540637b5ffd6428f
hashcat -m 0 -a 0 mangled.txt $W # plain rockyou: Exhausted, 0 cracked
hashcat -m 0 -a 0 mangled.txt $W -r $R # + best64: cracked
Score yourself¶
| # | Drill | Mode | Answer | ✅/⚠️/❌ |
|---|---|---|---|---|
| 1 | Identify + crack MD5 | 0 |
iloveyou |
|
| 2 | SHA-1 | 100 |
superman |
|
| 3 | SHA-256 | 1400 |
trustno1 |
|
| 4 | sha512crypt $6$ |
1800 |
iloveyou |
|
| 5 | bcrypt $2 |
3200 |
superman |
|
| 6 | NTLM | 1000 |
trustno1 |
|
| 7 | /etc/shadow (unshadow+John) |
500 |
msfadmin |
|
| 8 | secret.zip |
17200 |
letmein → CEH{cracked_the_zip_password} |
|
| 9 | Hydra SSH (online) | — | msfadmin |
|
| 10 | NetNTLMv2 | 5600 |
hashcat |
|
| 11 | best64 rule (mangled) | 0 -r |
namrepus |
When every row is ✅ cold, you own the whole identify → mode → crack loop the Practical drills relentlessly. Re-run ../challenge-lab/setup-challenges.sh for fresh hashes. Log results in ../../PROGRESS.md.
Sources¶
- Hashcat — example hashes (one sample of every mode): https://hashcat.net/wiki/doku.php?id=example_hashes
- Hashcat wiki: https://hashcat.net/wiki/ · John the Ripper (Openwall): https://www.openwall.com/john/
- THC-Hydra: https://github.com/vanhauser-thc/thc-hydra · NetExec: https://www.netexec.wiki/
- Cheatsheet:
../../cheatsheets/hashcat-john.md· Tool course: Module 06 — System Hacking