Hydra (THC-Hydra) is the fastest and most protocol-flexible online password cracker in the offensive toolkit. Where Hashcat cracks stolen hashes offline, Hydra attacks a live authentication service — throwing username and password guesses at SSH, RDP, SMB, databases and web login forms in parallel until one lands.
This guide takes you from a clean install to real attacks against a lab, then across the line: the second half shows how a SOC detects Hydra's noisy fingerprint with KQL and SPL, and how to shut the technique down with rate limiting, lockout, MFA and key-based auth. Every command is copy-pasteable and every attack targets a machine you control.
◈ Table of Contents
01 — What Hydra Is & Why It Matters
FoundationsHydra is a parallelised network logon cracker maintained by van Hauser / THC. Given a target service, a list of usernames and a list of passwords, it opens many connections at once and tests credential pairs far faster than any human could by hand. It ships pre-installed on Kali Linux, Parrot OS and most offensive distributions, and it natively speaks more than 50 protocols — from SSH, FTP and RDP to MySQL, PostgreSQL, SMB, VNC, SNMP, LDAP and arbitrary HTTP forms.
The distinction that trips up beginners: Hydra is an online attack tool. It talks to a running service over the network and is bounded by that service's response time, rate limits and lockout policy. Hashcat and John the Ripper are offline — they chew through a captured hash at millions of guesses per second with no network in the loop. You reach for Hydra when you have a login prompt but no hash; you reach for Hashcat once you have the hash.
Credential Auditing
Prove that a service still accepts weak or default passwords before an attacker does. The core justification for the tool on an authorised engagement.
Password Spraying
One or two common passwords against a large user list — the lockout-safe inversion of brute force that mirrors real intrusion tradecraft.
Control Validation
Confirm that account lockout, rate limiting and alerting actually fire. If your SOC does not see the run, that is the finding.
Web App Testing
Custom HTTP POST-form attacks against bespoke login pages that scanners rarely handle well.
AUTHORISATION FIRST. Running Hydra against a system you do not own or lack written permission to test is a criminal offence in most jurisdictions. Every command in this guide assumes a lab you built or a target inside a signed scope-of-work. Never point it at a login you do not control.
02 — Prerequisites & Lab Setup
Before you startYou need an attacker box, a legal target, and wordlists. The table below is the baseline; none of it is exotic and all of it runs comfortably in a couple of VMs on a laptop.
| Component | Requirement | Notes |
|---|---|---|
| Attacker OS | Kali / Parrot / any Linux recommended | Hydra is pre-installed on Kali & Parrot. Windows works via WSL2. |
| Hydra version | 9.5 (current stable) | Confirm with hydra -h after install. Older 9.x builds are fine for everything here. |
| Target (lab) | Metasploitable 2/3, DVWA, or your own VM | Provides SSH/FTP/MySQL/web logins you are allowed to hammer. |
| Wordlists | SecLists + rockyou.txt | Kali ships rockyou compressed at /usr/share/wordlists/. |
| Network | Host-only or NAT lab segment | Keep the noise off any production or shared network. |
| RAM / CPU | 2 vCPU / 2 GB minimum | Hydra is network-bound, not CPU-bound; modest specs are fine. |
Two lists do 90% of the work: a small username list you build for the target, and a large password list like rockyou. Unpack rockyou and install SecLists for its curated defaults and spray lists.
Build a target-specific username list from the company name, employee first.last patterns and any breach data in scope. A tight 20-line user list beats a generic 5,000-line one because it keeps you under lockout thresholds.
Metasploitable 2 is the classic punching bag: it exposes SSH, FTP, Telnet, MySQL and PostgreSQL with weak creds by design. Import it, note its IP, and confirm you can reach the services from your attacker box.
Do not expose a deliberately vulnerable VM like Metasploitable to the internet or a routable corporate VLAN. Keep it on a host-only or isolated NAT network — it will be compromised within minutes if it is reachable.
03 — Method 1: Install via APT
Fastest pathOn Kali and Parrot, Hydra is already there. On plain Debian or Ubuntu it is a single package. This is the right method for almost everyone — use it unless you need a feature only present in the latest Git tree.
Refresh the index and pull in Hydra. The package includes both the CLI (hydra) and the optional GTK GUI (xhydra).
Confirm the version and, crucially, which service modules were compiled in. If a protocol you need is missing from this list, that is your cue to build from source (Method 2).
- hydra -h prints v9.x with a build date
- the Supported services line includes ssh, rdp, smb, mysql, http-post-form
- xhydra launches if you prefer a GUI to assemble commands
04 — Method 2: Build Hydra From Source
Latest buildCompile from the official THC repository when your distro packages an old release or when a module you need (for example newer database or SSL libraries) is not enabled in the package. The build is autotools-based and takes three steps.
These packages give you the compiler plus the optional libraries that unlock the SSH, SSL, database, SMB and other modules. Skipping a dev library simply drops that module from the build — install the lot.
Clone the repo, run the bundled configure script (it prints exactly which modules it enabled), then compile. Read the configure summary — it tells you whether ssh, mysql and rdp support made it in.
If configure reports a module you need is disabled, install the matching -dev package it names, then re-run configure before make. Compiling against a half-configured tree drops modules silently — you will only notice when Hydra says the service is unsupported mid-engagement.
Install into /usr/local and confirm the freshly built binary is the one on your PATH rather than an older packaged copy.
If which hydra still points at /usr/bin/hydra, either remove the apt package or run the new build by absolute path (/usr/local/bin/hydra). Mixing two versions on one box is the source of countless "but that flag exists" bug reports.
05 — Method 3: Docker Container
Isolated & portableContainerising keeps Hydra and its many library dependencies off your host and makes the exact toolchain reproducible on any machine. Because Hydra only makes outbound TCP connections, a container needs no special privileges — this is the cleanest way to run it on a box you do not want to pollute.
A slim image built on Kali's rolling repo, with your wordlists and loot directory bind-mounted from the host so results survive teardown. No privileged, no host networking — Hydra just needs to reach the target IP.
Build the image once, then invoke Hydra through Compose. Because the ENTRYPOINT is already hydra, you pass only the arguments. Everything after the service name is handed straight to the binary.
Keep the container on the same Docker network as a lab target (or use network_mode: host only if the target is on your LAN). For CTF and remote scopes, the default bridge with outbound access is all Hydra needs.
06 — Command Anatomy & Your First Attack
Core syntaxAlmost every Hydra command follows one shape: credentials, then options, then the target and protocol. Learn the four credential flags and a handful of control flags and you can attack anything Hydra supports.
| Flag | Meaning | Example |
|---|---|---|
| -l / -L | Single login / login list file | -l admin -L users.txt |
| -p / -P | Single password / password list file | -p Summer2026! -P rockyou.txt |
| -C | Colon-separated user:pass combo file | -C combos.txt |
| -e nsr | Also try null, same-as-login, reversed | -e nsr |
| -s | Non-default port | -s 2222 |
| -t | Parallel tasks per target (default 16) | -t 4 |
| -f / -F | Stop after first hit (per host / global) | -f |
| -V / -vV | Verbose — show every attempt | -vV |
| -o | Write found creds to a file | -o found.txt |
| -M | Attack a list of targets | -M targets.txt |
Hydra accepts the target either as a URL (ssh://host) or as a trailing host protocol pair. Both are equivalent; the URL form is cleaner and is what the rest of this guide uses.
Point Hydra at the lab's SSH service with a single known user and a small list. The -V flag prints each pair as it goes so you can watch the mechanics; drop it once you trust the run.
SSH deliberately throttles concurrent auth attempts. Hydra caps SSH sensibly, but pushing -t above 4 on SSH usually causes connection resets and false negatives — the run "misses" a password that is actually in the list. Keep SSH slow.
To spray one password across many users while staying under lockout, loop users inside each password with -u, and add -e nsr to also test the empty password, the username-as-password, and the reversed username — three of the most common weak choices.
Spraying beats brute force against real targets. One well-chosen password (Season+Year!, the company name, Welcome1) against every account typically nets a hit without tripping the per-account lockout counter that a deep password list would.
07 — Cracking Network Services
Protocol playbookEvery module takes the same credential flags; only the protocol keyword and a few module options change. Here are the services you will meet most on internal engagements, each as a copy-pasteable recipe.
| Service | Default port | Hydra keyword | Safe -t |
|---|---|---|---|
| SSH | 22 | ssh | 1–4 throttled |
| FTP | 21 | ftp | 16 fast |
| Telnet | 23 | telnet | 16 fast |
| RDP | 3389 | rdp | 1 lockout risk |
| SMB | 445 | smb | 1 lockout risk |
| MySQL | 3306 | mysql | 8–16 |
| PostgreSQL | 5432 | postgres | 8–16 |
| MSSQL | 1433 | mssql | 8–16 |
| VNC | 5900 | vnc | 1–4 |
| HTTP form | 80/443 | http-post-form | 16–32 |
Legacy clear-text protocols with no throttling — Hydra runs fast against them. Telnet is quirky: it needs the failure prompt string, which the module usually auto-detects, but you can pin it if results look wrong.
RDP is a high-value target on internal networks. Keep -t low: Windows lockout policy and the RDP stack both punish parallelism, and aggressive runs lock out real users — a fast way to fail an engagement.
Domain accounts commonly lock after 3–5 bad attempts. Enumerate the lockout policy first (net accounts / Get-ADDefaultDomainPasswordPolicy) and stay one attempt below it. Locking out an entire OU during a test is a career-limiting move.
The smb module tests Windows/Samba logins and reports useful status such as whether an account is disabled or the password expired. Use single-task ordering to respect lockout.
For deep SMB/AD credential work, pair Hydra with NetExec (formerly CrackMapExec). Hydra confirms a working credential fast; NetExec then sprays it across the whole subnet and tells you where it is admin.
Exposed database ports are a goldmine — a valid DB login often means data access and sometimes code execution. All three speak the same Hydra grammar; only the protocol keyword changes.
VNC frequently uses only a password (no username), so drop the login flag entirely. SNMP community strings are effectively passwords for network gear — public and private still work on shocking numbers of devices.
Feed a file of targets with -M to sweep a subnet for one weak credential. Combine with -F to stop globally on the first success when you only need a foothold.
08 — Attacking Web Login Forms
The hard partWeb forms are where most people get stuck, because Hydra cannot "see" the page — you must describe the request and tell it how to recognise failure. Get the three colon-separated fields right and the http-post-form module is unstoppable.
First learn exactly what the browser sends. Open the login page in Firefox, submit a bogus login with DevTools' Network tab open (or Burp intercept on), and read off the request path, the POST body parameter names, and the message shown on failure.
The module option is one string of three fields separated by colons: the request path, the POST body with ^USER^ and ^PASS^ placeholders, and a condition string. Prefix the condition with F= for a failure marker or S= for a success marker.
Choose the most reliable marker. If the failure message is inconsistent but a successful login always redirects or shows "Logout", invert the logic with S=Logout. A wrong condition makes Hydra report either zero hits or every pair as valid.
Assemble the full command. Note the module keyword http-post-form and that the whole three-field string is a single quoted argument passed after the host.
For HTTPS forms use the https-post-form keyword (or add -S). For GET-based logins use http-get-form. Mixing them up produces a flat "0 valid passwords found" with no error — the request simply never matches.
Many forms require a session cookie and reject requests without it. Append H= (extra header) and C= (cookie fetch path) options as additional colon fields. Per-request anti-CSRF tokens defeat Hydra outright — that is a job for a scripted tool, not Hydra.
If a hidden field changes on every page load (a CSRF token), Hydra cannot refresh it between guesses and every attempt fails. Switch to Burp Intruder's recursive-grep payload or a short Python script that pulls a fresh token per request.
09 — Performance, Wordlists & Resume
Speed & controlRaw speed is rarely the goal — accuracy and staying under detection thresholds are. These flags control the trade-off between throughput, reliability and stealth.
| Goal | Flag(s) | Guidance |
|---|---|---|
| Max throughput | -t 16..64 | Safe for FTP/HTTP/DB. Too high for SSH/RDP. |
| Reliability (SSH/RDP) | -t 1..4 | Low parallelism avoids resets and false negatives. |
| Slow / stealthy | -W, -c | Wait between attempts to slip under rate alarms. |
| Timeouts | -w 30 | Raise the per-attempt wait on slow/laggy links. |
| Stop early | -f / -F | Quit on first hit per-host / globally. |
| Resume | -R | Continue an aborted session from hydra.restore. |
When no wordlist fits — for example a known numeric PIN policy — generate candidates on the fly with -x MIN:MAX:CHARSET. Use this sparingly; the keyspace explodes fast and online brute force is slow.
A 6-character full-keyspace mask is billions of candidates. Against a network service at a few hundred tries per second, that is effectively never. Masks are for tiny, well-defined keyspaces only — everything else belongs in a wordlist.
Use -C for a file of known user:pass pairs (for example leaked credentials you are checking for reuse). If a long run is interrupted, Hydra writes hydra.restore — resume exactly where it stopped with -R.
Write results to disk with -o found.txt (or -b json -o found.json for machine-readable output). Terminal scrollback is not evidence — a timestamped output file is what goes in the report.
10 — Detection & Defense (KQL / SPL)
Blue-team viewHydra is loud. A brute-force or spray run produces a burst of authentication failures from a single source in a short window — a pattern any SOC can catch cheaply. Here is what the same attack looks like from the defensive side, with a paired KQL and SPL query for each vantage point, followed by the controls that neutralise it.
A spike of Event ID 4625 (failed logon) from one source IP across many accounts in a five-minute window is the classic spray signature. The KQL runs in Microsoft Sentinel / Defender; the SPL is the Splunk equivalent over the same Windows logs.
On Linux, failed SSH logins land in auth.log / secure as "Failed password" lines. Extract the source IP and alert on volume per source. Again, KQL first, SPL second, over the same syslog stream.
Add a follow-on rule that fires when a 4625/Failed-password burst from an IP is immediately followed by a 4624 (success) or "Accepted password" from that same IP. That success-after-many-failures pivot is the high-fidelity "the brute force worked" alert.
Detection tells you it happened; these controls stop it working. Layer them — no single control is sufficient, but together they make online brute force pointless.
- 1MFA everywhere. A correct password alone gets the attacker nowhere. This is the single highest-value control against every attack in this guide.
- 2Account lockout / throttling. Lock or exponentially delay after a small number of failures. On Linux,
fail2banbans the source IP after N failed SSH attempts. - 3Key-based SSH auth. Set
PasswordAuthentication noin sshd_config — Hydra has nothing to guess against a key. - 4Rate limiting & WAF. Cap login attempts per IP per minute on web forms; a WAF rule on repeated POSTs to
/loginbluntshttp-post-form. - 5Do not expose management ports. Put RDP, SSH, SMB and databases behind a VPN or bastion. An unreachable service cannot be brute-forced.
- A test Hydra run trips an alert in your SIEM within minutes
- The source IP is auto-banned (fail2ban) or the account throttles/locks
- Even a correct password is stopped by MFA at the second factor
11 — Troubleshooting & Common Errors
When it misbehavesMost Hydra "failures" are configuration mistakes, not tool bugs. Match the symptom to the fix below before blaming the target.
| Symptom | Likely cause | Fix |
|---|---|---|
| 0 valid passwords found (but you know one is right) | Wrong web-form condition, or SSH task count too high | Re-check the F=/S= string; drop SSH to -t 4 |
| Every pair reported as valid | Failure string never appears / matches success | Pick a marker unique to failure, or invert to S= |
| "child died" / connection resets | Service throttling under too much parallelism | Lower -t, add -W wait, raise -w timeout |
| "Unsupported protocol" | Module not compiled into your build | Rebuild from source with the matching -dev lib |
| Runs but never finishes | rockyou against a slow online service | Use a smaller top-N list; spray instead of brute |
| Accounts getting locked out | Password list deeper than lockout threshold | Switch to spraying (-p + -u); stay under the limit |
| http-post-form ignores cookies | Session/CSRF handling missing | Add H=Cookie: field; scripted tool for CSRF tokens |
When a web-form attack behaves oddly, run Hydra with -d (debug) against a single known-bad and a single known-good credential. Comparing the two raw responses shows you instantly which string reliably distinguishes success from failure.
12 — Sources & References
Verify everythingPrimary documentation and standards used in this guide. When a flag or module behaves unexpectedly, the built-in hydra -h and the official README are the authoritative reference for your exact build.
Test your own logins before an attacker does. Use Hydra only inside an authorised lab or a signed scope-of-work — then close the gaps it finds with MFA, lockout and key-based auth. Run the KQL and SPL from Section 10 in your SIEM to confirm you would actually see the run.
Want the detection side turned into a ready-to-deploy rule? Explore our SOP library and Threat Hunting blog, or check exposed credentials and services with the CyberHawk IOC Scanner.
◈ Stay Connected
Follow CyberHawk Threat Intel for threat intelligence, deployment guides and hands-on SOC tooling content.
"They can't exploit you if you are the Exploit."