Hydra Brute Force Tool: A Practical Guide for Testing Your Own Logins

Photo by Sora Shimazaki on Pexels
Based on the official docs for thc-hydra 9.7 Hardware test not run How guides are made and checked

Introduction to Hydra

Hydra (also called THC-Hydra) is a fast, parallelised login cracker. It is a command-line tool that tries lots of username and password combinations against a network service to see which ones work. It supports a long list of protocols, including SSH, FTP, HTTP forms and basic auth, SMB, RDP, POP3, MySQL and PostgreSQL.

The honest use for a tool like this is checking the strength of logins you own or have written permission to test. If you can brute force your own SSH or admin login in a few minutes, so can anyone else, and that is exactly the thing worth finding out before someone unfriendly does. This guide uses Hydra that way: on your own servers, your own accounts, your own lab.

Only point Hydra at systems you own or have explicit, written permission to test. Running it against anything else is unauthorised access and is illegal in most places. Everything below assumes a target you control.

What You Need

  • A machine with Hydra installed (install steps are below).
  • A target service you own, for example an SSH server in your home lab.
  • A small wordlist to test with. On Kali, files under /usr/share/wordlists/ are a common starting point; rockyou.txt is the usual example.

The current stable release at the time of writing is thc-hydra 9.7. Versions in the 9.x series share the same command-line options, so the examples here apply whether your distro ships 9.4 or 9.7.

How to Install Hydra

On Kali, Debian and Ubuntu

Hydra is packaged in the standard repositories, so the package manager is the simplest route:

sudo apt update
sudo apt install hydra

Kali Linux ships Hydra by default, so you usually have it already. Confirm the version with:

hydra -h | head -n 1

On RHEL, CentOS and Fedora

sudo dnf install hydra

Using Docker

If you would rather not install it on your host, there is a community Docker image:

docker pull vanhauser/hydra
docker run -it --rm vanhauser/hydra hydra -h

Building from Source

To compile the latest version yourself, follow the official instructions on the thc-hydra GitHub page. In short:

git clone https://github.com/vanhauser-thc/thc-hydra.git
cd thc-hydra
./configure
make
sudo make install

Basic Command Line Examples

Each example targets one protocol. Replace username, passwordlist.txt and target_ip with your own values, and remember these should be your own systems.

Example 1: Testing an SSH Login

hydra -l username -P passwordlist.txt ssh://target_ip

This tries each password in passwordlist.txt for the account username over SSH. If it finds a match, it prints the working login: password pair.

Example 2: Testing an FTP Login

hydra -l username -P passwordlist.txt ftp://target_ip

Example 3: Testing HTTP Basic Auth

For a page protected by HTTP basic authentication:

hydra -l admin -P passwordlist.txt target_ip http-get /admin

Example 4: Testing an HTTP Login Form

Web logins are the most common case and the fiddliest, because Hydra has to know the form fields and how a failed login looks. The http-post-form module takes three colon-separated parts: the path, the POST body with ^USER^ and ^PASS^ placeholders, and a string that appears on a failed attempt:

hydra -l admin -P passwordlist.txt target_ip \
  http-post-form "/login:user=^USER^&pass=^PASS^:Invalid credentials"

If the failure string is wrong, Hydra reports every attempt as a success, so check it against a real failed login first.

Command Line Options for Hydra

Here are the options you will reach for most often, with what they actually do. (The -t, -s, -v and -f switches are commonly mixed up, so they are spelled out here.)

SwitchWhat it does
-lA single login name to test.
-LA file containing a list of login names.
-pA single password to test (useful for password spraying one password across many users).
-PA file containing a list of passwords.
-CA file of login:password pairs, tried as combinations instead of -L with -P.
-e nsrAlso try the empty password (n), the login as the password (s), and the login reversed (r).
-sUse a non-default port for the service.
-SConnect over SSL/TLS.
-tNumber of parallel tasks (connections). The default is 16; lower it for fragile services.
-fStop as soon as a valid pair is found for a host (-F stops across all hosts).
-oWrite the results to a file.
-VVerbose: show every login: password pair as it is tried.
-vLess verbose than -V; shows some progress detail.
-xGenerate passwords from a pattern (brute force) instead of a list, for example -x 6:8:aA1.
-RRestore a previous session that was aborted.

Run hydra -h for the full list, and hydra -U <module> (for example hydra -U http-post-form) for help with a specific protocol module.

Tips for Responsible Testing

Scan First to Know What Is Open

Before brute forcing anything, map out what is actually listening. Nmap will tell you which ports and services are open so you can focus on the ones that matter. There is no point testing SSH on a box that is not running it.

Keep the Thread Count Sensible

The -t option sets how many logins Hydra tries at once. The default of 16 is fine for most services, but lab devices, routers and anything with rate limiting can fall over or start returning false results under load. If results look unstable, drop -t to 4 and try again.

Tune for the Service, Not Just Speed

Many services lock accounts or throttle after a handful of failures, which is a good thing and means your defences are working. If Hydra stalls, that is often the target defending itself rather than a bug.

Keeping Your Own Logins Safe

The point of running Hydra on your own systems is to then fix what it finds. The defences that beat brute force are straightforward:

  • Use long, unique passwords. Length beats complexity. A password Hydra can find in a wordlist is one to change today. The browser-based Password and htpasswd Generator will make strong random passwords and passphrases for you.
  • Prefer keys over passwords for SSH. Set up key-based SSH access and disable password authentication entirely, and brute forcing the login becomes a non-starter.
  • Rate limit and ban. Tools like fail2ban or CrowdSec block an IP after a few failed attempts, which is enough to make online brute forcing impractical.
  • Do not expose admin logins to the internet. Put them behind a VPN or restrict them by source IP. An attacker who cannot reach the login cannot brute force it.

Sources

Updated 20 November 2026: reworked around testing your own logins, added apt and dnf install steps and an HTTP login form example, corrected the -t, -s, -v, -V and -f option descriptions, and noted the current thc-hydra 9.7 release.