hydra
Table of Contents
Fast, parallelised network login cracker. Primary tool for credential brute-forcing against network services and web forms. Use when you have a valid username and need to crack the password, or when testing default credentials at scale.
Related: Password Cracking Methodology John The Ripper Hashcat Web Application Testing Methodology
Core Flags
| Flag | Description |
|---|---|
-l |
Single username |
-L |
Username list file |
-p |
Single password |
-P |
Password list file |
-t |
Parallel tasks per target (default 16) |
-s |
Custom port |
-f |
Stop after first valid credential found |
-V |
Verbose — show each attempt |
-o |
Output results to file |
Common Workflows
SSH
# Known username hydra -l admin -P /usr/share/wordlists/rockyou.txt ssh://$IP # Username list hydra -L users.txt -P /usr/share/wordlists/rockyou.txt ssh://$IP -t 4 # Custom port hydra -l admin -P /usr/share/wordlists/rockyou.txt -s 2222 ssh://$IP
FTP
hydra -l admin -P /usr/share/wordlists/rockyou.txt ftp://$IP
RDP
hydra -l administrator -P /usr/share/wordlists/rockyou.txt rdp://$IP -t 4
SMB
hydra -l administrator -P /usr/share/wordlists/rockyou.txt smb://$IP
HTTP POST Form
Requires three components: URL path, POST parameters with
^USER^ and ^PASS^ placeholders, and failure string.
# Basic form hydra -l admin -P /usr/share/wordlists/rockyou.txt \ $IP http-post-form "/login:username=^USER^&password=^PASS^:Invalid credentials" # With cookie (authenticated area) hydra -l admin -P /usr/share/wordlists/rockyou.txt \ $IP http-post-form \ "/login:username=^USER^&password=^PASS^:Invalid:H=Cookie: session=abc123" # HTTPS hydra -l admin -P /usr/share/wordlists/rockyou.txt \ $IP https-post-form "/login:username=^USER^&password=^PASS^:Invalid"
HTTP Basic Auth
hydra -l admin -P /usr/share/wordlists/rockyou.txt \ http-get://$IP/protected-path
MySQL / PostgreSQL
hydra -l root -P /usr/share/wordlists/rockyou.txt mysql://$IP hydra -l postgres -P /usr/share/wordlists/rockyou.txt postgres://$IP
Tips
- Use
-fto stop on first hit — avoids locking accounts - Reduce
-tfor SSH and RDP — too many parallel connections triggers lockouts or bans;-t 4is safer - The failure string for HTTP forms must appear in the response when login fails — inspect the response in Burp first
- Check the request in Burp to get exact parameter names before building the http-post-form syntax
- Use
-Vduring testing to confirm requests are being formed correctly before running large wordlists