THC-Hydra: Obtaining user credentials by brute-force

(Please note this post was published last 4th february 2013 in the Spanish version of Security Art Work. See original post: THC-Hydra: Obtener credenciales de usuario por fuerza bruta)

THC-Hydra is a software used to crack login systems of different services such as HTTP, FTP, TELNET, IMAP, SMB, SSH, etc. in a very easy and fast way. Its latest version (7.4.2) was released last 7th January.

This tool has earned a great reputation thanks to its console mode both in Linux and Windows systems (also offering Linux users the option to use a graphical interface) and the possibility to execute the attacks using threads, giving the user the option to choose the number of threads used to perform the attack.

To carry out the attacks, THC-Hydra is based on the use of dictionaries that contain all the possible options the user may want to try. These are completely necessary for the execution of the program to keep trying different possibilities and to obtain the user credentials.

Its basic version from the command line is very simple: just set the host we want to attack, the type of service, the files that contain the user and password values, and the characteristics of the protocol (when necessary).

For instance, to attack an FTP service, you need: the host to be analyzed, the type of service (ftp), the file containing the list of users (option -L) and the file containing the password list (option -P), what results in:

./hydra host_address ftp -L user_dict -P pass_dict

A more specific example could be an attack against the HTTP login of a website that sends the data using the POST method. In this case in addition to the above information, the user will need to specify the exact URL of the login form, the name of the user and password values ​​in the web form, and the string of HTML code to indicate whether it was successful or not (based on the response from the server). For this example, the command would be as follows:

./hydra host_address http-post-form "/login.php?var_user=^USER^&var_pass=^PASS^:S=Login 
            successful" -L "user_dict" -P "pass_dict"

Where the exact url of the form is “login.php“, the parameter name of the form containing the user is “var_user“, the password is “var_pass” and the string that indicates that the login is correct is “Login successful“.

In the next picture we see the application output with the different users and passwords that the tool finds in the login form HTTP using POST method:

It should be noted that these are not the only options that can be set in the tool. It is possible to specify the number of threads used (option -t), carry out the attack with a given user (option -l) or a specific password (option -p), add cookies (C=cookie_value), add headers (H=header value), etc. It is strongly recommended to analyze the different options shown in the program help (option -h), the different examples and help links offered on their website

Finally, thanks to tools like THC-Hydra, we can see how easy it can be to get a list of users using passwords too obvious and/or common. This once again demonstrates the importance of using strong passwords for those services we use.


  1. Hi are using WordPress for your blog platform? I’m new
    to the blog world but I’m trying to get started and create my own. Do you require any html
    coding knowledge to make your own blog? Any help would be really appreciated!

  2. I’m curious to find out what blog system you have been using?
    I’m having some small security issues with my latest website and I’d like
    to find something more secure. Do you have any solutions?