Blog | G5 Cyber Security

Hydra: Web Brute Force Guide

TL;DR

This guide shows you how to use Hydra to try and guess usernames and passwords on a web page. It’s for learning purposes only – do not use this against websites you don’t have permission to test.

Prerequisites

Step 1: Gather Information

Before you start, find out:

Step 2: Prepare Wordlists

Hydra needs lists of potential usernames and passwords.

Step 3: Run Hydra

Here’s how to run a basic Hydra attack:

  1. POST Request Example (most common):
    hydra -l username -P passwords.txt https://example.com/login login=^USER^&password=^PASS^
    • -l username: Specifies the username to use (Hydra will iterate through your usernames list).
    • -P passwords.txt: Specifies the password file.
    • https://example.com/login: The login URL.
    • login=^USER^&password=^PASS^: This is crucial! It tells Hydra how to format the POST request, replacing ^USER^ with usernames from your list and ^PASS^ with passwords. Adjust ‘login’ and ‘password’ to match the form parameter names you found in Step 1.
  2. GET Request Example (less common):
    hydra -l username -P passwords.txt https://example.com/login ?username=^USER^&password=^PASS^
    • The main difference is the URL format for GET requests, using a question mark (?) to separate the base URL from the parameters.
  3. Specifying Login Type: If Hydra doesn’t automatically detect the login method correctly, you can force it:
    hydra -l username -P passwords.txt https://example.com/login login=^USER^&password=^PASS^ -f
    • -f: Forces Hydra to use the form-based login method.

Step 4: Analyze Results

Hydra will print any successful logins to the console.

Important Considerations

Exit mobile version