BiTree
  • Search For Lessons
  • Curriculum
  • Pricing
  • For Educators
  • Become a Tutor
  • About
  • Contact
Log InGet Started

Questions, concerns, bug reports, or suggestions? We read every message, write to us at [email protected].

More ways to reach us →
BiTree

Live coding lessons for aspiring developers and security professionals.

[email protected]

(201) 785-7951

Mon–Fri, 9 AM–5 PM EST

Learn

  • Search For Lessons
  • Curriculum
  • Pricing

Company

  • About
  • For Educators & Schools
  • Become a Tutor
  • Contact Us

Legal

  • Terms of Service
  • Privacy Policy
© 2026 BiTree. All rights reserved.
Curriculum/Cybersecurity/Password Attacks and Credential Security/Brute Force and Password Attacks with Hydra
50 minIntermediate

Brute Force and Password Attacks with Hydra

After this lesson, you will be able to: Distinguish brute force from dictionary attacks, use wordlists effectively, run Hydra against common protocols, understand online vs offline attacks and hash cracking with hashcat/John, and explain credential stuffing; demonstrate and then mitigate an attack in a lab.

This lesson covers brute force vs dictionary attacks, wordlists (rockyou.txt, SecLists, CeWL), Hydra against HTTP forms and SSH/FTP, the critical online-vs-offline distinction, hash cracking with hashcat and John the Ripper, credential stuffing, and a DVWA lab that runs Hydra then defeats it with rate limiting and lockout.

Prerequisites:Credentials: The Keys to the Kingdom (intro)

💡 Authorization first

Run these tools only against your own DVWA instance or a sanctioned lab. Attacking real logins is illegal and triggers lockouts and alerts.

Brute force vs dictionary attacks

A pure brute force tries every possible combination; it is guaranteed eventually but astronomically slow against long passwords. A dictionary attack tries likely passwords from a wordlist, which is far faster because humans pick predictable passwords. The difference matters for time estimates: brute forcing an 8-character random password is infeasible, but a dictionary catches 'Summer2024!' instantly because it is in every list.

Wordlists

rockyou.txt is the famous list of ~14 million real passwords leaked in the 2009 RockYou breach, and it cracks a depressing fraction of weak passwords. SecLists is a curated collection of wordlists for passwords, usernames, directories, and more. CeWL spiders a target website to generate a custom wordlist from its own content, which catches company-specific and themed passwords a generic list misses. Choosing the right list is half the battle.

Hydra against common protocols

Hydra is the standard network login brute forcer. The HTTP form syntax needs the failure string so Hydra knows a wrong guess.

tsx
# SSH
hydra -l admin -P rockyou.txt ssh://<target_ip>
# FTP
hydra -L users.txt -P rockyou.txt ftp://<target_ip>
# HTTP POST form (DVWA-style): specify path, body, and the failure marker
hydra -l admin -P rockyou.txt <target_ip> http-post-form \
"/login.php:username=^USER^&password=^PASS^:Login failed"

Online vs offline, and hash cracking

Online attacks hit a live service: slow (network latency), detectable (logs, alerts), and stoppable (rate limiting, lockout). Offline attacks crack a stolen hash file on the attacker's own hardware: fast (no network, GPU-accelerated), undetectable (you are not touching the target), and only possible after a breach exposed the hashes. hashcat (GPU) and John the Ripper crack offline; a modern GPU tries billions of fast-hash guesses per second, which is why password hashes must be slow (bcrypt/Argon2) and salted. Salts defeat precomputed rainbow tables by making every hash unique.

Credential stuffing

Credential stuffing replays username/password pairs leaked from one breach against many other services, betting on password reuse. It is not guessing; it is using known-valid credentials elsewhere. Because so many people reuse passwords, a single leak compromises accounts across the web. The root cause is reuse, and the defenses are unique passwords (a manager), MFA, and breach monitoring (the Have I Been Pwned API).

Lab: attack DVWA, then defend it

Run the attack, then implement the mitigation and watch it fail.

  1. 1

    1. Run DVWA in Docker and set a weak, common password on the login.

  2. 2

    2. From Kali, run Hydra against the login form with rockyou.txt and watch it find the password quickly.

  3. 3

    3. Now add rate limiting and account lockout (DVWA's higher security level, or a small proxy) in front of the login.

  4. 4

    4. Re-run Hydra and observe it stall: requests get throttled and the account locks.

  5. 5

    5. Conclude with the defense stack: slow salted hashing, rate limiting, lockout, MFA, and breach monitoring.

Quick Check

Why is an offline hash-cracking attack so much more dangerous than an online brute force?

Pick the best reason.

Common mistakes only experienced testers catch

Omitting the failure string in Hydra's http-post-form, so every attempt looks successful. Running online attacks so aggressively they lock the very account you want. Using a fast hash (SHA-256/MD5) for password storage, which makes offline cracking trivial. Forgetting salts, leaving rainbow tables viable. Conflating credential stuffing (known-valid pairs) with brute force (guessing). Testing on systems you do not own.

Sign in and purchase access to unlock this lesson.

Sign in to purchase
←Credentials: The Keys to the Kingdom
Back to Password Attacks and Credential Security
Password Managers and Credential Hygiene→