Guide
Hydra: Online Password Attacks and Defences
Hydra tests login endpoints by trying many username and password combinations against a live service. Understanding it matters for defence: an online password attack is noisy and preventable, and knowing the tool is what lets you recognise and stop it. This guide covers the attack, then the detection and hardening that neutralise it.
Scope: authorised lab work only, on TryHackMe machines or VMs I own.
Running this against systems without permission is illegal. Targets below are
placeholders (TARGET), not real hosts.
Step 1
Pick the Service and Method
Hydra supports many protocols. The common lab targets are remote-access and web login services.
SSH / RDP: remote administration logins.
FTP: file transfer logins.
HTTP basic or form: web application logins.
Step 2
Prepare Word Lists
An attack is only as good as its lists. One list of usernames, one of passwords. In a
lab, rockyou.txt is the standard password list.
-l user single username
-L users.txt username list
-p password single password
-P rockyou.txt password list
Step 3
Run the Attack (Lab)
Example syntax against placeholder targets. The web form example needs the request parameters and a string that identifies a failed login.
hydra -l user -P rockyou.txt ssh://TARGET
hydra -L users.txt -P rockyou.txt TARGET http-post-form \
"/login:username=^USER^&password=^PASS^:F=Invalid credentials"
-t: parallel tasks. Lower it to stay reliable and to mimic a quieter, more realistic attack.
F=: the text shown on a failed login, so Hydra knows which attempts failed.
Detection
How a Hydra Attack Looks to a Defender
Online brute force is loud. The signal is many failed logins from one source in a short window, then possibly a success.
Windows: a burst of Event ID 4625 (failed logon) from one source, and 4740 (account lockout) if a lockout policy is set. A 4625 run followed by a 4624 success is the pattern to alert on.
Linux: repeated failures in /var/log/auth.log; fail2ban bans the source after a threshold.
Web: many POSTs to the login path from one IP; a WAF or rate-limiter flags and throttles it.
Detection logic: N failed logins from one source within T seconds raises an alert, tuned so routine typos do not trip it.
Hardening
Shutting It Down
MFA: the single best control. A guessed password alone is not enough to log in, so online brute force stops paying off.
Account lockout / backoff: lock or delay after a few failures, so a wordlist attack never completes.
Key-based SSH: disable password authentication entirely; there is nothing to brute-force.
Do not expose services: put RDP and SSH behind a VPN rather than on the internet. This ties to the segmentation in my home network build.
Rate limiting: fail2ban on Linux, a WAF or lockout on web apps.
Strong, unique passwords: length defeats wordlists, and uniqueness defeats credential stuffing.
Why It Matters
The Takeaway
Online password attacks are among the easiest to detect and prevent, which is exactly why they should never succeed. MFA plus lockout plus not exposing the service removes the attack almost entirely, and the failed-logon signal catches whatever is left. Knowing the tool is what makes the detection obvious. This connects directly to my MFA and access control notes.