For the complete documentation index, see llms.txt. This page is also available as Markdown.

Hydra User Guide

  • https://github.com/vanhauser-thc/thc-hydra

Note: For HTTP form brute force, prefer ffuf over hydra — it is faster and more flexible. See the ffuf guide.

Username Generation with username-anarchy

When you know a person's name but not their username format, generate variations:

./username-anarchy firstname lastname > /tmp/usernames.txt

# Example:
./username-anarchy betty jayde > /tmp/usernames.txt
# Generates: betty, bettyjayde, betty.jayde, bettyjay, bettyj, b.jayde, bjayde, jbetty, j.betty, jaydeb, jayde, bj, etc.

Then brute force with the generated list:

hydra -t 4 -L /tmp/usernames.txt -p 'Texas123!@#' ssh://10.129.7.222 -F -vV

Installation

sudo apt-get -y install hydra

Basic Syntax

hydra [login_options] [password_options] [attack_options] [service_options]

Options Table

Option
Description
Example

-l LOGIN

Single username

hydra -l admin ...

-L FILE

Username list file

hydra -L users.txt ...

-p PASS

Single password

hydra -p password123 ...

-P FILE

Password list file

hydra -P passwords.txt ...

-t TASKS

Parallel tasks (threads)

hydra -t 4 ...

-f

Stop after first valid login

hydra -f ...

-F

Stop after first valid login (global)

hydra -F ...

-s PORT

Non-default port

hydra -s 2222 ...

-v / -V

Verbose / Very verbose

hydra -V ...

-M FILE

List of target servers

hydra -M targets.txt ...

-x MIN:MAX:CHARSET

Generate passwords

hydra -x 6:8:a1 ...


Services Table

Service
Protocol
Example

ssh

SSH

hydra -l root -P pass.txt ssh://192.168.1.100

ftp

FTP

hydra -l admin -P pass.txt ftp://192.168.1.100

http-get

HTTP Basic Auth

hydra -L users.txt -P pass.txt example.com http-get /

http-post-form

Web Login Form (HTTP)

See below

https-post-form

Web Login Form (HTTPS)

Same syntax as http-post-form, use for HTTPS

rdp

Remote Desktop

hydra -l admin -P pass.txt rdp://192.168.1.100

smb

SMB

hydra -l admin -P pass.txt 192.168.1.100 smb

mysql

MySQL

hydra -l root -P pass.txt mysql://192.168.1.100

mssql

MS SQL Server

hydra -l sa -P pass.txt mssql://192.168.1.100

vnc

VNC

hydra -P pass.txt vnc://192.168.1.100

pop3

POP3 Mail

hydra -l user -P pass.txt pop3://mail.server.com

imap

IMAP Mail

hydra -l user -P pass.txt imap://mail.server.com

smtp

SMTP Mail

hydra -l user -P pass.txt smtp://mail.server.com

telnet

Telnet

hydra -L users.txt -P pass.txt telnet://192.168.1.100

ldap2

LDAP

hydra -L users.txt -P pass.txt 192.168.1.100 ldap2

snmp

SNMP

hydra -P pass.txt 192.168.1.100 snmp


Hydra Syntax

  • The correct hydra syntax is depended upon the service you are going after. For example if we want to hit ftp we should use:

FTP

Telnet

Telnet can be unreliable for Hydra to analyze. Manually validate any hit with telnet TARGET 23 before trusting the result.

SSH

  • -l is to specify the username

  • P is to specify a password list

  • -t is to specify the number of threads to run hydra with.

  • Note: Hydra recommends no more than 4 threads, however you can run it faster with -t 16.

  • -F means stop when you find your first valid password, highly recommend this option

POST Web Form

  • Hydra can be used to brute force web logins as well.

  • Step 1: Determine the request made to the form (POST/GET)

  • Identify this in the network tab (developer tools), view the source code, or use Burp Suite.

Syntax

Success vs Failure Conditions

Condition
Description
Example

F=string

Failure - Text in response when login fails

F=Invalid credentials

S=string

Success - Text in response when login works

S=Dashboard

S=302

Success - HTTP redirect on successful login

S=302

Use F= when you know the failure message (most common):

Use S= when you know what success looks like:

Full Example

  • http-post-form specifies the type of form

  • /login url the login page URL i.e. http://dont-brute-force-me.com/login.php

  • :username the form field name for the username

  • ^USER^ this tells hydra to use the username you specified

  • password the form field name for the password

  • ^PASS^ the password list specified in the command

  • F=incorrect the word that appears on the page if the login fails

  • -vV specifies very verbose output

  • Hydra non default ssh port:

HTTP-GET

  • Basic Authentication HTTP-GET

Example Syntax

Additional Syntax Formats


Credential Stuffing

  • Use -C with a colon-separated user:pass file instead of separate user and password lists

Password Spraying (SMB via NetExec)

Default Credentials Cheat Sheet

Last updated