Homework
Practice tasks to solidify your understanding of hashcat command structure — to be completed before Lesson 04.
Task 1 — Command Construction
What to do
For each of the following scenarios, write the complete hashcat command you would use. Do not run them yet — just write the commands.
Scenarios
- MD5 dictionary attack — Crack MD5 hashes in
dump.txtusingrockyou.txt. Save results tocracked.txtin hash:password format. - NTLM with rules — Crack NTLM hashes in
ad_hashes.txtusingrockyou.txtwith thebest64.rulerule file. Save only the plaintext passwords topasswords.txt. - SHA-512 mask attack — Crack SHA-512 (Unix) hashes in
shadow.txtusing a mask attack with all lowercase characters, trying lengths 5 through 10. Use high workload on GPU only. - Hybrid attack — Crack MD5 hashes in
web_hashes.txtusing a hybrid dictionary+mask attack. Usecommon_words.txtas the wordlist and append 4 digits to each word. Name the sessionweb_audit. - Combinator attack — Crack NTLM hashes in
corp_hashes.txtby combining words fromfirst_names.txtandyears.txt. Output hash:password pairs tocombined_results.txt.
Requirements
- Each command must be syntactically correct (runnable without errors)
- Include all necessary flags for the scenario described
- Use the correct
-mand-avalues for each scenario
Self-check: For each command, verify: correct hash mode? Correct attack mode? Arguments in the right order? Output format specified where needed?
Task 2 — Parameter Exploration
What to do
Run hashcat --help and answer the following questions. Include the relevant flag or value in your answer.
Questions
- What is the hash mode number for bcrypt?
- What flag would you use to set the maximum number of threads on the CPU?
- What does the
--forceflag do, and why is it generally discouraged? - What is the difference between
--outfile-format 3and--outfile-format 5? - What flag shows you all detected backend devices (GPUs, CPUs) and their capabilities?
- How do you tell hashcat to skip the first N words in a wordlist, and how do you limit it to process only N words?
- What is the flag for running hashcat in benchmark mode?
Self-check: Each answer should reference a specific flag (e.g., -b, --skip, etc.) found in the --help output.
Task 3 — Keyspace Calculation
What to do
Calculate the total keyspace (number of candidate passwords) for each of the following mask configurations. Show your math.
Masks
?d?d?d?d— 4 digits?l?l?l?l?l?l— 6 lowercase letters?u?l?l?l?l?d?d— uppercase + 4 lowercase + 2 digits?a?a?a?a?a?a?a?a— 8 printable characters?d?d?d?d?d?dwith--increment --increment-min 4 --increment-max 6— digits, lengths 4 through 6
Reference
?d= 10 characters (0–9)?l= 26 characters (a–z)?u= 26 characters (A–Z)?s= 33 characters (special)?a= 95 characters (all printable)
Self-check: Verify your answers using hashcat -m 0 -a 3 --keyspace [mask]. The --keyspace flag prints the total candidate count without cracking.
Task 4 — Error Diagnosis
What to do
Each of the following commands has an error. Identify the mistake and write the corrected command.
Broken commands
# Command A: Dictionary attack on NTLM hashes
hashcat -m 0 -a 0 -o results.txt ntlm_hashes.txt rockyou.txt
# Command B: Mask attack missing the mask argument
hashcat -m 1000 -a 3 -o results.txt hashes.txt
# Command C: Hybrid attack with wrong argument order
hashcat -m 0 -a 6 -o results.txt hashes.txt ?d?d rockyou.txt
# Command D: Incremental mode without a mask long enough
hashcat -m 0 -a 3 -i --increment-min 4 --increment-max 8 hashes.txt ?a?a?a?a
# Command E: Restoring a session that was never named
hashcat --restore
For each command
- Explain what is wrong
- Write the corrected version
- Explain why the fix works
Self-check: Test your corrected commands against test hashes (using the setup from the lab) to verify they work.
Grading Criteria
| Task | Points | Key Criterion |
|---|---|---|
| Task 1 — Command Construction | 25 | All 5 commands are syntactically correct with proper flags |
| Task 2 — Parameter Exploration | 25 | All 7 questions answered with specific flag references |
| Task 3 — Keyspace Calculation | 25 | Correct math shown; answers verified with --keyspace |
| Task 4 — Error Diagnosis | 25 | All 5 errors identified with corrected commands and explanations |