22.2 Online vs Offline Attacks, and Wordlists
Don prakarche password attacks aahet:
| Type | Where | Speed | Detectable? | Example |
|---|---|---|---|---|
| Online | Against a live service (SSH, web login) | Slow – network + lockouts | Yes – shows in logs | Hydra on SSH |
| Offline | Against captured hashes on your own machine | Very fast – millions/sec | No – attacker has the file | John, Hashcat |
Offline is far faster because there is no network and no lockout – which is exactly why leaked hash databases are so dangerous, and why slow hashing matters.
Wordlists are files of likely passwords. Kali ships rockyou.txt (14 million real leaked passwords):
ls -l /usr/share/wordlists/ # available lists
sudo gunzip /usr/share/wordlists/rockyou.txt.gz # unzip it once
wc -l /usr/share/wordlists/rockyou.txt # count the entries
Rules mutate a wordlist (add numbers, capitalise, swap letters for symbols) so password also becomes Password1, p@ssw0rd, and so on – this catches most human passwords without a full brute force.
Ravindra Bagale's Tip
Students immediately start "brute force" (all combinations) – for 8 characters that takes years. In the real world, 90% of passwords are found with a good wordlist + rules, because people choose guessable passwords. Wordlist first, brute force later.
Ravindra Bagale's Tip – मराठी
Students लगेच "brute force" (सगळे combinations) सुरू करतात – तो 8 characters साठी वर्षानुवर्षे लागतो. खऱ्या जगात 90% passwords एक चांगली wordlist + rules ने मिळतात, कारण लोक अंदाज लावता येणारे passwords ठेवतात. आधी wordlist, मग brute force.
Ravindra Bagale's Tip – हिंदी
Students तुरंत "brute force" (सारे combinations) शुरू कर देते हैं – 8 characters के लिए उसमें सालों लगते हैं. असली दुनिया में 90% passwords एक अच्छी wordlist + rules से मिल जाते हैं, क्योंकि लोग अंदाज़ा लगाने लायक passwords रखते हैं. पहले wordlist, फिर brute force.
Practice task
Unzip rockyou.txt and count its lines. Search it for three common weak passwords (grep -n '^password$' rockyou.txt). Write why using any word from this list is dangerous.
Extended teaching notes
Why this lesson matters
Cryptography fails when people invent it. Use standard libraries, modern algorithms (AES-GCM, TLS 1.2+, bcrypt/argon2) and protect keys in a KMS or secrets manager.
Where crypto shows up
[('Passwords', 'bcrypt/argon2/PBKDF2 via the framework hasher — never plain MD5/SHA1.'), ('TLS', "Terminate on ALB/nginx with ACM/Let's Encrypt; redirect HTTP to HTTPS."), ('JWT / API tokens', 'Short lifetime, rotate signing keys, store secrets outside Git.'), ('Disk / S3', 'Provider or customer-managed keys; least privilege on decrypt.')]
Mini case study
Suppose we are on a purple-team exercise for an Indian mid-size company (sample data). Red notes a technique from this lesson against a lab clone. Blue must show the control that stops it, the log that would have fired, and the ticket that hardens production. That is the standard this course trains you for.
Defender's worksheet (do this today)
- Write the lesson title, date and the exact lab target you are allowed to use.
- List three owned systems (VMs, apps, or cloud accounts) where this lesson applies.
- Run one safe check from the lesson on a lab system only. Paste the command and output.
- Write a two-sentence fix you would give a teammate.
- Name one related public advisory (CERT-In, CISA, NVD, or a vendor bulletin) with its date.
Indian workplace (sample data)
Suppose we are a junior analyst at Infosys, TCS, Wipro or a fintech SOC in Bengaluru/Pune. Turn this lesson into one checklist item with an owner, a due date and a place to store evidence (ticket + screenshot).
Global practice
Compare your notes with OWASP, CIS Benchmarks, NIST CSF/IR guidance or a cloud Well-Architected security question. Write five lines on what overlaps.
Everyday analogy
Explain the risk and the fix to a family member without jargon. If they can repeat the warning, you understand it well enough to teach juniors.
Key terms
- Control: a safeguard (patch, config, process, detection).
- Finding: a weakness backed by evidence.
- Remediation: the fix plus how you verified it.
- Scope: systems you have written permission to touch.
- Least privilege: only the access the task needs.
- Defence in depth: several layers so one failure does not end the story.
Common mistakes
- Skipping written permission "just for a quick scan".
- Practising on hostel, office or public targets without authorisation.
- Collecting tool output without writing the fix.
- Copying attack steps onto production to "verify". Defenders verify with versions, configs and patches.
- Publishing screenshots that contain secrets, cookies or internal hostnames.
Recap
- Evidence, fix, owner, date.
- Own lab only.
- Fix > spectacle.